From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seth Forshee Date: Mon, 16 Dec 2013 16:00:57 -0600 Subject: [RFC PATCH 5/8] mac80211: Don't start dynamic PS timer when leaving off-channel if still scanning In-Reply-To: <1387231260-2849-1-git-send-email-seth.forshee@canonical.com> References: <1387231260-2849-1-git-send-email-seth.forshee@canonical.com> Message-ID: <1387231260-2849-6-git-send-email-seth.forshee@canonical.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Johannes Berg Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list@broadcom.com, "John W. Linville" , Stefano Brivio , Arend van Spriel , Seth Forshee 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 --- net/mac80211/offchannel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } -- 1.8.3.2