aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-07-27 05:33:22 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-31 10:11:04 -0400
commitab09587740fddf6b4116be7b6716ab47f34d2634 (patch)
tree18c304410c82725356a3a8d6076b2f9af173b21a /net/mac80211/mlme.c
parent2b2b64380785bdcaaa9a123e7e5829acc749c4ca (diff)
mac80211: add PS flag to bss_conf
Currently, ps mode is indicated per device (rather than per interface), which doesn't make a lot of sense. Moreover, there are subtle bugs caused by the inability to indicate ps change along with other changes (e.g. when the AP deauth us, we'd like to indicate CHANGED_PS | CHANGED_ASSOC, as changing PS before notifying about disassociation will result in null-packets being sent (if IEEE80211_HW_SUPPORTS_DYNAMIC_PS) while the sta is already disconnected.) Keep the current per-device notifications, and add parallel per-vif notifications. In order to keep it simple, the per-device ps and the per-vif ps are orthogonal - the per-vif ps configuration is determined only by the user configuration (enable/disable) and the connection state, and is not affected by other vifs state and (temporary) dynamic_ps/offchannel operations (unlike per-device ps). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f0d6fa283071..ea46c6446450 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1032,6 +1032,16 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
1032 ieee80211_change_ps(local); 1032 ieee80211_change_ps(local);
1033} 1033}
1034 1034
1035void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata)
1036{
1037 bool ps_allowed = ieee80211_powersave_allowed(sdata);
1038
1039 if (sdata->vif.bss_conf.ps != ps_allowed) {
1040 sdata->vif.bss_conf.ps = ps_allowed;
1041 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_PS);
1042 }
1043}
1044
1035void ieee80211_dynamic_ps_disable_work(struct work_struct *work) 1045void ieee80211_dynamic_ps_disable_work(struct work_struct *work)
1036{ 1046{
1037 struct ieee80211_local *local = 1047 struct ieee80211_local *local =
@@ -1335,6 +1345,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1335 ieee80211_recalc_smps(local); 1345 ieee80211_recalc_smps(local);
1336 mutex_unlock(&local->iflist_mtx); 1346 mutex_unlock(&local->iflist_mtx);
1337 1347
1348 ieee80211_recalc_ps_vif(sdata);
1349
1338 netif_tx_start_all_queues(sdata->dev); 1350 netif_tx_start_all_queues(sdata->dev);
1339 netif_carrier_on(sdata->dev); 1351 netif_carrier_on(sdata->dev);
1340} 1352}
@@ -1396,6 +1408,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1396 } 1408 }
1397 local->ps_sdata = NULL; 1409 local->ps_sdata = NULL;
1398 1410
1411 /* disable per-vif ps */
1412 ieee80211_recalc_ps_vif(sdata);
1413
1399 /* flush out any pending frame (e.g. DELBA) before deauth/disassoc */ 1414 /* flush out any pending frame (e.g. DELBA) before deauth/disassoc */
1400 if (tx) 1415 if (tx)
1401 drv_flush(local, false); 1416 drv_flush(local, false);