1. 21 2月, 2010 1 次提交
    • S
      firewire: get_cycle_timer optimization and cleanup · 4a9bde9b
      Stefan Richter 提交于
      ohci:  Break out of the retry loop if too many attempts were necessary.
      This may theoretically happen if the chip is fatally defective or if the
      get_cycle_timer ioctl was performed after a CardBus controller was
      ejected.
      
      Also micro-optimize the loop by re-using the last two register reads in
      the next iteration, remove a questionable inline keyword, and shuffle a
      comment around.
      
      core:  ioctl_get_cycle_timer() is always called with interrupts on,
      therefore local_irq_save() can be replaced by local_irq_disable().
      Disabled local IRQs imply disabled preemption, hence preempt_disable()
      can be removed.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      4a9bde9b
  2. 20 2月, 2010 2 次提交
  3. 11 1月, 2010 1 次提交
  4. 30 12月, 2009 7 次提交
    • S
      firewire: qualify config ROM cache pointers as const pointers · 13b302d0
      Stefan Richter 提交于
      Several config ROM related functions only peek at the ROM cache; mark
      their arguments as const pointers.  Ditto fw_device.config_rom and
      fw_unit.directory, as the memory behind them is meant to be write-once.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      13b302d0
    • S
      firewire: core: fw_csr_string addendum · 3c2c58cb
      Stefan Richter 提交于
      Witespace and comment changes, and a different way to say i + 1 < end.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      3c2c58cb
    • C
      firewire: add fw_csr_string() helper function · 1f8fef7b
      Clemens Ladisch 提交于
      The core (sysfs attributes), the firedtv driver, and possible future
      drivers all read strings from some configuration ROM directory.  Factor
      out the generic code from show_text_leaf() into a new helper function,
      modified slightly to handle arbitrary buffer sizes.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      1f8fef7b
    • S
      firewire, ieee1394: update Kconfig help · 5d7db049
      Stefan Richter 提交于
      Update the Kconfig help texts of both stacks to encourage a general move
      from the older to the newer drivers.  However, do not label ieee1394 as
      "Obsolete" yet, as the newer drivers have not been deployed as default
      stack in the majority of Linux distributions yet, and those who start
      doing so now may still want to install the old drivers as fallback for
      unforeseen issues.
      
      Since Linux 2.6.32, FireWire audio devices can be driven by the newer
      firewire driver stack too, hence remove an outdated comment about audio
      devices.  Also remove comments about library versions since the 2nd
      generation of libraw1394 and libdc1394 is now in common use; details on
      library versions can be read at the wiki link from the help texts.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      5d7db049
    • S
      firewire: ohci: always use packet-per-buffer mode for isochronous reception · 090699c0
      Stefan Richter 提交于
      This is a minimal change meant for the short term:  Never set the
      ohci->use_dualbuffer flag to true.
      
      There are two reasons to do so:
      
        - Packet-per-buffer mode and dual-buffer mode do not behave the same
          under certain circumstances, notably if several packets are covered
          by a single fw_cdev_iso_packet descriptor.
          http://marc.info/?l=linux1394-devel&m=124965653718313
          Therefore the driver stack should not silently choose one or the
          other mode but should leave the choice to the high-level driver
          (regardless if kernel driver or userspace driver).  Or simply always
          only offer packet-per-buffer mode, since a considerable number of
          controllers, even current ones, does not offer dual-buffer support.
      
        - Even under circumstances where packet-per-buffer mode and
          dual-buffer mode behave exactly the same --- notably when used
          through libraw1394, libdc1394, as well as the current two kernel
          drivers which use isochronous reception (firewire-net and firedtv)
          --- we are still faced with the problem that several OHCI 1.1
          controllers have bugs in dual-buffer mode.  Although it looks like
          we have identified most of those buggy controllers by now, we
          cannot be quite sure about that.
      
      So, use packet-per-buffer by default from now on.  This change should
      be followed up by a more complete solution:  Either extend the
      in-kernel API and the userspace ABI by a choice between the two IR modes
      or remove all dual-buffer related code from firewire-ohci.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      090699c0
    • S
      firewire: cdev: fix another memory leak in an error path · cf0e575d
      Stefan Richter 提交于
      If copy_from_user in an FW_CDEV_IOC_SEND_RESPONSE ioctl failed, the
      fw_request pointed to by the inbound_transaction_resource is no
      longer referenced and needs to be freed.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      cf0e575d
    • 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
  5. 12 12月, 2009 1 次提交
  6. 04 12月, 2009 1 次提交
  7. 21 11月, 2009 1 次提交
    • J
      firewire: ohci: pass correct iso xmit timestamps to core · 31769cef
      Jay Fenlason 提交于
      Here is the final set of patches I used to get ffado to work with the
      new firewire stack.  With these patches, I was able to start ardour
      and record from and playback to my PreSonus Inspire1394 from a
      (mostly) Fedora 12 system.
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      
      Until now, firewire-ohci exposed only the transmit cycle of the last
      transmitted packet at each isochronous transmit complete event.  This
      made it impossible for FFADO (FireWire audio drivers in userspace) to
      synchronize audio-out streams.  The fix is to store the timestamp of
      each packet in the iso xmit event.  As a bonus, the transfer status is
      stored too.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      31769cef
  8. 19 11月, 2009 1 次提交
    • J
      firewire: ohci: Make cycleMatch ISO transmission work · 5ed1f321
      Jay Fenlason 提交于
      Calling the START_ISO ioctl with a nonnegative cycle paramater has
      never worked.  Last night I got around to figuring out why.  Most of
      this patch is a big comment explaining why we enable an interrupt
      source then don't actually do anything when we get one.  As the
      comment says, we should do more, but we don't have a way to tell
      userspace what happened. . .
      Signed-off-by: NJay Fenlason <fenlason@redhat.com>
      Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (edited comment)
      5ed1f321
  9. 31 10月, 2009 3 次提交
  10. 15 10月, 2009 7 次提交
    • 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
    • S
      firewire: core: clarify generate_config_rom usage · fe242579
      Stefan Richter 提交于
      Move the static config ROM buffer into the scope of the two callers of
      generate_config_rom().  That way the ROM length can be passed over as
      return value rather than through a pointer argument.
      
      It also becomes more obvious that accesses to the config ROM buffer have
      to be serialized and how this is accomplished.  And firewire-core.ko
      shrinks a bit as well.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      fe242579
    • S
      firewire: optimize config ROM creation · 8e85973e
      Stefan Richter 提交于
      The config ROM image of the local node was created in CPU byte order,
      then a temporary big endian copy was created to compute the CRC, and
      finally the card driver created its own big endian copy.
      
      We now generate it in big endian byte order in the first place to avoid
      one byte order conversion and the temporary on-stack copy of the ROM
      image (1000 bytes stack usage in process context).  Furthermore, two
      1000 bytes memset()s are replaced by one 1000 bytes - ROM length sized
      memset.
      
      The trivial fw_memcpy_{from,to}_be32() helpers are now superfluous and
      removed.  The newly added __compute_block_crc() function will be folded
      into fw_compute_block_crc() in a subsequent change.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      8e85973e
    • S
      firewire: cdev: normalize variable names · e21fcf79
      Stefan Richter 提交于
      Unify some names:
        - "e" for pointers to subtypes of struct event,
        - "event" for struct members and pointers to struct event,
        - "r" for pointers to subtypes of struct client_resource,
        - "resource" for struct members and pointers to struct client_resource,
        - other names for struct members and pointers to other types.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      e21fcf79
    • S
      firewire: normalize style of queue_work wrappers · 9fb551bf
      Stefan Richter 提交于
      A few stylistic changes to unify some code patterns in the subsystem:
      
        - The similar queue_delayed_work helpers fw_schedule_bm_work,
          schedule_iso_resource, and sbp2_queue_work now have the same call
          convention.
        - Two conditional calls of schedule_iso_resource are factored into
          another small helper.
        - An sbp2_target_get helper is added as counterpart to
          sbp2_target_put.
      
      Object size of firewire-core is decreased a little bit, object size of
      firewire-sbp2 remains unchanged.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      9fb551bf
    • S
      firewire: sbp2: provide fallback if mgt_ORB_timeout is missing · eaf76e0d
      Stefan Richter 提交于
      The Unit_Characteristics entry of an SBP-2 unit directory is not
      mandatory as far as I can tell.  If it is missing, we would probably
      fail to log in into the target because firewire-sbp2 would not wait for
      status after it sent the login request.
      
      The fix moves the cleanup of tgt->mgt_orb_timeout into a place where it
      is executed exactly once before login, rather than 0..n times depending
      on the target's config ROM.  With targets with one or more
      Unit_Characteristics entries, the result is the same as before.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      eaf76e0d
    • S
      firewire: cdev: fix memory leak in an error path · 7e44c0b5
      Stefan Richter 提交于
      If copy_from_user in an FW_CDEV_IOC_SEND_RESPONSE ioctl failed, an
      inbound_transaction_resource instance is no longer referenced and needs
      to be freed.
      Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
      7e44c0b5
  11. 05 10月, 2009 1 次提交
  12. 16 9月, 2009 1 次提交
  13. 12 9月, 2009 6 次提交
  14. 05 9月, 2009 4 次提交
  15. 03 9月, 2009 1 次提交
  16. 02 9月, 2009 1 次提交
  17. 01 9月, 2009 1 次提交