diff options
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 0d2d94881f1f..d4426748ab10 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -32,7 +32,12 @@ | |||
32 | #include "led.h" | 32 | #include "led.h" |
33 | #include "cfg.h" | 33 | #include "cfg.h" |
34 | #include "debugfs.h" | 34 | #include "debugfs.h" |
35 | #include "debugfs_netdev.h" | 35 | |
36 | |||
37 | bool ieee80211_disable_40mhz_24ghz; | ||
38 | module_param(ieee80211_disable_40mhz_24ghz, bool, 0644); | ||
39 | MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, | ||
40 | "Disable 40MHz support in the 2.4GHz band"); | ||
36 | 41 | ||
37 | void ieee80211_configure_filter(struct ieee80211_local *local) | 42 | void ieee80211_configure_filter(struct ieee80211_local *local) |
38 | { | 43 | { |
@@ -114,6 +119,18 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) | |||
114 | changed |= IEEE80211_CONF_CHANGE_CHANNEL; | 119 | changed |= IEEE80211_CONF_CHANGE_CHANNEL; |
115 | } | 120 | } |
116 | 121 | ||
122 | if (!conf_is_ht(&local->hw.conf)) { | ||
123 | /* | ||
124 | * mac80211.h documents that this is only valid | ||
125 | * when the channel is set to an HT type, and | ||
126 | * that otherwise STATIC is used. | ||
127 | */ | ||
128 | local->hw.conf.smps_mode = IEEE80211_SMPS_STATIC; | ||
129 | } else if (local->hw.conf.smps_mode != local->smps_mode) { | ||
130 | local->hw.conf.smps_mode = local->smps_mode; | ||
131 | changed |= IEEE80211_CONF_CHANGE_SMPS; | ||
132 | } | ||
133 | |||
117 | if (scan_chan) | 134 | if (scan_chan) |
118 | power = chan->max_power; | 135 | power = chan->max_power; |
119 | else | 136 | else |
@@ -173,7 +190,7 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | |||
173 | } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) | 190 | } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) |
174 | sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid; | 191 | sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid; |
175 | else if (sdata->vif.type == NL80211_IFTYPE_AP) | 192 | else if (sdata->vif.type == NL80211_IFTYPE_AP) |
176 | sdata->vif.bss_conf.bssid = sdata->dev->dev_addr; | 193 | sdata->vif.bss_conf.bssid = sdata->vif.addr; |
177 | else if (ieee80211_vif_is_mesh(&sdata->vif)) { | 194 | else if (ieee80211_vif_is_mesh(&sdata->vif)) { |
178 | sdata->vif.bss_conf.bssid = zero; | 195 | sdata->vif.bss_conf.bssid = zero; |
179 | } else { | 196 | } else { |
@@ -223,8 +240,7 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | |||
223 | } | 240 | } |
224 | } | 241 | } |
225 | 242 | ||
226 | drv_bss_info_changed(local, &sdata->vif, | 243 | drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed); |
227 | &sdata->vif.bss_conf, changed); | ||
228 | } | 244 | } |
229 | 245 | ||
230 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata) | 246 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata) |
@@ -299,6 +315,16 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw) | |||
299 | } | 315 | } |
300 | EXPORT_SYMBOL(ieee80211_restart_hw); | 316 | EXPORT_SYMBOL(ieee80211_restart_hw); |
301 | 317 | ||
318 | static void ieee80211_recalc_smps_work(struct work_struct *work) | ||
319 | { | ||
320 | struct ieee80211_local *local = | ||
321 | container_of(work, struct ieee80211_local, recalc_smps); | ||
322 | |||
323 | mutex_lock(&local->iflist_mtx); | ||
324 | ieee80211_recalc_smps(local, NULL); | ||
325 | mutex_unlock(&local->iflist_mtx); | ||
326 | } | ||
327 | |||
302 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | 328 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, |
303 | const struct ieee80211_ops *ops) | 329 | const struct ieee80211_ops *ops) |
304 | { | 330 | { |
@@ -372,6 +398,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
372 | INIT_WORK(&local->restart_work, ieee80211_restart_work); | 398 | INIT_WORK(&local->restart_work, ieee80211_restart_work); |
373 | 399 | ||
374 | INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); | 400 | INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); |
401 | INIT_WORK(&local->recalc_smps, ieee80211_recalc_smps_work); | ||
402 | local->smps_mode = IEEE80211_SMPS_OFF; | ||
375 | 403 | ||
376 | INIT_WORK(&local->dynamic_ps_enable_work, | 404 | INIT_WORK(&local->dynamic_ps_enable_work, |
377 | ieee80211_dynamic_ps_enable_work); | 405 | ieee80211_dynamic_ps_enable_work); |
@@ -674,11 +702,19 @@ static int __init ieee80211_init(void) | |||
674 | 702 | ||
675 | ret = rc80211_pid_init(); | 703 | ret = rc80211_pid_init(); |
676 | if (ret) | 704 | if (ret) |
677 | return ret; | 705 | goto err_pid; |
678 | 706 | ||
679 | ieee80211_debugfs_netdev_init(); | 707 | ret = ieee80211_iface_init(); |
708 | if (ret) | ||
709 | goto err_netdev; | ||
680 | 710 | ||
681 | return 0; | 711 | return 0; |
712 | err_netdev: | ||
713 | rc80211_pid_exit(); | ||
714 | err_pid: | ||
715 | rc80211_minstrel_exit(); | ||
716 | |||
717 | return ret; | ||
682 | } | 718 | } |
683 | 719 | ||
684 | static void __exit ieee80211_exit(void) | 720 | static void __exit ieee80211_exit(void) |
@@ -695,7 +731,7 @@ static void __exit ieee80211_exit(void) | |||
695 | if (mesh_allocated) | 731 | if (mesh_allocated) |
696 | ieee80211s_stop(); | 732 | ieee80211s_stop(); |
697 | 733 | ||
698 | ieee80211_debugfs_netdev_exit(); | 734 | ieee80211_iface_exit(); |
699 | } | 735 | } |
700 | 736 | ||
701 | 737 | ||