linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: go out of PS before sending disassoc
@ 2012-07-12 14:35 Eliad Peller
  2012-07-17 10:18 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2012-07-12 14:35 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

on disassoc, ieee80211_set_disassoc() goes out of PS
before indicating BSS_CHANGED_ASSOC (not sure why this
is needed, but some drivers might count on the current
behavior).

However, it does it after sending the disassoc
frame, which results in null-data frame being sent
(in order to go out of ps) after we were already sent
the disassoc, which is invalid.

Fix it by going out of ps before sending the disassoc.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 net/mac80211/mlme.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 671b9fd..9c74a1b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1365,6 +1365,17 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 	}
 	mutex_unlock(&local->sta_mtx);
 
+	/*
+	 * if we want to get out of ps before disassoc (why?) we have
+	 * to do it before sending disassoc, as otherwise the null-packet
+	 * won't be valid.
+	 */
+	if (local->hw.conf.flags & IEEE80211_CONF_PS) {
+		local->hw.conf.flags &= ~IEEE80211_CONF_PS;
+		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
+	}
+	local->ps_sdata = NULL;
+
 	/* flush out any pending frame (e.g. DELBA) before deauth/disassoc */
 	if (tx)
 		drv_flush(local, false);
@@ -1400,12 +1411,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 	del_timer_sync(&local->dynamic_ps_timer);
 	cancel_work_sync(&local->dynamic_ps_enable_work);
 
-	if (local->hw.conf.flags & IEEE80211_CONF_PS) {
-		local->hw.conf.flags &= ~IEEE80211_CONF_PS;
-		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
-	}
-	local->ps_sdata = NULL;
-
 	/* Disable ARP filtering */
 	if (sdata->vif.bss_conf.arp_filter_enabled) {
 		sdata->vif.bss_conf.arp_filter_enabled = false;
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: go out of PS before sending disassoc
  2012-07-12 14:35 [PATCH] mac80211: go out of PS before sending disassoc Eliad Peller
@ 2012-07-17 10:18 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-07-17 10:18 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Thu, 2012-07-12 at 17:35 +0300, Eliad Peller wrote:
> on disassoc, ieee80211_set_disassoc() goes out of PS
> before indicating BSS_CHANGED_ASSOC (not sure why this
> is needed, but some drivers might count on the current
> behavior).
> 
> However, it does it after sending the disassoc
> frame, which results in null-data frame being sent
> (in order to go out of ps) after we were already sent
> the disassoc, which is invalid.
> 
> Fix it by going out of ps before sending the disassoc.

Applied, thanks

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-17 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-12 14:35 [PATCH] mac80211: go out of PS before sending disassoc Eliad Peller
2012-07-17 10:18 ` Johannes Berg

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).