1. 23 7月, 2010 2 次提交
    • S
      firewire: cdev: add PHY packet reception · bf54e146
      Stefan Richter 提交于
      Add an FW_CDEV_IOC_RECEIVE_PHY_PACKETS ioctl() and
      FW_CDEV_EVENT_PHY_PACKET_RECEIVED poll()/read() event for /dev/fw*.
      This can be used to get information from remote PHYs by remote access
      PHY packets.
      
      This is also the 2nd half of the functionality (the receive part) to
      support a userspace implementation of a VersaPHY transaction layer.
      
      Safety considerations:
      
        - PHY packets are generally broadcasts, hence some kind of elevated
          privileges should be required of a process to be able to listen in
          on PHY packets.  This implementation assumes that a process that is
          allowed to open the /dev/fw* of a local node does have this
          privilege.
      
          There was an inconclusive discussion about introducing POSIX
          capabilities as a means to check for user privileges for these
          kinds of operations.
      
      Other limitations:
      
        - PHY packet reception may be switched on by ioctl() but cannot be
          switched off again.  It would be trivial to provide an off switch,
          but this is not worth the code.  The client should simply close()
          the fd then, or just ignore further events.
      
        - For sake of simplicity of API and kernel-side implementation, no
          filter per packet content is provided.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      bf54e146
    • S
      firewire: normalize status values in packet callbacks · 18d0cdfd
      Stefan Richter 提交于
      core-transaction.c transmit_complete_callback() and close_transaction()
      expect packet callback status to be an ACK or RCODE, and ACKs get
      translated to RCODEs for transaction callbacks.
      
      An old comment on the packet callback API (been there from the initial
      submission of the stack) and the dummy_driver implementation of
      send_request/send_response deviated from this as they also included
      -ERRNO in the range of status values.
      
      Let's narrow status values down to ACK and RCODE to prevent surprises.
      RCODE_CANCELLED is chosen as the dummy_driver's RCODE as its meaning of
      "transaction timed out" comes closest to what happens when a transaction
      coincides with card removal.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      18d0cdfd
  2. 13 7月, 2010 2 次提交
    • S
      firewire: core: integrate software-forced bus resets with bus management · 02d37bed
      Stefan Richter 提交于
      Bus resets which are triggered
        - by the kernel drivers after updates of the local nodes' config ROM,
        - by userspace software via ioctl
      shall be deferred until after >=2 seconds after the last bus reset.
      
      If multiple modifications of the local nodes' config ROM happen in a row,
      only a single bus reset should happen after them.
      
      When the local node's link goes from inactive to active or vice versa,
      and at the two occasions of bus resets mentioned above --- and if the
      current gap count differs from 63 --- the bus reset should be preceded
      by a PHY configuration packet that reaffirms the gap count.  Otherwise a
      bus manager would have to reset the bus again right after that.
      
      This is necessary to promote bus stability, e.g. leave grace periods for
      allocations and reallocations of isochronous channels and bandwidth,
      SBP-2 reconnections etc.; see IEEE 1394 clause 8.2.1.
      
      This change implements all of the above by moving bus reset initiation
      into a delayed work (except for bus resets which are triggered by the
      bus manager workqueue job and are performed there immediately).  It
      comes with a necessary addition to the card driver methods that allows
      to get the current gap count from PHY registers.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      02d37bed
    • S
      firewire: core: fix fw_send_request kerneldoc comment · 656b7afd
      Stefan Richter 提交于
      The present inline documentation of the fw_send_request() in-kernel API
      refers to userland code that is not applicable to kernel drivers at all.
      Reported-by: NBen Gamari <bgamari.foss@gmail.com>
      
      While we are at fixing the whole documentation of fw_send_request(),
      also improve the rest of firewire-core's kerneldoc comments:
        - Add a bit of text concerning fw_run_transaction()'s call parameters.
        - Append () to function names and tab-align parameter descriptions as
          suggested by the example in Documentation/kernel-doc-nano-HOWTO.txt.
        - Remove kerneldoc markers from comments on static functions.
        - Remove outdated parameter descriptions at build_tree().
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      656b7afd
  3. 21 6月, 2010 2 次提交
    • J
      firewire: expose extended tcode of incoming lock requests to (userspace) drivers · c82f91f2
      Jay Fenlason 提交于
      When a remote device does a LOCK_REQUEST, the core does not pass
      the extended tcode to userspace.  This patch makes it use the
      juju-specific tcodes listed in firewire-constants.h for incoming
      requests.
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      
      This matches how tcode in the API for outbound requests is treated.
      Affects kernelspace and userspace drivers alike, but at the moment there
      are no kernespace drivers that receive lock requests.
      
      Split out from a combo patch, slightly reordered, changelog reworded.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      c82f91f2
    • S
      firewire: remove an unused function argument · 33e553fe
      Stefan Richter 提交于
      void (*fw_address_callback_t)(..., int speed, ...) is the speed that a
      remote node chose to transmit a request to us.  In case of split
      transactions, firewire-core will transmit the response at that speed.
      
      Upper layer drivers on the other hand (firewire-net, -sbp2, firedtv, and
      userspace drivers) cannot do anything useful with that speed datum,
      except log it for debug purposes.  But data that is merely potentially
      (not even actually) used for debug purposes does not belong into the API.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      33e553fe
  4. 19 6月, 2010 6 次提交
  5. 10 6月, 2010 14 次提交
  6. 19 5月, 2010 2 次提交
  7. 20 4月, 2010 1 次提交
  8. 21 2月, 2010 1 次提交
    • S
      firewire: remove incomplete Bus_Time CSR support · 168cf9af
      Stefan Richter 提交于
      The current implementation of Bus_Time read access was buggy since it
      did not ensure that Bus_Time.second_count_hi and second_count_lo came
      from the same 128 seconds period.
      Reported-by: NHåkan Johansson <f96hajo@chalmers.se>
      
      Instead of a fix, remove Bus_Time register support altogether.  The spec
      requires all cycle master capable nodes to implement this (all Linux
      nodes are cycle master capable) while it also says that it "may" be
      initialized by the bus manager or by the IRM standing in for a bus
      manager.  (Neither Linux' firewire-core nor ieee1394 nodemgr implement
      this.)
      
      Since we cannot rely on Bus_Time having been initialized by a bus
      manager, it is better to return an error instead of a nonsensical value
      on a read request to Bus_Time.
      
      Alternatively, we could fix the Bus_Time read integrity bug _and_
      implement (a) cycle master's write support of the register as well as
      (b) bus manager's Bus_Time initialization service, i.e. preservation of
      the Bus_Time when the cycle master node of a bus changes.  However, that
      would be quite some code for a feature that is unreliable to begin with
      and very likely unused in practice.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      168cf9af
  9. 30 12月, 2009 1 次提交
    • C
      firewire: fix use of multiple AV/C devices, allow multiple FCP listeners · db5d247a
      Clemens Ladisch 提交于
      Control of more than one AV/C device at once --- e.g. camcorders, tape
      decks, audio devices, TV tuners --- failed or worked only unreliably,
      depending on driver implementation.  This affected kernelspace and
      userspace drivers alike and was caused by firewire-core's inability to
      accept multiple registrations of FCP listeners.
      
      The fix allows multiple address handlers to be registered for the FCP
      command and response registers.  When a request for these registers is
      received, all handlers are invoked, and the Firewire response is
      generated by the core and not by any handler.
      
      The cdev API does not change, i.e., userspace is still expected to send
      a response for FCP requests; this response is silently ignored.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (changelog, rebased, whitespace)
      db5d247a
  10. 31 10月, 2009 2 次提交
  11. 15 10月, 2009 1 次提交
    • S
      firewire: core: optimize Topology Map creation · cb7c96da
      Stefan Richter 提交于
      The Topology Map of the local node was created in CPU byte order,
      then a temporary big endian copy was created to compute the CRC,
      and when a read request to the Topology Map arrived it had to be
      converted to big endian byte order again.
      
      We now generate it in big endian byte order in the first place.
      This also rids us of 1000 bytes stack usage in tasklet context.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      cb7c96da
  12. 12 9月, 2009 1 次提交
  13. 14 6月, 2009 1 次提交
  14. 05 6月, 2009 3 次提交
    • S
      firewire: rename source files · e71d31da
      Stefan Richter 提交于
      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: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e71d31da
    • S
      firewire: reorganize header files · 77c9a5da
      Stefan Richter 提交于
      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: NStefan Richter <stefanr@s5r6.in-berlin.de>
      77c9a5da
    • S
      firewire: clean up includes · e8ca9702
      Stefan Richter 提交于
      Include required headers which were only indirectly included.
      Remove unused includes and an unused constant.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e8ca9702
  15. 25 3月, 2009 1 次提交