aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-16 07:27:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:16 -0400
commitbbbdff9e00449928f228867076a07bdfecd3dca8 (patch)
tree466fdd25ed76362a44482465ccdfc2c8de4ceb97 /net/mac80211
parentd91f36db51661018f6d54ff5966e283bcec4c545 (diff)
mac80211: enable PS by default
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>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/Kconfig16
-rw-r--r--net/mac80211/mlme.c8
2 files changed, 24 insertions, 0 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index ecc3faf9f11a..9cbf545e95a2 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -11,6 +11,22 @@ config MAC80211
11 This option enables the hardware independent IEEE 802.11 11 This option enables the hardware independent IEEE 802.11
12 networking stack. 12 networking stack.
13 13
14config MAC80211_DEFAULT_PS
15 bool "enable powersave by default"
16 depends on MAC80211
17 default y
18 help
19 This option enables powersave mode by default.
20
21 If this causes your applications to misbehave you should fix your
22 applications instead -- they need to register their network
23 latency requirement, see Documentation/power/pm_qos_interface.txt.
24
25config MAC80211_DEFAULT_PS_VALUE
26 int
27 default 1 if MAC80211_DEFAULT_PS
28 default 0
29
14menu "Rate control algorithm selection" 30menu "Rate control algorithm selection"
15 depends on MAC80211 != n 31 depends on MAC80211 != n
16 32
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 7a8d4c494246..a16c9d724be1 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2192,6 +2192,7 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
2192void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) 2192void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
2193{ 2193{
2194 struct ieee80211_if_managed *ifmgd; 2194 struct ieee80211_if_managed *ifmgd;
2195 u32 hw_flags;
2195 2196
2196 ifmgd = &sdata->u.mgd; 2197 ifmgd = &sdata->u.mgd;
2197 INIT_WORK(&ifmgd->work, ieee80211_sta_work); 2198 INIT_WORK(&ifmgd->work, ieee80211_sta_work);
@@ -2211,6 +2212,13 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
2211 IEEE80211_STA_AUTO_CHANNEL_SEL; 2212 IEEE80211_STA_AUTO_CHANNEL_SEL;
2212 if (sdata->local->hw.queues >= 4) 2213 if (sdata->local->hw.queues >= 4)
2213 ifmgd->flags |= IEEE80211_STA_WMM_ENABLED; 2214 ifmgd->flags |= IEEE80211_STA_WMM_ENABLED;
2215
2216 hw_flags = sdata->local->hw.flags;
2217
2218 if (hw_flags & IEEE80211_HW_SUPPORTS_PS) {
2219 ifmgd->powersave = CONFIG_MAC80211_DEFAULT_PS_VALUE;
2220 sdata->local->hw.conf.dynamic_ps_timeout = 500;
2221 }
2214} 2222}
2215 2223
2216/* configuration hooks */ 2224/* configuration hooks */