wl12xx: AP mode - clean BA and queue state in tx_reset
authorArik Nemtsov <arik@wizery.com>
Thu, 25 Aug 2011 09:43:17 +0000 (12:43 +0300)
committerLuciano Coelho <coelho@ti.com>
Wed, 14 Sep 2011 10:15:19 +0000 (13:15 +0300)
Reset the BA state of all connected stations and explicitly clear the
Tx queues. The latter is needed for clearing dummy packets from
tx_queue_count.

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

index 1127a3ee36e33d86a671185fd848a5c157e365f5..45cd10ab3aac2de2ea39a2a3441a85a79e0e09e9 100644 (file)
@@ -3757,11 +3757,14 @@ static int wl1271_allocate_sta(struct wl1271 *wl,
        return 0;
 }
 
-static void wl1271_free_sta(struct wl1271 *wl, u8 hlid)
+void wl1271_free_sta(struct wl1271 *wl, u8 hlid)
 {
        int id = hlid - WL1271_AP_STA_HLID_START;
 
-       if (WARN_ON(!test_bit(id, wl->ap_hlid_map)))
+       if (hlid < WL1271_AP_STA_HLID_START)
+               return;
+
+       if (!test_bit(id, wl->ap_hlid_map))
                return;
 
        clear_bit(id, wl->ap_hlid_map);
index 2bf31302b975d53182cc18be788a02008d19b5c1..9d4157ce0950ea0dd964bbb21a8f9c5027f03497 100644 (file)
@@ -891,6 +891,7 @@ void wl1271_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
        /* TX failure */
        if (wl->bss_type == BSS_TYPE_AP_BSS) {
                for (i = 0; i < AP_MAX_LINKS; i++) {
+                       wl1271_free_sta(wl, i);
                        wl1271_tx_reset_link_queues(wl, i);
                        wl->links[i].allocated_pkts = 0;
                        wl->links[i].prev_freed_pkts = 0;
@@ -910,10 +911,14 @@ void wl1271_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
                                        ieee80211_tx_status_ni(wl->hw, skb);
                                }
                        }
-                       wl->tx_queue_count[i] = 0;
                }
+
+               wl->ba_rx_bitmap = 0;
        }
 
+       for (i = 0; i < NUM_TX_QUEUES; i++)
+               wl->tx_queue_count[i] = 0;
+
        wl->stopped_queues_map = 0;
 
        /*
index 5c0fbbe5b42fd558867dd968705b4e3cc0119cf9..d6fdbf904a09304e6fcdf7c5ace5fad6645c1c8c 100644 (file)
@@ -216,4 +216,7 @@ void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid);
 void wl1271_handle_tx_low_watermark(struct wl1271 *wl);
 bool wl12xx_is_dummy_packet(struct wl1271 *wl, struct sk_buff *skb);
 
+/* from main.c */
+void wl1271_free_sta(struct wl1271 *wl, u8 hlid);
+
 #endif