diff options
author | Vivek Natarajan <vivek.natraj@gmail.com> | 2008-12-23 21:28:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:48 -0500 |
commit | 869717fbe43eb831cbebd03a9a66a4a4c3b406a9 (patch) | |
tree | 606022280750e9427784a5fcb246ff7ea1e37f24 /net/mac80211 | |
parent | d063ed0f0cd623b45edc6f4781dda6478c56bb4f (diff) |
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.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 3 | ||||
-rw-r--r-- | net/mac80211/wext.c | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b688425d7555..b3c99d3c61ba 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -751,7 +751,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, | |||
751 | bss_info_changed |= BSS_CHANGED_BASIC_RATES; | 751 | bss_info_changed |= BSS_CHANGED_BASIC_RATES; |
752 | ieee80211_bss_info_change_notify(sdata, bss_info_changed); | 752 | ieee80211_bss_info_change_notify(sdata, bss_info_changed); |
753 | 753 | ||
754 | if (local->powersave) { | 754 | if (local->powersave && |
755 | !(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS)) { | ||
755 | if (local->dynamic_ps_timeout > 0) | 756 | if (local->dynamic_ps_timeout > 0) |
756 | mod_timer(&local->dynamic_ps_timer, jiffies + | 757 | mod_timer(&local->dynamic_ps_timer, jiffies + |
757 | msecs_to_jiffies(local->dynamic_ps_timeout)); | 758 | msecs_to_jiffies(local->dynamic_ps_timeout)); |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 011592fd4528..8568f1e7266f 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -865,9 +865,9 @@ set: | |||
865 | local->powersave = ps; | 865 | local->powersave = ps; |
866 | local->dynamic_ps_timeout = timeout; | 866 | local->dynamic_ps_timeout = timeout; |
867 | 867 | ||
868 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { | 868 | if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) && |
869 | if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) && | 869 | (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)) { |
870 | local->dynamic_ps_timeout > 0) | 870 | if (local->dynamic_ps_timeout > 0) |
871 | mod_timer(&local->dynamic_ps_timer, jiffies + | 871 | mod_timer(&local->dynamic_ps_timer, jiffies + |
872 | msecs_to_jiffies(local->dynamic_ps_timeout)); | 872 | msecs_to_jiffies(local->dynamic_ps_timeout)); |
873 | else { | 873 | else { |
@@ -875,8 +875,9 @@ set: | |||
875 | conf->flags |= IEEE80211_CONF_PS; | 875 | conf->flags |= IEEE80211_CONF_PS; |
876 | else | 876 | else |
877 | conf->flags &= ~IEEE80211_CONF_PS; | 877 | conf->flags &= ~IEEE80211_CONF_PS; |
878 | ret = ieee80211_hw_config(local, | ||
879 | IEEE80211_CONF_CHANGE_PS); | ||
878 | } | 880 | } |
879 | ret = ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | ||
880 | } | 881 | } |
881 | 882 | ||
882 | return ret; | 883 | return ret; |