1. 26 11月, 2008 5 次提交
    • I
      rt2x00: Don't switch off LED on initialization · d507748a
      Ivo van Doorn 提交于
      When we switch off the LEDS during initialization
      we kill rt73usb from proper functioning. The immediate
      result after the first LED command are MCU failures
      and a complete breakdown of TX/RX.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d507748a
    • I
      rt2x00: Detect USB BULK in/out endpoints · f1ca2167
      Ivo van Doorn 提交于
      Instead of hardcoding the used in/out endpoints
      we should detect them by walking through all
      available endpoints.
      
      rt2800usb will gain the most out of this, because
      the legacy drivers indicate that there are multiple
      endpoints available.
      However this code might benefit at least rt73usb as
      well for the MIMO queues, and if we are really lucky
      rt2500usb will benefit because for the TX and PRIO
      queues.
      
      Even if rt2500usb and rt73usb do not get better performance
      after this patch, the endpoint detection still belongs to
      rt2x00usb, and it shouldn't hurt to always try to detect
      the available endpoints.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f1ca2167
    • I
      rt2x00: Fix TX failure path · 0e3de998
      Ivo van Doorn 提交于
      The callback function write_tx_data() can only fail
      when our ENTRY_OWNER_DEVICE_DATA flag on a queue entry
      failed to determine the entry was not available and
      it is in fact still owned by the hardware.
      This means that if that function fails the queue
      must be stopped in mac80211.
      
      When rt2x00queue_get_queue() returns NULL in the TX
      path, it means mac80211 has passed us an invalid queue,
      although this should be impossible, it shouldn't hurt
      if we send mac80211 a signal to stop the queue either.
      
      Both issues can simply be resolved by removing their
      manual failure handler and making them use the failure path
      provided in rt2x00mac_tx().
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0e3de998
    • I
      rt2x00: Move rt73usb register access wrappers into rt2x00usb · 0f829b1d
      Ivo van Doorn 提交于
      rt2500usb and rt73usb have different register word sizes,
      for that reason the register access wrappers were never
      moved into rt2x00usb.
      With rt2800usb on its way, we should favor the 32bit
      register access and move those wrappers into rt2x00usb.
      That saves duplicate code, since only rt2500usb will
      need the special 16bit wrappers.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0f829b1d
    • I
      rt2x00: Cleanup indirect register access · c9c3b1a5
      Ivo van Doorn 提交于
      All code which accessed indirect registers was similar
      in respect to the for-loop, the given timeout, etc.
      Move it into a seperate function, which for PCI drivers
      can be moved into rt2x00pci.
      
      This allows us to cleanup the cleanup the code further
      by removing the goto statementsand making the codepath
      look a bit nicer.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c9c3b1a5
  2. 22 11月, 2008 7 次提交
    • I
      rt2x00: Fix race condition when using inderect registers · 8ff48a8b
      Ivo van Doorn 提交于
      Indirect registers require multiple calls to the CSR
      register in order to access the indirect registers.
      This must be protected under a lock to prevent race
      conditions which could cause invalid data to
      be returned when reading from the indirect register or silent
      failures when writing data to the indirect register.
      
      USB drivers where already protected under a mutex,
      so rename the mutex and make PCI drivers use the mutex
      as well.
      This now means that BBP and RF registers are no longer
      accessible in interrupt context. That is not a bad
      situation since the slow behavior of accessing
      those registers means we don't _want_ to access them
      in interrupt context either.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8ff48a8b
    • I
      rt2x00: Optimize get_duration / get_duration_res · bad13639
      Ivo van Doorn 提交于
      We can optimize get_duration and get_duration_res
      by making them a macro. They are really simple
      calculation handlers so this doesn't matter much.
      
      Often (especially in rt2400pci and rt2500pci,
      the arguments are hardcoded, and the result value
      is passed into other hardcoded values.
      
      By making the functions a macro GCC can
      optimize the entire thing much better.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bad13639
    • I
      rt2x00: Cleanup TX/RX entry handling · 798b7adb
      Ivo van Doorn 提交于
      Merge the callback functions init_txentry() and
      init_rxentry(). This makes life in rt2x00lib a
      lot simpler and we can cleanup several functions.
      
      rt2x00pci contained "fake" FIELD definitions for
      descriptor words. This is not flexible since it
      assumes the driver will always have the same field
      to indicate if a driver is available or not.
      This should be dependent on the driver, and we
      should add a callback function for this.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      798b7adb
    • I
      rt2x00: Fix BUG_ON() with antenna handling · 6d64360a
      Ivo van Doorn 提交于
      With the new configuration handling, and more specifically
      splitting the configuration of the antenna from the normal
      configuration steps allowed a BUG_ON() to be triggered
      in the driver because the SW_DIVERSITY was send to the
      driver. This fixes that by catching the value early in
      rt2x00config.c and replacing it with a sensible value.
      
      This also fixes a problem where the antenna is not being
      initialized at all when the radio is enabled. Since it
      no longer is part of the mac80211 configuration the
      only place where rt2x00 configured it was the SW diversity
      handler. Obviously this is broken for all non-diversity
      hardware and breaks SW diversity due to a broken initialization.
      
      When the radio is enabled the antenna will be configured
      once as soon as the config() callback function is called.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      6d64360a
    • I
      rt2x00: Block set_key() during suspend/shutdown · 8058409c
      Ivo van Doorn 提交于
      mac80211 will call set_key() when the device is
      shutting down. When the device is unplugged the
      keys will be lost automatically due to the power
      loss. When the device is not plugged but the module
      is only unloaded the keys can remain in the device
      hardware, when the module is loaded the keys will
      be cleaned up during initialization.
      
      This should prevent the problem reported by Johannes Berg,
      where unplugging the device while suspended resulted in
      a NULL pointer error during set_key() which was
      caused because of the CSR base address being freed.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8058409c
    • I
      rt2x00: Fix LED state handling · 9a95dba3
      Ivo van Doorn 提交于
      For every global LED state change (register/unregister,
      suspend/resume) we should force the LEDS to turn off.
      This makes sure that the LEDS will always be in a sane
      state after the state switch.
      
      Note that when unregister is called but the LED class
      wasn't resumed yet, we shouldn't change the LED state
      since we might not have access to the device (device
      was unplugged while suspended).
      
      Also remove the checks in the activity, assoc and
      radio LEDS which blocked calls to brightness_set()
      when the state hasn't changed. Some of those LEDS
      could be enabled by themselves when something happens
      in the hardware (e.g. firmware is loaded). We already
      did called rt2x00leds to switch the LED off, but those
      calls were blocked.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9a95dba3
    • I
      rt2x00: Remove RATE_BASIC flag · 3d8606a6
      Ivo van Doorn 提交于
      mac80211 is in charge of determining the basic rates,
      so we are not using the RATE_BASIC flag anymore.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3d8606a6
  3. 11 11月, 2008 5 次提交
  4. 01 11月, 2008 6 次提交
  5. 31 10月, 2008 1 次提交
  6. 30 10月, 2008 1 次提交
  7. 28 10月, 2008 1 次提交
  8. 15 10月, 2008 1 次提交
  9. 07 10月, 2008 2 次提交
  10. 01 10月, 2008 1 次提交
  11. 25 9月, 2008 1 次提交
  12. 16 9月, 2008 2 次提交
    • J
      mac80211: fix virtual interfaces vs. injection · 25d834e1
      Johannes Berg 提交于
      Currently, virtual interface pointers passed to drivers might be
      from monitor interfaces and as such completely uninitialised
      because we do not tell the driver about monitor interfaces when
      those are created. Instead of passing them, we should therefore
      indicate to the driver that there is no information; do that by
      passing a NULL value and adjust drivers to cope with it.
      
      As a result, some mac80211 API functions also need to cope with
      a NULL vif pointer so drivers can still call them unconditionally.
      
      Also, when injecting frames we really don't want to pass NULL all
      the time, if we know we are the source address of a frame and have
      a local interface for that address, we can to use that interface.
      This also helps with processing the frame correctly for that
      interface which will help the 802.11w implementation. It's not
      entirely correct for VLANs or WDS interfaces because there the MAC
      address isn't unique, but it's already a lot better than what we
      do now.
      
      Finally, when injecting without a matching local interface, don't
      assign sequence numbers at all.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      25d834e1
    • J
      mac80211: use nl80211 interface types · 05c914fe
      Johannes Berg 提交于
      There's really no reason for mac80211 to be using its
      own interface type defines. Use the nl80211 types and
      simplify the configuration code a bit: there's no need
      to translate them any more now.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      05c914fe
  13. 12 9月, 2008 3 次提交
  14. 06 9月, 2008 1 次提交
  15. 03 9月, 2008 1 次提交
  16. 30 8月, 2008 2 次提交