wl12xx: flush all Tx queues on tx_flush timeout
authorArik Nemtsov <arik@wizery.com>
Mon, 27 Feb 2012 22:41:32 +0000 (00:41 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 28 Feb 2012 11:25:09 +0000 (13:25 +0200)
Ensure our queues are empty at the end of a tx_flush(), in case we
timeout on passively waiting for them. This makes sure no left-overs are
transmitted when we are on the wrong channel.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/tx.c

index 6640c3975cfbeab210f726e69c3c2393d7c62eb8..8f78fddcb7230920cf78598f4fce23a7b6fde5f9 100644 (file)
@@ -1040,6 +1040,7 @@ void wl12xx_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
 void wl1271_tx_flush(struct wl1271 *wl)
 {
        unsigned long timeout;
+       int i;
        timeout = jiffies + usecs_to_jiffies(WL1271_TX_FLUSH_TIMEOUT);
 
        while (!time_after(jiffies, timeout)) {
@@ -1057,6 +1058,12 @@ void wl1271_tx_flush(struct wl1271 *wl)
        }
 
        wl1271_warning("Unable to flush all TX buffers, timed out.");
+
+       /* forcibly flush all Tx buffers on our queues */
+       mutex_lock(&wl->mutex);
+       for (i = 0; i < WL12XX_MAX_LINKS; i++)
+               wl1271_tx_reset_link_queues(wl, i);
+       mutex_unlock(&wl->mutex);
 }
 
 u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set)
This page took 0.030391 seconds and 5 git commands to generate.