zd1211rw: fix ack_pending in filter_ack causing tx-packet ordering problem on monitor
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Mon, 31 Jan 2011 18:48:16 +0000 (20:48 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Feb 2011 21:29:49 +0000 (16:29 -0500)
For reasons not very clear yet to me, filter_ack leaves matching tx-packet
pending with 'ack_pending'. This causes tx-packet to be passed back to upper
layer after next packet has been transfered and tx-packets might end up
coming come out of monitor interface in wrong order vs. rx.

Because of this when enable AP-mode, hostapd monitor interface would get
packets in wrong order causing problems in WPA association.

So don't use mac->ack_pending when in AP-mode.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_mac.c

index ab0d1b9a08ec67094a2da1bb58d5a77758c446e9..84ac95eb59fafc2d961fa4a845e9c7c66e2553cc 100644 (file)
@@ -799,6 +799,13 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
 
                mac->ack_pending = 1;
                mac->ack_signal = stats->signal;
+
+               /* Prevent pending tx-packet on AP-mode */
+               if (mac->type == NL80211_IFTYPE_AP) {
+                       skb = __skb_dequeue(q);
+                       zd_mac_tx_status(hw, skb, mac->ack_signal, NULL);
+                       mac->ack_pending = 0;
+               }
        }
 
        spin_unlock_irqrestore(&q->lock, flags);