1. 30 1月, 2009 10 次提交
  2. 23 1月, 2009 1 次提交
  3. 17 1月, 2009 1 次提交
    • R
      rt2x00: fix a wrong parameter for __test_and_clear_bit() in rt2x00rfkill_free(). · e223b6dc
      Rami Rosen 提交于
      When running modprobe rt73usb, and then rmmod rt73usb, and then
      iwconfig, the wlan0 device does not disappear. When repeating this
      process again, we get a kernel Oops errors and "BUG: unable to handle
      kernel paging request..." message in the kernel log.
      
      The reason for this is that there is an error in rt2x00rfkill_free(),
      which is called in the process of removing the device
      (rt2x00lib_remove_dev() in rt2x00dev.c).
      rt2x00rfkill_free() clears the RFKILL_STATE_ALLOCATED bit , which is
      bit number 1 () in rt2x00dev->flags instead of in
      rt2x00dev->rfkill_state. As a result, when checking the
      DEVICE_STATE_REGISTERED_HW bit (bit number 1 in rt2x00dev->flags) in
      rt2x00lib_remove_hw() it is **unset**, and we wrongly **don't** call
      ieee80211_unregister_hw().
      
      This patch corrects this: the parameter for __test_and_clear_bit() in
      rt2x00rfkill_free() should be &rt2x00dev->rfkill_state and not
      &rt2x00dev->flags.
      Signed-off-by: NRami Rosen <ramirose@gmail.com>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e223b6dc
  4. 13 1月, 2009 6 次提交
  5. 06 1月, 2009 1 次提交
  6. 05 12月, 2008 9 次提交
  7. 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
  8. 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