From: Seth Forshee <seth.forshee@canonical.com>
To: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org
Cc: Stanislaw Gruszka <sgruszka@redhat.com>,
Seth Forshee <seth.forshee@canonical.com>
Subject: [PATCH 4/4] mac80211: Add flushes before going off-channel
Date: Wed, 6 Feb 2013 09:01:13 -0600 [thread overview]
Message-ID: <1360162873-17240-5-git-send-email-seth.forshee@canonical.com> (raw)
In-Reply-To: <1360162873-17240-1-git-send-email-seth.forshee@canonical.com>
We've got a couple of races when enabling powersave with an AP for
off-channel operation. The first is fairly simple. If we go off-channel
before the nullfunc frame to enable PS is transmitted then it may not be
received by the AP. Add a flush after enabling off-channel PS to prevent
this from happening.
The second race is a bit more subtle. If the driver supports QoS and has
frames queued when the nullfunc frame is queued, those frames may get
transmitted after the nullfunc frame. If PM is not set then the AP is
being told that we've exited PS before we go off-channel and may try to
deliver frames. To prevent this, add a flush after stopping the queues
but before passing the nullfunc frame to the driver.
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
net/mac80211/offchannel.c | 5 +++++
net/mac80211/scan.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 650af94..28274f9 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -118,8 +118,13 @@ bool ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
* STA interfaces.
*/
+ /*
+ * Stop queues and transmit all frames queued by the driver
+ * before sending nullfunc to enable powersave at the AP.
+ */
ieee80211_stop_queues_by_reason(&local->hw,
IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL);
+ drv_flush(local, false);
mutex_lock(&local->iflist_mtx);
list_for_each_entry(sdata, &local->interfaces, list) {
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index beca4db..9ecd1660 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -343,6 +343,9 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
if (!ieee80211_offchannel_stop_vifs(local))
goto error;
+ /* ensure nullfunc is transmitted before leaving operating channel */
+ drv_flush(local, false);
+
ieee80211_configure_filter(local);
/* We need to set power level at maximum rate for scanning. */
--
1.7.9.5
prev parent reply other threads:[~2013-02-06 15:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 15:01 [PATCH 0/4] Improve queue handling for off-channel operation Seth Forshee
2013-02-06 15:01 ` [PATCH 1/4] mac80211: Return a status for tx operations Seth Forshee
2013-02-06 15:01 ` [PATCH 2/4] mac80211: Fix tx queue handling during scans Seth Forshee
2013-02-06 15:01 ` [PATCH 3/4] mac80211: Improve error handling for off-channel operation Seth Forshee
2013-02-06 21:44 ` Johannes Berg
2013-02-06 22:05 ` Seth Forshee
2013-02-06 22:10 ` Johannes Berg
2013-02-06 22:20 ` Seth Forshee
2013-02-06 22:26 ` Johannes Berg
2013-02-06 22:30 ` Johannes Berg
2013-02-07 17:54 ` [PATCH v3 1/2] mac80211: Fix tx queue handling during scans Seth Forshee
2013-02-07 17:54 ` [PATCH v3 2/2] mac80211: Add flushes before going off-channel Seth Forshee
2013-02-08 9:03 ` [PATCH v3 1/2] mac80211: Fix tx queue handling during scans Johannes Berg
2013-02-08 17:11 ` Seth Forshee
2013-02-08 17:17 ` Johannes Berg
2013-02-08 18:10 ` Seth Forshee
2013-02-08 19:05 ` Johannes Berg
2013-02-08 20:46 ` Seth Forshee
2013-02-08 20:53 ` Johannes Berg
2013-02-11 17:18 ` Seth Forshee
2013-02-11 17:21 ` [PATCH v4 " Seth Forshee
2013-02-11 17:21 ` [PATCH v4 2/2] mac80211: Add flushes before going off-channel Seth Forshee
2013-02-11 21:40 ` [PATCH v4 1/2] mac80211: Fix tx queue handling during scans Johannes Berg
2013-02-11 21:50 ` Seth Forshee
2013-02-06 15:01 ` Seth Forshee [this message]
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=1360162873-17240-5-git-send-email-seth.forshee@canonical.com \
--to=seth.forshee@canonical.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=sgruszka@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).