1. 11 10月, 2013 1 次提交
    • S
      rt2x00: do not pause queue on flush · fdbdd25c
      Stanislaw Gruszka 提交于
      Pausing queue on flush make no sense since txdone procedure un-pause
      queue. Before flush procedure we have to assure queue is stopped,
      i.e. on receive path h/w RX is disabled, on transmit path queue is
      disabled in mac80211. That conditions are true except one function:
      rt2x00usb_watchdog_tx_dma(), so add stop/start queue there.
      
      Note stop/start queue can be racy if we do this from multiple paths,
      but currently we stop TX queues only on rt2x00lib_disable_radio(),
      which also stop/sync watchdog, hance we have no race condition.
      Signed-off-by: NStanislaw Gruszka <stf_xl@wp.pl>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fdbdd25c
  2. 23 4月, 2013 1 次提交
    • J
      rt2x00: Use more current logging styles, shrink object size · ec9c4989
      Joe Perches 提交于
      Reduce object space ~2% using more current logging styles.
      
      Neaten and simplify logging macros.
      Use wiphy_<level> where appropriate.
      Coalesce formats.
      
      Convert ERROR/WARNING/INFO macros to rt2x00_<level>
      Convert EEPROM to rt2x00_eeprom_dbg
      Convert PROBE_ERROR to rt2x00_probe_err
      Convert DEBUG to rt2x00_dbg
      Convert EEPROM to rt2x00_eeprom_dbg
      
      $ size drivers/net/wireless/rt2x00/built-in.o*
         text	   data	    bss	    dec	    hex	filename
       245639	  71696	  69584	 386919	  5e767	drivers/net/wireless/rt2x00/built-in.o.new
       240609	  70096	  68944	 379649	  5cb01	drivers/net/wireless/rt2x00/built-in.o.new.nodyndbg
       240609	  70096	  68944	 379649	  5cb01	drivers/net/wireless/rt2x00/built-in.o.new.no_rt2x00_debug
       249198	  70096	  70352	 389646	  5f20e	drivers/net/wireless/rt2x00/built-in.o.old
       249198	  70096	  70352	 389646	  5f20e	drivers/net/wireless/rt2x00/built-in.o.old.nodyndbg
       244222	  70096	  69712	 384030	  5dc1e	drivers/net/wireless/rt2x00/built-in.o.old.no_rt2x00_debug
      Signed-off-by: NJoe Perches <joe@perches.com>
      Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ec9c4989
  3. 19 3月, 2013 1 次提交
  4. 12 7月, 2012 1 次提交
  5. 10 7月, 2012 1 次提交
  6. 24 4月, 2012 1 次提交
  7. 16 3月, 2012 1 次提交
    • S
      rt2x00: rt2800usb: rework txstatus code · f421111b
      Stanislaw Gruszka 提交于
      Currently we read tx status register after each urb data transfer. As
      callback procedure also trigger reading, that causing we have many
      "threads" of reading status. To prevent that introduce TX_STATUS_READING
      flags, and check if we are already in process of sequential reading
      TX_STA_FIFO, before requesting new reads.
      
      Change timer to hrtimer, that make TX_STA_FIFO overruns less possible.
      Use 200 us for initial timeout, and then reschedule in 100 us period,
      this values probably have to be tuned.
      
      Make changes on txdone work. Schedule it from
      rt2800usb_tx_sta_fifo_read_completed() callback when first valid status
      show up. Check in callback if tx status timeout happens, and schedule
      work on that condition too. That make possible to remove tx status
      timeout from generic watchdog. I moved that to rt2800usb.
      
      Loop in txdone work, that should prevent situation when we queue work,
      which is already processed, and after finish work is not rescheduled
      again.
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f421111b
  8. 05 1月, 2012 1 次提交
  9. 23 8月, 2011 1 次提交
    • S
      rt2x00: do not drop usb dev reference counter on suspend · 543cc38c
      Stanislaw Gruszka 提交于
      When hibernating ->resume may not be called by usb core, but disconnect
      and probe instead, so we do not increase the counter after decreasing
      it in ->supend. As a result we free memory early, and get crash when
      unplugging usb dongle.
      
      BUG: unable to handle kernel paging request at 6b6b6b9f
      IP: [<c06909b0>] driver_sysfs_remove+0x10/0x30
      *pdpt = 0000000034f21001 *pde = 0000000000000000
      Pid: 20, comm: khubd Not tainted 3.1.0-rc1-wl+ #20 LENOVO 6369CTO/6369CTO
      EIP: 0060:[<c06909b0>] EFLAGS: 00010202 CPU: 1
      EIP is at driver_sysfs_remove+0x10/0x30
      EAX: 6b6b6b6b EBX: f52bba34 ECX: 00000000 EDX: 6b6b6b6b
      ESI: 6b6b6b6b EDI: c0a0ea20 EBP: f61c9e68 ESP: f61c9e64
       DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      Process khubd (pid: 20, ti=f61c8000 task=f6138270 task.ti=f61c8000)
      Call Trace:
       [<c06909ef>] __device_release_driver+0x1f/0xa0
       [<c0690b20>] device_release_driver+0x20/0x40
       [<c068fd64>] bus_remove_device+0x84/0xe0
       [<c068e12a>] ? device_remove_attrs+0x2a/0x80
       [<c068e267>] device_del+0xe7/0x170
       [<c06d93d4>] usb_disconnect+0xd4/0x180
       [<c06d9d61>] hub_thread+0x691/0x1600
       [<c0473260>] ? wake_up_bit+0x30/0x30
       [<c0442a39>] ? complete+0x49/0x60
       [<c06d96d0>] ? hub_disconnect+0xd0/0xd0
       [<c06d96d0>] ? hub_disconnect+0xd0/0xd0
       [<c0472eb4>] kthread+0x74/0x80
       [<c0472e40>] ? kthread_worker_fn+0x150/0x150
       [<c0809b3e>] kernel_thread_helper+0x6/0x10
      
      Cc: stable@kernel.org
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      543cc38c
  10. 12 8月, 2011 1 次提交
  11. 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
  12. 06 5月, 2011 1 次提交
  13. 03 5月, 2011 1 次提交
  14. 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
  15. 31 3月, 2011 1 次提交
  16. 01 2月, 2011 1 次提交
  17. 14 12月, 2010 9 次提交
  18. 16 11月, 2010 3 次提交
  19. 12 10月, 2010 4 次提交
  20. 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