Skip to content

Commit

Permalink
mac80211: enable PS by default
Browse files Browse the repository at this point in the history
Enable PS by default (depending on Kconfig) -- rely on drivers
to control the level using pm_qos. Due to the previous patch
we turn off PS when necessary due to latency requirements.

This has a Kconfig symbol so people can, if they really want,
configure the default in their kernels. We may want to keep it
at "default y" only in wireless-testing for a while.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 22, 2009
1 parent d91f36d commit bbbdff9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions net/mac80211/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ config MAC80211
This option enables the hardware independent IEEE 802.11
networking stack.

config MAC80211_DEFAULT_PS
bool "enable powersave by default"
depends on MAC80211
default y
help
This option enables powersave mode by default.

If this causes your applications to misbehave you should fix your
applications instead -- they need to register their network
latency requirement, see Documentation/power/pm_qos_interface.txt.

config MAC80211_DEFAULT_PS_VALUE
int
default 1 if MAC80211_DEFAULT_PS
default 0

menu "Rate control algorithm selection"
depends on MAC80211 != n

Expand Down
8 changes: 8 additions & 0 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,7 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_managed *ifmgd;
u32 hw_flags;

ifmgd = &sdata->u.mgd;
INIT_WORK(&ifmgd->work, ieee80211_sta_work);
Expand All @@ -2211,6 +2212,13 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
IEEE80211_STA_AUTO_CHANNEL_SEL;
if (sdata->local->hw.queues >= 4)
ifmgd->flags |= IEEE80211_STA_WMM_ENABLED;

hw_flags = sdata->local->hw.flags;

if (hw_flags & IEEE80211_HW_SUPPORTS_PS) {
ifmgd->powersave = CONFIG_MAC80211_DEFAULT_PS_VALUE;
sdata->local->hw.conf.dynamic_ps_timeout = 500;
}
}

/* configuration hooks */
Expand Down

0 comments on commit bbbdff9

Please sign in to comment.