wl1251: fix queue stopping/waking for TX path
authorDavid Gnedt <david.gnedt@davizone.at>
Sun, 30 Jan 2011 19:10:46 +0000 (20:10 +0100)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 4 Mar 2011 17:30:55 +0000 (19:30 +0200)
commit1d16503336406c58833a3168f9a2eff2899a44e9
tree4eacf006dd85b27974d84212dba2fc1a3950e05b
parentfe7649c6c32a4e5489c78badb10c9d23ea4098ae
wl1251: fix queue stopping/waking for TX path

The queue stopping/waking functionality was broken in a way that could
cause the TX to stall if the right circumstances are met.

The problem was caused by tx_work, which is scheduled on each TX operation.
If the firmware buffer is full, tx_work does nothing. In combinition with
stopped queues or non-continues transfers, tx_work is never scheduled again.
Moreover the low watermark introduced by
9df86e2e702c6d5547aced7f241addd2d698bb11 never takes effect because of some
old code.

Solve this by scheduling tx_work every time tx_queue is non-empty and
firmware buffer is freed on tx_complete.

This also solves a possible but unlikely case: If less frames than the high
watermark are queued, but more than firmware buffer can hold. This results
in queues staying awake but the only scheduled tx_work doesn't transfer all
frames, so the remaining frames are stuck in the queue until more frames
get queued and tx_work is scheduled again.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1251_tx.c