rt2x00: rt2800usb: rework txstatus code
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 14 Mar 2012 10:16:19 +0000 (11:16 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 15 Mar 2012 17:40:31 +0000 (13:40 -0400)
commitf421111b5e69020c047eb3ff057e50f446c3c7a2
tree71c24323599231fc53df752966a52d197f1301b7
parented61e2b02027935520d1be884fac0b2ffce8379a
rt2x00: rt2800usb: rework txstatus code

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: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00queue.h
drivers/net/wireless/rt2x00/rt2x00usb.c