wl1251: move all transmission to happen in tx_work
authorYuri Ershov <ext-yuri.ershov@nokia.com>
Wed, 27 Oct 2010 13:34:39 +0000 (17:34 +0400)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 31 Oct 2010 20:10:34 +0000 (22:10 +0200)
Currently TX queue is consumed both in wl->tx_work and in wl->irq_work.
This was problematic with the PS-Poll implementation, and caused stalls
because of synchronisation issues between the workqueues. Fix that by
consuming TX queue only in TX work.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
drivers/net/wireless/wl12xx/wl1251_tx.c

index 62918c9..e72c5f7 100644 (file)
@@ -429,7 +429,7 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,
 {
        struct ieee80211_tx_info *info;
        struct sk_buff *skb;
-       int hdrlen, ret;
+       int hdrlen;
        u8 *frame;
 
        skb = wl->tx_frames[result->id];
@@ -480,30 +480,6 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl,
 
 out:
        wl->tx_frames[result->id] = NULL;
-
-       if (wl->tx_queue_stopped) {
-               wl1251_debug(DEBUG_TX, "cb: queue was stopped");
-
-               skb = skb_dequeue(&wl->tx_queue);
-
-               /* The skb can be NULL because tx_work might have been
-                  scheduled before the queue was stopped making the
-                  queue empty */
-
-               if (skb) {
-                       ret = wl1251_tx_frame(wl, skb);
-                       if (ret == -EBUSY) {
-                               /* firmware buffer is still full */
-                               wl1251_debug(DEBUG_TX, "cb: fw buffer "
-                                            "still full");
-                               skb_queue_head(&wl->tx_queue, skb);
-                               return;
-                       } else if (ret < 0) {
-                               dev_kfree_skb(skb);
-                               return;
-                       }
-               }
-       }
 }
 
 /* Called upon reception of a TX complete interrupt */