aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
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/ieee80211_i.h
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/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 13d6f890ced4..ff40dd7b523a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -295,6 +295,8 @@ struct ieee80211_if_managed {
295 int auth_tries; /* retries for auth req */ 295 int auth_tries; /* retries for auth req */
296 int assoc_tries; /* retries for assoc req */ 296 int assoc_tries; /* retries for assoc req */
297 297
298 bool powersave; /* powersave requested for this iface */
299
298 unsigned long request; 300 unsigned long request;
299 301
300 unsigned long last_probe; 302 unsigned long last_probe;
@@ -739,8 +741,12 @@ struct ieee80211_local {
739 int wifi_wme_noack_test; 741 int wifi_wme_noack_test;
740 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ 742 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
741 743
742 bool powersave;
743 bool pspolling; 744 bool pspolling;
745 /*
746 * PS can only be enabled when we have exactly one managed
747 * interface (and monitors) in PS, this then points there.
748 */
749 struct ieee80211_sub_if_data *ps_sdata;
744 struct work_struct dynamic_ps_enable_work; 750 struct work_struct dynamic_ps_enable_work;
745 struct work_struct dynamic_ps_disable_work; 751 struct work_struct dynamic_ps_disable_work;
746 struct timer_list dynamic_ps_timer; 752 struct timer_list dynamic_ps_timer;
@@ -932,6 +938,7 @@ int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason
932int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason); 938int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason);
933void ieee80211_send_pspoll(struct ieee80211_local *local, 939void ieee80211_send_pspoll(struct ieee80211_local *local,
934 struct ieee80211_sub_if_data *sdata); 940 struct ieee80211_sub_if_data *sdata);
941void ieee80211_recalc_ps(struct ieee80211_local *local);
935 942
936/* IBSS code */ 943/* IBSS code */
937int ieee80211_ibss_commit(struct ieee80211_sub_if_data *sdata); 944int ieee80211_ibss_commit(struct ieee80211_sub_if_data *sdata);