public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix PS vs. scan race
@ 2009-04-22 21:02 Johannes Berg
  2009-04-23  7:57 ` Kalle Valo
  2009-04-30 21:27 ` Johannes Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Berg @ 2009-04-22 21:02 UTC (permalink / raw)
  To: John Linville; +Cc: Kalle Valo, linux-wireless

When somebody changes the PS parameters while scanning
is in progress, we enable PS -- during the scan. This
is clearly not desirable, and we can just abort enabling
PS when scanning since when the scan finishes it will
be taken care of.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- wireless-testing.orig/net/mac80211/mlme.c	2009-04-22 22:57:45.000000000 +0200
+++ wireless-testing/net/mac80211/mlme.c	2009-04-22 22:58:56.000000000 +0200
@@ -487,6 +487,13 @@ static void ieee80211_enable_ps(struct i
 {
 	struct ieee80211_conf *conf = &local->hw.conf;
 
+	/*
+	 * If we are scanning right now then the parameters will
+	 * take effect when scan finishes.
+	 */
+	if (local->hw_scanning || local->sw_scanning)
+		return;
+
 	if (conf->dynamic_ps_timeout > 0 &&
 	    !(local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)) {
 		mod_timer(&local->dynamic_ps_timer, jiffies +



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

end of thread, other threads:[~2009-04-30 23:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-22 21:02 [PATCH] mac80211: fix PS vs. scan race Johannes Berg
2009-04-23  7:57 ` Kalle Valo
2009-04-30 21:27 ` Johannes Berg
2009-04-30 22:30   ` John W. Linville
2009-04-30 22:59     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox