aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 98320a94c270..e1293e8ed83a 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -113,6 +113,18 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
113 changed |= IEEE80211_CONF_CHANGE_CHANNEL; 113 changed |= IEEE80211_CONF_CHANGE_CHANNEL;
114 } 114 }
115 115
116 if (!conf_is_ht(&local->hw.conf)) {
117 /*
118 * mac80211.h documents that this is only valid
119 * when the channel is set to an HT type, and
120 * that otherwise STATIC is used.
121 */
122 local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC;
123 } else if (local->hw.conf.smps_mode != local->smps_mode) {
124 local->hw.conf.smps_mode = local->smps_mode;
125 changed |= IEEE80211_CONF_CHANGE_SMPS;
126 }
127
116 if (scan_chan) 128 if (scan_chan)
117 power = chan->max_power; 129 power = chan->max_power;
118 else 130 else
@@ -297,6 +309,16 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw)
297} 309}
298EXPORT_SYMBOL(ieee80211_restart_hw); 310EXPORT_SYMBOL(ieee80211_restart_hw);
299 311
312static void ieee80211_recalc_smps_work(struct work_struct *work)
313{
314 struct ieee80211_local *local =
315 container_of(work, struct ieee80211_local, recalc_smps);
316
317 mutex_lock(&local->iflist_mtx);
318 ieee80211_recalc_smps(local, NULL);
319 mutex_unlock(&local->iflist_mtx);
320}
321
300struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 322struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
301 const struct ieee80211_ops *ops) 323 const struct ieee80211_ops *ops)
302{ 324{
@@ -370,6 +392,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
370 INIT_WORK(&local->restart_work, ieee80211_restart_work); 392 INIT_WORK(&local->restart_work, ieee80211_restart_work);
371 393
372 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); 394 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter);
395 INIT_WORK(&local->recalc_smps, ieee80211_recalc_smps_work);
396 local->smps_mode = IEEE80211_SMPS_OFF;
373 397
374 INIT_WORK(&local->dynamic_ps_enable_work, 398 INIT_WORK(&local->dynamic_ps_enable_work,
375 ieee80211_dynamic_ps_enable_work); 399 ieee80211_dynamic_ps_enable_work);