aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-16 07:17:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:15 -0400
commit965bedadc01d34027455d5d5b67063ef0209c955 (patch)
tree012bb04559011498e0bdb5db1ba6ffad0ec8b89a /net/mac80211/iface.c
parentdc7d243d75b906cc964c12caa3b2eebe953a69be (diff)
mac80211: improve powersave implementation
When you have multiple virtual interfaces the current implementation requires setting them up properly from userspace, which is undesirable when we want to default to power save mode. Keep track of powersave requested from userspace per managed mode interface, and only enable powersave globally when exactly one managed mode interface is active and has powersave turned on. Second, only start the dynPS timer when PS is turned on, and properly turn it off when PS is turned off. Third, fix the scan_sdata abuse in the dynps code. Finally, also reorder the code and refactor the code that enables PS or the dynps timer instead of having it copied in two places. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 91e8e1bacaaa..6240f76e2a43 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -317,6 +317,8 @@ static int ieee80211_open(struct net_device *dev)
317 ieee80211_set_wmm_default(sdata); 317 ieee80211_set_wmm_default(sdata);
318 } 318 }
319 319
320 ieee80211_recalc_ps(local);
321
320 /* 322 /*
321 * ieee80211_sta_work is disabled while network interface 323 * ieee80211_sta_work is disabled while network interface
322 * is down. Therefore, some configuration changes may not 324 * is down. Therefore, some configuration changes may not
@@ -572,6 +574,8 @@ static int ieee80211_stop(struct net_device *dev)
572 hw_reconf_flags = 0; 574 hw_reconf_flags = 0;
573 } 575 }
574 576
577 ieee80211_recalc_ps(local);
578
575 /* do after stop to avoid reconfiguring when we stop anyway */ 579 /* do after stop to avoid reconfiguring when we stop anyway */
576 if (hw_reconf_flags) 580 if (hw_reconf_flags)
577 ieee80211_hw_config(local, hw_reconf_flags); 581 ieee80211_hw_config(local, hw_reconf_flags);