OSDN Git Service

rt2x00: Cleanup rt2x00usb_watchdog_reset_tx master-2010-08-31
authorIvo van Doorn <ivdoorn@gmail.com>
Mon, 30 Aug 2010 19:15:51 +0000 (21:15 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 31 Aug 2010 18:22:25 +0000 (14:22 -0400)
commitcd35a3912188d006f251fff1028d84e1d1649ca2
treeb7b919047ae7e155c3601bce453cd3a235a7baff
parent652a9dd2a0c07251e328519cc23f1316ab13ed51
rt2x00: Cleanup rt2x00usb_watchdog_reset_tx

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: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00usb.c