Skip to contentSkip to conversation

mac80211: A couple of fixes to dynamic power save.

PATCH New Vivek Natarajan 1 participant 1 message Dec 23, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: A couple of fixes to dynamic power save.

a) hw_config() should not be called from siwpower() for the drivers which do not support dynamic powersave.
b) IEEE80211_HW_NO_STACK_DYNAMIC_PS needs to be verified in set_associated() also before enabling the power save timers.

---
 net/mac80211/mlme.c |    3 ++-
 net/mac80211/wext.c |    9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
net/mac80211/mlme.c +2 -1
index c75d0ea..b23e62b 100644
@@ -746,7 +746,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
 	bss_info_changed |= BSS_CHANGED_BASIC_RATES;
 	ieee80211_bss_info_change_notify(sdata, bss_info_changed);
 
-	if (local->powersave) {
+	if (local->powersave &&
+			!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS)) {
 		if (local->dynamic_ps_timeout > 0)
 			mod_timer(&local->dynamic_ps_timer, jiffies +
 				  msecs_to_jiffies(local->dynamic_ps_timeout));
net/mac80211/wext.c +5 -4
index 7162d58..673c5d7 100644
@@ -865,9 +865,9 @@ set:
 	local->powersave = ps;
 	local->dynamic_ps_timeout = timeout;
 
-	if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
-		if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) &&
-		    local->dynamic_ps_timeout > 0)
+	if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) &&
+			(sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)) {
+		if (local->dynamic_ps_timeout > 0)
 			mod_timer(&local->dynamic_ps_timer, jiffies +
 				  msecs_to_jiffies(local->dynamic_ps_timeout));
 		else {
@@ -875,8 +875,9 @@ set:
 				conf->flags |= IEEE80211_CONF_PS;
 			else
 				conf->flags &= ~IEEE80211_CONF_PS;
+			ret = ieee80211_hw_config(local,
+					IEEE80211_CONF_CHANGE_PS);
 		}
-		ret = ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
 	}
 
 	return ret;
Signature · 1 line
1.6.0.1