diff mbox

[1/2] ath9k: Drain txq before sending a nullfunc frame.

Message ID 1296800640-6381-1-git-send-email-vnatarajan@atheros.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Vivek Natarajan Feb. 4, 2011, 6:23 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 68a1c76..0cb6017 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1710,7 +1710,6 @@  static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw,
 			    bf->bf_buf_addr,
 			    txq->axq_qnum);
 
-
 	return bf;
 }
 
@@ -1813,6 +1812,15 @@  int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
 	if (unlikely(!bf))
 		return -ENOMEM;
 
+	if (ieee80211_is_nullfunc(hdr->frame_control) &&
+	    ieee80211_has_pm(hdr->frame_control)) {
+		/* Drain all the pending frames before we send a nullfunc frame
+		 * to avoid any power save state mismatch between the station
+		 * and the AP.
+		 */
+		ath_drain_all_txq(sc, false);
+	}
+
 	q = skb_get_queue_mapping(skb);
 	spin_lock_bh(&txq->axq_lock);
 	if (txq == sc->tx.txq_map[q] &&