1. 23 6月, 2011 1 次提交
    • S
      rt2x00: reset usb devices at probe · bf4c02d5
      Stanislaw Gruszka 提交于
      When module is reloaded, device may fail to work, with messages:
      
      [  342.211926] phy40 -> rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x0059, type=2.
      [  342.314254] phy40 -> rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x004a, type=2.
      [  342.416458] phy40 -> rt2x00lib_rxdone: Warning - Wrong frame size 3183 max 2432.
      [  342.518605] phy40 -> rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x00c9, type=2.
      [  342.620836] phy40 -> rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x00ae, type=1.
      [  342.723201] phy40 -> rt2x00lib_rxdone: Warning - Wrong frame size 0 max 2432.
      [  342.825399] phy40 -> rt2x00lib_rxdone: Warning - Wrong frame size 0 max 2432.
      [  342.927624] phy40 -> rt2x00lib_rxdone: Warning - Wrong frame size 0 max 2432.
      [  343.029804] phy40 -> rt2x00lib_rxdone: Warning - Wrong frame size 2491 max 2432.
      [  343.132008] phy40 -> rt2x00lib_rxdone: Warning - Wrong frame size 2576 max 2432.
      [  343.234326] phy40 -> rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x004c, type=1.
      [  343.438723] phy40 -> rt2x00lib_rxdone_read_signal: Warning - Frame received with unrecognized signal, mode=0x0000, signal=0x00e6, type=1.
      
      Whereas replugging device make it functional. To solve that problem
      force reset device during probe.
      
      With patch messages are gone. Unfortunately device may sometimes
      still does not operate correctly after module reload (fail to receive
      data after associate), but such cases are rarer than without the patch.
      Signed-off-by: NStanislaw Gruszka <stf_xl@wp.pl>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bf4c02d5
  2. 06 5月, 2011 1 次提交
  3. 03 5月, 2011 1 次提交
  4. 20 4月, 2011 7 次提交
    • G
      rt2x00: Allow dynamic addition of PCI/USB IDs. · e01ae27f
      Gertjan van Wingerde 提交于
      Both USB and PCI drivers allow a system administrator to dynamically add
      USB/PCI IDs to the device table that a driver supports via the
      /sys/bus/{usb,pci,pci_express}/drivers/<driver-name>/new_id files.
      
      However, for the rt2x00 drivers using this method currently crashes the
      system with a NULL pointer failure.
      
      This is due to the set-up of rt2x00 where the probe functions require a
      rt2x00_ops structure in the driver_info field of the probed device. As
      this field is empty for the dynamically added devices this fails for
      these devices.
      
      Fix this by introducing driver-specific probe wrappers that do nothing
      but calling the bus-specific probe functions with the rt2x00_ops structure
      as an argument, rather than depending on the driver_info field.
      Signed-off-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e01ae27f
    • I
      rt2x00: Decrease association time for USB devices · 152a5992
      Ivo van Doorn 提交于
      When powersaving is enabled, assocaition times are very high
      (for WPA2 networks, the time can easily be around the 3 seconds).
      
      This is caused, because the flushing of the queues takes
      too much time. Without the flushing callback mac80211 assumes
      a timeout of 100ms while scanning. Limit all flush waiting
      loops to the same maximum.
      
      We can apply this maximum by passing the drop status to the
      driver, which makes sure the driver performs extra actions
      during the waiting for the queue to become empty.
      
      After these changes, association times fall within the
      healthy range of ~0.6 seconds with powersaving enabled.
      The difference between association time between powersaving
      enabled and disabled is now only ~0.1 second (which can also
      be due to the measuring method).
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      152a5992
    • J
      rt2800usb: add timer to handle TX_STA_FIFO · f0187a19
      Johannes Stezenbach 提交于
      TX status is reported by the hardware when a packet has been
      sent (or after TX failed after possible retries), which is some
      time after the DMA completion.  Since the rt2800usb hardware can
      not signal interrupts we have to use a timer, otherwise the
      TX status would only be read by the next packet's TX DMA
      completion, or by the watchdog thread.
      Signed-off-by: NJohannes Stezenbach <js@sig21.net>
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f0187a19
    • J
      rt2x00: fix queue timeout checks · 75256f03
      Johannes Stezenbach 提交于
      Add a timestamp to each queue entry which is updated whenever
      the status of the entry changes, and remove the per-queue
      timestamps.  The previous check was incorrect and caused both
      false positives and false negatives.
      
      With the corrected check it comes apparent that the TX status
      usually times out on rt2800usb unless there is sufficient traffic
      (i.e. the next TX will complete the previous TX status).
      Signed-off-by: NJohannes Stezenbach <js@sig21.net>
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      75256f03
    • J
      rt2800usb: read TX_STA_FIFO asynchronously · 0e0d39e5
      Johannes Stezenbach 提交于
      Trying to fix the "TX status report missed" warnings
      by reading the TX_STA_FIFO entries as quickly as possible.
      The TX_STA_FIFO is too small in hardware, thus reading
      it only from the workqueue is too slow and entries get lost.
      
      Start an asynchronous read of the TX_STA_FIFO directly from
      the TX URB completion callback (atomic context, thus it cannot
      use the blocking rt2800_register_read()). If the async
      read returns a valid FIFO entry, it is pushed into a larger
      FIFO inside struct rt2x00_dev, until rt2800_txdone() picks
      it up.
      
      A .tx_dma_done callback is added to struct rt2x00lib_ops
      to trigger the async read from the URB completion callback.
      Signed-off-by: NJohannes Stezenbach <js@sig21.net>
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0e0d39e5
    • H
      rt2x00: Make rt2x00_queue_entry_for_each more flexible · 10e11568
      Helmut Schaa 提交于
      Allow passing a void pointer to rt2x00_queue_entry_for_each which in
      turn in provided to the callback function.
      
      Furthermore, allow the callback function to stop processing by returning
      true. And also notify the caller of rt2x00_queue_entry_for_each if the
      loop was canceled by the callback.
      
      No functional changes, just preparation for an upcoming patch.
      Signed-off-by: NHelmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      10e11568
    • I
      rt2x00: Split rt2x00dev->flags · 7dab73b3
      Ivo van Doorn 提交于
      The number of flags defined for the rt2x00dev->flags field,
      has been growing over the years. Currently we are approaching
      the maximum number of bits which are available in the field.
      
      A secondary problem, is that one part of the field are initialized only
      during boot, because the driver requirements are initialized or device
      requirements are loaded from the EEPROM. In both cases, the flags are
      fixed and will not change during device operation. The other flags are
      the device state, and will change frequently. So far this resulted in the fact
      that for some flags, the atomic bit accessors are used, while for the others
      the non-atomic variants are used.
      
      By splitting the flags up into a "flags" and "cap_flags" we can put all flags
      which are fixed inside "cap_flags". This field can then be read non-atomically.
      In the "flags" field we keep the device state, which is going to be read atomically.
      
      This adds more room for more flags in the future, and sanitizes the field access methods.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Acked-by: NHelmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7dab73b3
  5. 31 3月, 2011 1 次提交
  6. 01 2月, 2011 1 次提交
  7. 14 12月, 2010 9 次提交
  8. 16 11月, 2010 3 次提交
  9. 12 10月, 2010 4 次提交
  10. 01 9月, 2010 2 次提交
    • I
      rt2x00: Cleanup rt2x00usb_watchdog_reset_tx · cd35a391
      Ivo van Doorn 提交于
      rt2x00usb_watchdog_reset_tx performs the same task
      as rt2x00usb_kill_tx_queue, with the only difference
      is that it waits for all entries to be returned to
      the driver and for all frames the status has been
      reported to mac80211.
      
      We can easily split this task by calling rt2x00usb_kill_tx_queue,
      sleep for a short period and invoke the TX status reporting
      function. By adding the sleep() to the kill_entry we make sure
      that even during shutdown we guarentee the entry has been killed when
      the function returns. To make this work correctly the interrupt
      handlers have to be updated to prevent checking for the RADIO_ENABLED
      flag too early which prevents the ownership of the entry to be reset.
      Additionally a check for the DEVICE_PRESENT flag is not required but
      is nice to prevent race conditions when the device was unplugged.
      
      Additionally rather then calling rt2x00usb_work_txdone() for
      status reporting we let the driver perform the TX status reporting
      first. If this is not sufficient then rt2x00usb_work_txdone() will
      still be used to cleanup the mess.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cd35a391
    • I
      rt2x00: Split watchdog check into a DMA and STATUS timeout · 652a9dd2
      Ivo van Doorn 提交于
      The watchdog for rt2800usb triggers frequently causing all URB's
      to be canceled often enough to interrupt the normal TX flow.
      More research indicated that not the URB upload to the USB host
      were hanging, but instead the TX status reports.
      
      To correctly detect what is going on, we introduce Q_INDEX_DMA_DONE
      which is an index counter between Q_INDEX_DONE and Q_INDEX and indicates
      if the frame has been transfered to the device.
      
      This also requires the rt2x00queue timeout functions to be updated
      to differentiate between a DMA timeout (time between Q_INDEX and
      Q_INDEX_DMA_DONE timeout) and a STATUS timeout (time between
      Q_INDEX_DMA_DONE and Q_INDEX_DONE timeout)
      
      All Q_INDEX_DMA_DONE code was taken from the RFC from
      Helmut Schaa <helmut.schaa@googlemail.com> for the implementation
      for watchdog for rt2800pci.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      652a9dd2
  11. 26 8月, 2010 3 次提交
  12. 17 8月, 2010 2 次提交
  13. 13 7月, 2010 1 次提交
    • I
      rt2x00: Implement watchdog monitoring · c965c74b
      Ivo van Doorn 提交于
      Implement watchdog monitoring for USB devices (PCI support can
      be added later). This will determine if URBs being uploaded to
      the hardware are actually returning. Both rt2500usb and rt2800usb
      have shown that URBs being uploaded can remain hanging without
      being released by the hardware.
      By using this watchdog, a queue can be reset when this occurs.
      For rt2800usb it has been tested that the connection is preserved
      even though this interruption.
      Signed-off-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c965c74b
  14. 01 7月, 2010 4 次提交