diff options
author | Alexander Bondar <alexander.bondar@intel.com> | 2013-05-06 17:17:04 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-05-16 23:01:29 +0200 |
commit | ce85788846ec19dcb7bef0dcbcf83fb64630f426 (patch) | |
tree | 422cc3629c4a673175fe2bcb4f0f8511a34cd856 /net/mac80211 | |
parent | 0d4261ad5d0028b26cd88e645b4507eed8aab3f7 (diff) |
mac80211: enable power save only if DTIM period is available
Generally, the DTIM period is available after a beacon has
been received, and if no beacon has been received enabling
powersave is problematic anyway for synchronisation. Since
some drivers may require the DTIM period for powersave,
don't enable powersave until it becomes available in case
the scan/association managed to not receive a beacon.
Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a8016c02a757..ef378b9a32ec 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1390,6 +1390,9 @@ static bool ieee80211_powersave_allowed(struct ieee80211_sub_if_data *sdata) IEEE80211_STA_CONNECTION_POLL)) return false; + if (!sdata->vif.bss_conf.dtim_period) + return false; + rcu_read_lock(); sta = sta_info_get(sdata, mgd->bssid); if (sta) @@ -3126,6 +3129,7 @@ ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, } changed |= BSS_CHANGED_DTIM_PERIOD; + ieee80211_recalc_ps_vif(sdata); } if (elems.erp_info) { |