Skip to content

Commit

Permalink
mac80211: A couple of fixes to dynamic power save.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vivek Natarajan authored and John W. Linville committed Jan 29, 2009
1 parent d063ed0 commit 869717f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,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));
Expand Down
9 changes: 5 additions & 4 deletions net/mac80211/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,18 +865,19 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
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 {
if (local->powersave)
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;
Expand Down

0 comments on commit 869717f

Please sign in to comment.