All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Natarajan <vnatarajan@atheros.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 1/2] ath9k: Drain txq before sending a nullfunc frame.
Date: Fri, 4 Feb 2011 11:53:59 +0530	[thread overview]
Message-ID: <1296800640-6381-1-git-send-email-vnatarajan@atheros.com> (raw)

In a highly noisy environment, a data frame which is queued before
a nullfunc frame on a different hw queue may be sent over the air
after the tx completion of nullfunc frame. This causes the station
to enter power save and the AP to see the station as awake and
continues to send the data traffic. Fix this by draining all tx
queues before we send the null function frame with PM bit set.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

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] &&
-- 
1.6.3.3


             reply	other threads:[~2011-02-04  6:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04  6:23 Vivek Natarajan [this message]
2011-02-04  6:24 ` [PATCH 2/2] mac80211: Fix a race on enabling power save Vivek Natarajan
2011-02-04  7:37   ` Luis R. Rodriguez
2011-02-04  9:26     ` Vivek Natarajan
2011-02-04 10:31   ` Johannes Berg
2011-02-04  7:36 ` [PATCH 1/2] ath9k: Drain txq before sending a nullfunc frame Luis R. Rodriguez
2011-02-04  7:36   ` Luis R. Rodriguez
2011-02-04 14:21     ` John W. Linville
2011-02-04 14:57       ` Greg KH
2011-02-04  8:28 ` Sujith
2011-02-04  9:17   ` Vivek Natarajan
2011-02-04 10:23     ` Sujith
2011-02-04 10:47       ` Vivek Natarajan
2011-02-04 11:07         ` Sujith
2011-02-09 19:06     ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296800640-6381-1-git-send-email-vnatarajan@atheros.com \
    --to=vnatarajan@atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.