1. 19 Jun, 2010 8 commits
    • Stefan Richter's avatar
      firewire: core: remove unused variable · ae86e81e
      Stefan Richter authored
      which caused gcc 4.6 to warn about
          variable 'destination' set but not used.
      
      Since the hardware ensures that we receive only response packets with
      proper destination node ID (in a given bus generation), we have no use
      for destination here in the core as well as in upper layers.
      
      (This is different with request packets.  There we pass destination node
      ID to upper layers because they may for example need to check whether
      this was an unicast or broadcast request.)
      Reported-and-Tested-By: default avatarJustin P. Mattock <justinmattock@gmail.com>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      ae86e81e
    • Stefan Richter's avatar
      ieee1394: remove unused variables · 5030c807
      Stefan Richter authored
      which caused gcc 4.6 to warn about
          variable 'XYZ' set but not used.
      
      sbp2.c, unit_characteristics:
      
      The underlying problem which was spotted here --- an incomplete
      implementation --- is already 50% fixed in drivers/firewire/sbp2.c which
      observes mgt_ORB_timeout but not yet ORB_size.
      
      raw1394.c, length_conflict; dv1394.c, ts_off:
      
      Impossible to tell why these variables are there.  We can safely remove
      them though because we don't need a compiler warning to realize that we
      are dealing with (at least stylistically) flawed code here.
      
      dv1394.c, packet_time:
      
      This was used in debug macro that is only compiled in with
      DV1394_DEBUG_LEVEL >= 2 defined at compile-time.  Just drop it since
      nobody debugs dv1394 anymore.  Avoids noise in regular kernel builds.
      
      dv1394.c, ohci; eth1394.c, priv:
      
      These variables clearly can go away.  Somebody wanted to use them but
      then didn't (or not anymore).
      
      Note, all of this code is considered to be at its end of life and is
      thus not really meant to receive janitorial updates anymore.  But if we
      can easily remove noisy warnings from kernel builds, we should.
      Reported-by: default avatarJustin P. Mattock <justinmattock@gmail.com>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      5030c807
    • Stefan Richter's avatar
      firewire: rename CSR access driver methods · 0fcff4e3
      Stefan Richter authored
      Rather than "read a Control and Status Registers (CSR) Architecture
      register" I prefer to say "read a Control and Status Register".
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      0fcff4e3
    • Stefan Richter's avatar
      firewire: core: combine some repeated code · b384cf18
      Stefan Richter authored
      All of these CSRs have the same read/ write/ aynthing-else handling,
      except for CSR_PRIORITY_BUDGET which might not be implemented.
      
      The CSR_CYCLE_TIME read handler implementation accepted 4-byte-sized
      block write requests before this change but this is just silly; the
      register is only required to support quadlet read and write requests
      like the other r/w CSR core and Serial-Bus-dependent registers.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      b384cf18
    • Stefan Richter's avatar
      firewire: normalize STATE_CLEAR/SET CSR access interface · c8a94ded
      Stefan Richter authored
      Push the maintenance of STATE_CLEAR/SET.abdicate down into the card
      driver.  This way, the read/write_csr_reg driver method works uniformly
      across all CSR offsets.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      c8a94ded
    • Stefan Richter's avatar
      firewire: replace get_features card driver hook · db3c9cc1
      Stefan Richter authored
      by feature variables in the fw_card struct.  The hook appeared to be an
      unnecessary abstraction in the card driver interface.
      
      Cleaner would be to pass those feature flags as arguments to
      fw_card_initialize() or fw_card_add(), but the FairnessControl register
      is in the SCLK domain and may therefore not be accessible while Link
      Power Status is off, i.e. before the card->driver->enable call from
      fw_card_add().
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      db3c9cc1
    • Stefan Richter's avatar
      firewire: drop sizeof expressions from some request size arguments · e847cc83
      Stefan Richter authored
      In case of fw_card_bm_work()'s lock request, the present sizeof
      expression is going to be wrong if somebody changes the fw_card's DMA
      scratch buffer's size in the future.
      
      In case of quadlet write requests, sizeof(u32) is just silly; it's 4.
      
      In case of SBP-2 ORB pointer write requests, 8 is arguably quicker to
      understand as the correct and only possible value than
      sizeof(some_datum).
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      e847cc83
    • Stefan Richter's avatar
      firewire: 'add CSR_... support' addendum · 65b2742a
      Stefan Richter authored
      Add a comment on which of the conflicting NODE_IDS specifications we
      implement.  Reduce a comment on rather irrelevant register bits that can
      all be looked up in the spec (or from now on in the code history).
      Directly include the required indirectly included bug.h.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      65b2742a
  2. 10 Jun, 2010 16 commits
  3. 09 Jun, 2010 4 commits
  4. 31 May, 2010 1 commit
  5. 25 May, 2010 1 commit
    • Stefan Richter's avatar
      ieee1394: schedule for removal · 3014420b
      Stefan Richter authored
      All application domains that are supported by the old ieee1394 driver
      stack are supported by the newer firewire driver stack too.  There is
      now good and extensive experience with the newer stack from deployment
      in Fedora since F7 as well as by enthusiast users of other
      distributions.
      
      The new drivers have consequently been recommended as the default ones
      since 2.6.33, in order to fix some severe usability problems of FireWire
      on Linux due to limitations of the old stack.  It is now high time to
      announce when the obsolete drivers will be removed.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: default avatarJarod Wilson <jarod@redhat.com>
      3014420b
  6. 18 May, 2010 2 commits
  7. 19 Apr, 2010 2 commits
    • Clemens Ladisch's avatar
      firewire: core: make transaction label allocation more robust · 7906054f
      Clemens Ladisch authored
      If one request is so long-lived that it does not get a response before
      the following 63 requests, its bit in tlabel_mask is still set when the
      next request tries to allocate a transaction label for that number.  In
      this state, while the first request is not completed or timed out, no
      new requests can be submitted.
      
      To fix this, skip over any label still in use, and do not error out
      unless we have entirely run out of labels.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      7906054f
    • Stefan Richter's avatar
      firewire: core: clean up config ROM related defined constants · edd5bdaf
      Stefan Richter authored
      Clemens Ladisch pointed out that
        - BIB_IMC is not named like the field is called in the standard,
        - readers of the code may get worried about the magic 0x0c0083c0,
        - a CSR_NODE_CAPABILITIES key is there in the header but not put to
          good use.
      
      So let's rename BIB_IMC, add a defined constant for Node_Capabilities
      and a comment which reassures people that somebody thought about it and
      they don't have to (or if they still do, tell them where they have to
      look for confirmation), and prune our incomplete and arbitrary set of
      defined constants of CSR key IDs.  And there is a nother magic number,
      that of Bus_Information_Block.Bus_Name, to be defined and commented.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      edd5bdaf
  8. 10 Apr, 2010 6 commits
    • Stefan Richter's avatar
      ieee1394: mark char device files as not seekable · 7cfe21aa
      Stefan Richter authored
      The
        - raw1394   (/dev/raw1394),
        - video1394 (/dev/video1394/*),
        - dv1394    (/dev/dv1394/*)
      character device file ABIs do not make any use of lseek(), pread(), or
      pwrite().  Therefore use nonseekable_open() and, redundantly, set
      file_operations.llseek to no_llseek to remove any doubt whether the BKL-
      grabbing default_llseek handler is used.
      
      Although all this is legacy code which should be left in peace until it
      is eventually removed (as it is superseded by firewire-core's
      <linux/firewire-cdev.h> ABI), this change seems still worth doing to
      further minimize the presence of BKL usage in the kernel.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      7cfe21aa
    • Stefan Richter's avatar
      firewire: cdev: mark char device files as not seekable · 3ac26b2e
      Stefan Richter authored
      The <linux/firewire-cdev.h> character device file ABI (i.e. /dev/fw*
      character device file interface) does not make any use of lseek(),
      pread(), pwrite() (or any kind of write() at all).
      
      Use nonseekable_open() and, redundantly, set file_operations.llseek to
      no_llseek to remove any doubt whether the BKL-grabbing default_llseek
      handler is used.  (Also shuffle file_operations initialization according
      to the order of handler definitions.)
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      3ac26b2e
    • Stefan Richter's avatar
      firewire: ohci: cleanups and fix for nonstandard build without debug facility · 5da3dac8
      Stefan Richter authored
      1) Clean up two function names:  The ohci_ prefix is only used in names
      of fw_card_driver hooks.  There were two unnecessary exceptions.
      
      2) Replace empty macros by empty inline functions so that call parameter
      type checking is available in #ifndef'd builds.
      
      3) CONFIG_FIREWIRE_OHCI_DEBUG is currently a hidden kconfig variable,
      hence is not going to be switched off by anybody.  Still, it can be
      switched off but then compilation will fail in ohci_enable() at the
      expression param_debug & OHCI_PARAM_DEBUG_BUSRESETS.  Add the necessary
      definitions in the nonstandard case.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      5da3dac8
    • Stefan Richter's avatar
      firewire: ohci: wait for PHY register accesses to complete · 35d999b1
      Stefan Richter authored
      Rather than having the arbitrary msleep(2) pause, let read_phy_reg()
      loop until the link--phy access was finished.
      
      Factor write_phy_reg() out of ohci_update_phy_reg() and of
      read_paged_phy_reg() and let it loop too until the link--phy access was
      finished.
      
      Like in the older ohci1394 driver, a timeout of 100 milliseconds is
      chosen.  Unlike the old driver, we sleep instead of busy-wait in each
      waiting loop iteration.  Instead of a loop, the waiting could probably
      also be implemented interrupt driven, but why bother.  It would require
      up and running interrupt handling before the link was fully configured
      and enabled.
      
      Also modify functions a bit:  Error return and value return can be
      combined in read_phy_reg() since the domain of values is only u8.
      Likewise in read_paged_phy_reg().
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      35d999b1
    • Clemens Ladisch's avatar
      firewire: ohci: fix up configuration of TI chips · 54672386
      Clemens Ladisch authored
      On TI chips (OHCI-Lynx and later), enable link enhancements features
      that TI recommends to be used.  None of these are required for proper
      operation, but they are safe and nice to have.
      
      In theory, these bits should have been set by default, but in practice,
      some BIOS/EEPROM writers apparently do not read the datasheet, or get
      spooked by names like "unfair".
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      54672386
    • Clemens Ladisch's avatar
      firewire: ohci: enable 1394a enhancements · 925e7a65
      Clemens Ladisch authored
      The OHCI spec says that, if the programPhyEnable bit is set, the driver
      is responsible for configuring the IEEE1394a enhancements within the PHY
      and the link consistently.  So do this.
      
      Also add a quirk to allow disabling these enhancements; this is needed
      for the TSB12LV22 where ack accelerations are buggy (erratum b).
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      925e7a65