1. 25 Jun, 2009 1 commit
    • Stefan Richter's avatar
      firewire: core: do not DMA-map stack addresses · 6fdc0370
      Stefan Richter authored
      The DMA mapping API cannot map on-stack addresses, as explained in
      Documentation/DMA-mapping.txt.  Convert the two cases of on-stack packet
      payload buffers in firewire-core (payload of lock requests in the bus
      manager work and in iso resource management) to slab-allocated memory.
      
      There are a number on-stack buffers for quadlet write or quadlet read
      requests in firewire-core and firewire-sbp2.  These are harmless; they
      are copied to/ from card driver internal DMA buffers since quadlet
      payloads are inlined with packet headers.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      6fdc0370
  2. 21 Jun, 2009 1 commit
    • Stefan Richter's avatar
      firewire: new stack is no longer experimental · 0c53decd
      Stefan Richter authored
      The new stack is now recommended over the old one if used for industrial
      video (IIDC/DCAM) or for storage devices (SBP-2) due to better
      performance, improved compatibility, added features, and security.  It
      should also be functionally on par with and is more secure than the old
      ieee1394 stack in the use case of consumer video devices.
      
      IP-over-1394 support for the new stack is currently emerging, and a
      backend of the firedtv DVB driver to the new stack should be available
      soon.
      
      The one remaining area where the old stack is still required are audio
      devices, as the new stack is not yet able to support the FFADO FireWire
      audio framework.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      0c53decd
  3. 16 Jun, 2009 4 commits
  4. 14 Jun, 2009 8 commits
  5. 06 Jun, 2009 3 commits
  6. 05 Jun, 2009 6 commits
    • Stefan Richter's avatar
      firewire: rename source files · e71d31da
      Stefan Richter authored
      The source files of firewire-core, firewire-ohci, firewire-sbp2, i.e.
       "drivers/firewire/fw-*.c"
      are renamed to
       "drivers/firewire/core-*.c",
       "drivers/firewire/ohci.c",
       "drivers/firewire/sbp2.c".
      
      The old fw- prefix was redundant to the directory name.  The new core-
      prefix distinguishes the files according to which driver they belong to.
      
      This change comes a little late, but still before further firewire
      drivers are added as anticipated RSN.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      e71d31da
    • Stefan Richter's avatar
      firewire: reorganize header files · 77c9a5da
      Stefan Richter authored
      The three header files of firewire-core, i.e.
       "drivers/firewire/fw-device.h",
       "drivers/firewire/fw-topology.h",
       "drivers/firewire/fw-transaction.h",
      are replaced by
       "drivers/firewire/core.h",
       "include/linux/firewire.h".
      
      The latter includes everything which a firewire high-level driver (like
      firewire-sbp2) needs besides linux/firewire-constants.h, while core.h
      contains the rest which is needed by firewire-core itself and by low-
      level drivers (card drivers) like firewire-ohci.
      
      High-level drivers can now also reside outside of drivers/firewire
      without having to add drivers/firewire to the header file search path in
      makefiles.  At least the firedtv driver will be such a driver.
      
      I also considered to spread the contents of core.h over several files,
      one for each .c file where the respective implementation resides.  But
      it turned out that most core .c files will end up including most of the
      core .h files.  Also, the combined core.h isn't unreasonably big, and it
      will lose more of its contents to linux/firewire.h anyway soon when more
      firewire drivers are added.  (IP-over-1394, firedtv, and there are plans
      for one or two more.)
      
      Furthermore, fw-ohci.h is renamed to ohci.h.  The name of core.h and
      ohci.h is chosen with regard to name changes of the .c files in a
      follow-up change.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      77c9a5da
    • Stefan Richter's avatar
      firewire: clean up includes · e8ca9702
      Stefan Richter authored
      Include required headers which were only indirectly included.
      Remove unused includes and an unused constant.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      e8ca9702
    • Stefan Richter's avatar
      firewire: ohci: access bus_seconds atomically · 3dcdc500
      Stefan Richter authored
      In the unlikely event that card->driver->get_bus_time() is called during
      a cycle64Seconds interrupt, we could read garbage unless atomic accesses
      are used.
      
      The switch to atomic ops requires to change the 64 seconds counter from
      unsigned to signed, but this shouldn't matter to the end result.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      3dcdc500
    • Stefan Richter's avatar
      firewire: also use vendor ID in root directory for driver matches · e41f8d70
      Stefan Richter authored
      Due to AV/C protocol extensions, FireDTV devices need a vendor-specific
      driver.  But their configuration ROM features a vendor ID only in the
      root directory, not in the unit directory.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      e41f8d70
    • Stefan Richter's avatar
      firewire: share device ID table type with ieee1394 · b3b29888
      Stefan Richter authored
      That way, the new firedtv driver will be able to use a single ID table
      in builds against ieee1394 core and/or against firewire core.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      b3b29888
  7. 01 Jun, 2009 2 commits
    • Stefan Richter's avatar
      firewire: core: add sysfs attribute for easier udev rules · 0210b66d
      Stefan Richter authored
      This adds the attribute /sys/bus/firewire/devices/fw[0-9]+/units.  It
      can be used in udev rules like the following ones:
      
      # IIDC devices: industrial cameras and some webcams
      SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010?*", GROUP="video"
      
      # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, ...
      SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
      
      Background:
      
      firewire-core manages two device types:
        - fw_device is a FireWire node.  A character device file is associated
          with it.
        - fw_unit is a unit directory on a node.  Each fw_device may have 0..n
          children of type fw_unit.  The units tell us what kinds of protocols
          a node implements.
      
      We want to set ownership or ACLs or permissions of the character device
      file of an fw_device, or/and create symlinks to it, based on available
      protocols.  Until now udev rules had to look at the fw_unit devices and
      then modify their parent's character device file accordingly.  This is
      problematic for two reasons:  1) It happens sometime after the creation
      of the fw_device, 2) an access policy may require that information from
      all children is evaluated before a decision about the parent is made.
      
      Problem 1) can ultimately not be avoided since this is the nature of
      FireWire nodes:  They may add or remove unit directories at any point in
      time.
      
      However, we can still help userland a lot by providing the protocol type
      information of all units in a summary sysfs attribute directly at the
      fw_device.  This way,
         - the information is immediately available at the affected device
           when userspace goes about to handle an ADD or CHANGE event of the
           fw_device,
         - with most policies, it won't be necessary anymore to dig through
           child attributes.
      
      The new attribute is called "units".  It contains space-separated tuples
      of specifier_id and version of each present unit.  The delimiter within
      tuples is a colon.  Specifier_id and version are printed as 0x%06x.
      
      Here is an example of a node which implements an IPv4 unit and an IPv6
      unit:  $ cat /sys/bus/firewire/devices/fw2/units
      0x00005e:0x000001 0x00005e:0x000002
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      0210b66d
    • Stefan Richter's avatar
      firewire: core: check for missing struct update at build time, not run time · e5333db9
      Stefan Richter authored
      struct fw_attribute_group.attrs.[] must have enough room for all
      attributes.  This can and should be checked at build time.
      
      Our previous check at run time was a little late and not reliable since
      most of the time less than the available attributes are populated.
      
      Furthermore, omit an increment of an index at its last usage.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      e5333db9
  8. 17 May, 2009 1 commit
    • Stefan Richter's avatar
      firewire: core: improve check for local node · 92368890
      Stefan Richter authored
      My recently added test for a device being local in fw-cdev.c got it
      slightly wrong:  Comparisons of node IDs are only valid if the
      generation is current, which I forgot to check.  Normally, serialization
      by card->lock takes care of this, but a device in FW_DEVICE_GONE state
      will necessarily have a wrong generation and invalid node_id.
      
      The "is it local?" check is made 100% correct and simpler now by means
      of a struct fw_device flag which is set at fw_device creation.
      
      Besides the fw-cdev site which was to be fixed, there is another site
      which can make use of the new flag, and an RFC-2734 driver will benefit
      from it too.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      92368890
  9. 27 Mar, 2009 1 commit
  10. 24 Mar, 2009 13 commits