diff mbox

[RFC,5/8] mac80211: Don't start dynamic PS timer when leaving off-channel if still scanning

Message ID 1387231260-2849-6-git-send-email-seth.forshee@canonical.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Seth Forshee Dec. 16, 2013, 10 p.m. UTC
Most of mac80211 does not update the dynamic PS timer during
scans, but ieee80211_offchannel_ps_disable() will still restart
it if a scan is in progress. It doesn't make sense to do this if
no other code is updating the timer, so update this function to
only restart the timer if not scanning.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 net/mac80211/offchannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 5802c00..1744886 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -72,7 +72,7 @@  static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
 	ieee80211_vif_set_ps_mode(sdata, mode);
 	if (mode == IEEE80211_VIF_PS_AWAKE) {
 		ieee80211_send_nullfunc(local, sdata, 0);
-		if (sdata->vif.dynamic_ps_active)
+		if (sdata->vif.dynamic_ps_active && !local->scanning)
 			mod_timer(&ifmgd->dynamic_ps_timer, jiffies +
 				  msecs_to_jiffies(sdata->vif.dynamic_ps_timeout));
 	}