1. 12 5月, 2014 1 次提交
  2. 28 2月, 2014 1 次提交
  3. 10 6月, 2013 1 次提交
    • S
      firewire: introduce fw_driver.probe and .remove methods · 94a87157
      Stefan Richter 提交于
      FireWire upper layer drivers are converted from generic
          struct driver.probe() and .remove()
      to bus-specific
          struct fw_driver.probe() and .remove().
      
      The new .probe() adds a const struct ieee1394_device_id *id argument,
      indicating the entry in the driver's device identifiers table which
      matched the fw_unit to be probed.  This new argument is used by the
      snd-firewire-speakers driver to look up device-specific parameters and
      methods.  There is at least one other FireWire audio driver currently in
      development in which this will be useful too.
      
      The new .remove() drops the unused error return code.
      
      Although all in-tree drivers are being converted to the new methods,
      support for the old methods is left in place in this commit.  This
      allows public developer trees to merge this commit and then move to the
      new fw_driver methods.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: Clemens Ladisch <clemens@ladisch.de> (for sound/firewire/)
      Cc: Peter Hurley <peter@hurleysoftware.com> (for drivers/staging/fwserial/)
      94a87157
  4. 29 4月, 2013 1 次提交
  5. 28 3月, 2013 1 次提交
    • S
      net: add ETH_P_802_3_MIN · e5c5d22e
      Simon Horman 提交于
      Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
      an 802.3 frame. Frames with a lower value in the ethernet type field
      are Ethernet II.
      
      Also update all the users of this value that David Miller and
      I could find to use the new constant.
      
      Also correct a bug in util.c. The comparison with ETH_P_802_3_MIN
      should be >= not >.
      
      As suggested by Jesse Gross.
      
      Compile tested only.
      
      Cc: David Miller <davem@davemloft.net>
      Cc: Jesse Gross <jesse@nicira.com>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: John W. Linville <linville@tuxdriver.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Bart De Schuymer <bart.de.schuymer@pandora.be>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: linux-bluetooth@vger.kernel.org
      Cc: netfilter-devel@vger.kernel.org
      Cc: bridge@lists.linux-foundation.org
      Cc: linux-wireless@vger.kernel.org
      Cc: linux1394-devel@lists.sourceforge.net
      Cc: linux-media@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: dev@openvswitch.org
      Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      Acked-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5c5d22e
  6. 27 3月, 2013 6 次提交
    • Y
    • Y
      firewire net, ipv4 arp: Extend hardware address and remove driver-level packet inspection. · 6752c8db
      YOSHIFUJI Hideaki / 吉藤英明 提交于
      Inspection of upper layer protocol is considered harmful, especially
      if it is about ARP or other stateful upper layer protocol; driver
      cannot (and should not) have full state of them.
      
      IPv4 over Firewire module used to inspect ARP (both in sending path
      and in receiving path), and record peer's GUID, max packet size, max
      speed and fifo address.  This patch removes such inspection by extending
      our "hardware address" definition to include other information as well:
      max packet size, max speed and fifo.  By doing this, The neighbour
      module in networking subsystem can cache them.
      
      Note: As we have started ignoring sspd and max_rec in ARP/NDP, those
            information will not be used in the driver when sending.
      
      When a packet is being sent, the IP layer fills our pseudo header with
      the extended "hardware address", including GUID and fifo.  The driver
      can look-up node-id (the real but rather volatile low-level address)
      by GUID, and then the module can send the packet to the wire using
      parameters provided in the extendedn hardware address.
      
      This approach is realistic because IP over IEEE1394 (RFC2734) and IPv6
      over IEEE1394 (RFC3146) share same "hardware address" format
      in their address resolution protocols.
      
      Here, extended "hardware address" is defined as follows:
      
      union fwnet_hwaddr {
      	u8 u[16];
      	struct {
      		__be64 uniq_id;		/* EUI-64			*/
      		u8 max_rec;		/* max packet size		*/
      		u8 sspd;		/* max speed			*/
      		__be16 fifo_hi;		/* hi 16bits of FIFO addr	*/
      		__be32 fifo_lo;		/* lo 32bits of FIFO addr	*/
      	} __packed uc;
      };
      
      Note that Hardware address is declared as union, so that we can map full
      IP address into this, when implementing MCAP (Multicast Cannel Allocation
      Protocol) for IPv6, but IP and ARP subsystem do not need to know this
      format in detail.
      
      One difference between original ARP (RFC826) and 1394 ARP (RFC2734)
      is that 1394 ARP Request/Reply do not contain the target hardware address
      field (aka ar$tha).  This difference is handled in the ARP subsystem.
      
      CC: Stephan Gatzka <stephan.gatzka@gmail.com>
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6752c8db
    • Y
      firewire net: Ignore spd and max_payload advertised by ARP. · 61a7839a
      YOSHIFUJI Hideaki / 吉藤英明 提交于
      Stefan Richter <stefanr@s5r6.in-berlin.de> says:
      | As far as I can tell, it would be best to ignore max_rec and sspd from ARP
      | and NDP but keep using the respective information from firewire-core
      | instead (handed over by fwnet_probe()).
      |
      | Why?  As I noted earlier, RFC 2734:1999 and RFC 3146:2001 were apparently
      | written with a too simplistic notion of IEEE 1394 bus topology, resulting
      | in max_rec and sspd in ARP-1394 and NDP-1394 to be useless, IMO.
      |
      | Consider a bus like this:
      |
      |     A ---- B ==== C
      |
      | A, B, C are all IP-over-1394 capable nodes.  ---- is an S400 cable hop,
      | and ==== is an S800 cable hop.
      |
      | In case of unicasts or multicasts in which node A is involved as
      | transmitter or receiver, as well as in case of broadcasts, the speeds
      | S100, S200, S400 work and speed S400 is optimal.
      |
      | In case of anything else, IOW in case of unicasts or multicasts in which
      | only nodes B and C are involved, the speeds S100, S200, S400, S800 work
      | and speed S800 is optimal.
      |
      | Clearly, node A should indicate sspd = S400 in its ARP or NDP packets.
      | But which sspd should nodes B and C set there?  Maybe they set S400, which
      | would work but would waste half of the available bandwidth in the second
      | case.  Or maybe they set S800, which is OK in the second case but would
      | prohibit any communication with node A if blindly taken for correct.
      |
      | On the other hand, firewire-core *always* gives us the correct and optimum
      | peer-to-peer speed and asynchronous packet payload, no matter how simple
      | or complex the bus topology is and no matter in which temporal order nodes
      | join the bus and are discovered.
      
      CC: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61a7839a
    • Y
      firewire net: Allocate address handler before registering net_device. · 382c4b40
      YOSHIFUJI Hideaki / 吉藤英明 提交于
      Allocate FIFO address before registering net_device.
      This is preparation to change the pseudo hardware address format
      for firewire devices to include the offset of the FIFO for receipt
      of unicast datagrams, instead of mangling ARP/NDP messages in the
      driver layer.
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      382c4b40
    • Y
      firewire net: Send L2 multicast via GASP. · 021b97e4
      YOSHIFUJI Hideaki / 吉藤英明 提交于
      Send L2 multicast packet via GASP (Global asynchronous stream packet) by
      seeing the multicast bit in the L2 hardware address, not by seeing upper-
      layer protocol address.
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      021b97e4
    • Y
  7. 13 3月, 2013 11 次提交
  8. 21 1月, 2013 2 次提交
  9. 03 12月, 2012 2 次提交
  10. 23 2月, 2012 2 次提交
    • S
      firewire: net: use dev_printk API · 8408dc1c
      Stefan Richter 提交于
      Change the log line prefix from "firewire_net: " to "net firewire0: "
      etc. for the case that several RFC 2734 interfaces are being used in the
      same machine.
      
      Note, the netdev_printk API is not very useful to firewire-net.
      netdev_notice(net, "abc\n") would result in irritating messages like
      "firewire_ohci 0000:0a:00.0: firewire0: abc".  Nor would a dev_printk on
      the fw_unit.device to which firewire-net is being bound be useful,
      because there are generally multiple ones of those per interface (from
      all RFC 2734 peers on the bus, the local node being only one of them).
      
      In the initialization message of each interface, log the PCI device
      name of the card which is parent of the netdevice instead of the GUID
      of the peer which was semi-randomly used to establish the netdevice.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      8408dc1c
    • S
      firewire: net: identify to driver core as "firewire_net", not "net" · 59759ff6
      Stefan Richter 提交于
      On second thought, there is little reason to have driver name differ
      from module name.  Therefore, change
          /sys/bus/firewire/drivers/net
          /sys/bus/firewire/devices/fw0.0/driver -> [...]/net
          /sys/module/firewire_net/drivers/firewire:net
      to
          /sys/bus/firewire/drivers/firewire_net
          /sys/bus/firewire/devices/fw0.0/driver -> [...]/firewire_net
          /sys/module/firewire_net/drivers/firewire:firewire_net
      It is redundant but consistent with firewire-sbp2's recently changed
      driver name.
      
      I don't see this anywhere used, so it should not matter either way.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      59759ff6
  11. 09 10月, 2011 2 次提交
    • S
      firewire: net: Use posted writes · a74477db
      Stephan Gatzka 提交于
      Change memory region to ohci "middle address space". This effectively
      reduces the number of packets by 50%.
      
      [Stefan R.:]  This eliminates 1394 ack packets and improved throughput
      by a few percent in some tests with an S400a connection with and without
      gap count optimization.  Since firewire-net taxes the AR-req DMA unit of
      a FireWire controller much more than firewire-sbp2 (which uses the
      middle address space with PCI posted writes too), this commit also
      changes a related error printk into a ratelimited one as a precaution.
      
      Side note:  The IPv4-over-1394 drivers of Mac OS X 10.4, Windows XP SP3,
      and the Thesycon 1394 bus driver for Windows all use the middle address
      space too.
      Signed-off-by: NStephan Gatzka <stephan@gatzka.org>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      a74477db
    • S
      firewire: use clamp and min3 macros · 4ec4a67a
      Stefan Richter 提交于
      Use kernel.h's convenience macros.  Also omit a printk that should never
      happen and won't matter much if it ever happened.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4ec4a67a
  12. 13 7月, 2011 1 次提交
  13. 02 6月, 2011 1 次提交
  14. 11 5月, 2011 1 次提交
    • C
      firewire: optimize iso queueing by setting wake only after the last packet · 13882a82
      Clemens Ladisch 提交于
      When queueing iso packets, the run time is dominated by the two
      MMIO accesses that set the DMA context's wake bit.  Because most
      drivers submit packets in batches, we can save much time by
      removing all but the last wakeup.
      
      The internal kernel API is changed to require a call to
      fw_iso_context_queue_flush() after a batch of queued packets.
      The user space API does not change, so one call to
      FW_CDEV_IOC_QUEUE_ISO must specify multiple packets to take
      advantage of this optimization.
      
      In my measurements, this patch reduces the time needed to queue
      fifty skip packets from userspace to one sixth on a 2.5 GHz CPU,
      or to one third at 800 MHz.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      13882a82
  15. 31 3月, 2011 1 次提交
  16. 21 1月, 2011 1 次提交
  17. 19 12月, 2010 2 次提交
    • S
      firewire: net: set carrier state at ifup · c1671470
      Stefan Richter 提交于
      At ifup, carrier status would be shown on even if it actually was off.
      Also add an include for ethtool_ops rather than to rely on the one from
      netdevice.h.
      
      Note, we can alas not use fwnet_device_mutex to serialize access to
      dev->peer_count (as I originally wanted).  This would cause a lock
      inversion:
        - fwnet_probe | takes fwnet_device_mutex
            + register_netdev | takes rtnl_mutex
        - devinet_ioctl | takes rtnl_mutex
            + fwnet_open | ...must not take fwnet_device_mutex
      
      Hence use the dev->lock spinlock for serialization.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      c1671470
    • M
      firewire: net: add carrier detection · 18bb36f9
      Maxim Levitsky 提交于
      To make userland, e.g. NetworkManager work with firewire, we need to
      detect whether cable is plugged or not.  Simple and correct way of doing
      that is just counting number of peers.  No peers - no link and vice
      versa.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      18bb36f9
  18. 14 12月, 2010 1 次提交
  19. 17 11月, 2010 2 次提交
    • S
      firewire: net: throttle TX queue before running out of tlabels · b2268830
      Stefan Richter 提交于
      This prevents firewire-net from submitting write requests in fast
      succession until failure due to all 64 transaction labels were used up
      for unfinished split transactions.  The netif_stop/wake_queue API is
      used for this purpose.
      
      Without this stop/wake mechanism, datagrams were simply lost whenever
      the tlabel pool was exhausted.  Plus, tlabel exhaustion by firewire-net
      also prevented other unrelated outbound transactions to be initiated.
      
      The chosen queue depth was checked by me to hit the maximum possible
      throughput with an OS X peer whose receive DMA is good enough to never
      reject requests due to busy inbound request FIFO.  Current Linux peers
      show a mixed picture of -5%...+15% change in bandwidth; their current
      bottleneck are RCODE_BUSY situations (fewer or more, depending on TX
      queue depth) due to too small AR buffer in firewire-ohci.
      
      Maxim Levitsky tested this change with similar watermarks with a Linux
      peer and some pending firewire-ohci improvements that address the
      RCODE_BUSY problem and confirmed that these TX queue limits are good.
      
      Note:  This removes some netif_wake_queue from reception code paths.
      They were apparently copy&paste artefacts from a nonsensical
      netif_wake_queue use in the older eth1394 driver.  This belongs only
      into the transmit path.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      Tested-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      b2268830
    • S
      firewire: net: replace lists by counters · 48553011
      Stefan Richter 提交于
      The current transmit code does not at all make use of
        - fwnet_device.packet_list
      and only very limited use of
        - fwnet_device.broadcasted_list,
        - fwnet_device.queued_packets.
      Their current function is to track whether the TX soft-IRQ finished
      dealing with an skb when the AT-req tasklet takes over, and to discard
      pending tx datagrams (if there are any) when the local node is removed.
      
      The latter does actually contain a race condition bug with TX soft-IRQ
      and AT-req tasklet.
      
      Instead of these lists and the corresponding link in fwnet_packet_task,
        - a flag in fwnet_packet_task to track whether fwnet_tx is done,
        - a counter of queued datagrams in fwnet_device
      do the job as well.
      
      The above mentioned theoretic race condition is resolved by letting
      fwnet_remove sleep until all datagrams were flushed.  It may sleep
      almost arbitrarily long since fwnet_remove is executed in the context of
      a multithreaded (concurrency managed) workqueue.
      
      The type of max_payload is changed to u16 here to avoid waste in struct
      fwnet_packet_task.  This value cannot exceed 4096 per IEEE 1394:2008
      table 16-18 (or 32678 per specification of packet headers, if there is
      ever going to be something else than beta mode).
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      48553011