diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-02-16 02:46:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-18 16:54:52 -0500 |
commit | 8ba0537c620ad9f37b0e810ce0a9ff367a021f5e (patch) | |
tree | 659622a8cd43642ca6438ec6a7a3e68e82d23efd /net/mac80211 | |
parent | 9bf8ab35f269d66e507de2b1ccc67a02d8284db5 (diff) |
mac80211: fix 2.4 GHz 40 MHz disabling
The module parameter ieee80211_disable_40mhz_24ghz
was meant to allow disabling 40 MHz operation in
the 2.4 GHz band by default. However, it is buggy
as implemented because while it advertises to the
AP that the device doesn't support 40 MHz, it will
itself still use 40 MHz configurations.
To fix this, clear the 40 MHz bits from the sband
completely instead of overriding where used.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/main.c | 14 | ||||
-rw-r--r-- | net/mac80211/util.c | 6 | ||||
-rw-r--r-- | net/mac80211/work.c | 6 |
4 files changed, 13 insertions, 15 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 44eea1af1553..bb63878d865e 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1066,8 +1066,6 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | |||
1066 | void ieee80211_configure_filter(struct ieee80211_local *local); | 1066 | void ieee80211_configure_filter(struct ieee80211_local *local); |
1067 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); | 1067 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); |
1068 | 1068 | ||
1069 | extern bool ieee80211_disable_40mhz_24ghz; | ||
1070 | |||
1071 | /* STA code */ | 1069 | /* STA code */ |
1072 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); | 1070 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); |
1073 | int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, | 1071 | int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index e7eb2cfaf400..2543e48bd813 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "debugfs.h" | 34 | #include "debugfs.h" |
35 | 35 | ||
36 | 36 | ||
37 | bool ieee80211_disable_40mhz_24ghz; | 37 | static bool ieee80211_disable_40mhz_24ghz; |
38 | module_param(ieee80211_disable_40mhz_24ghz, bool, 0644); | 38 | module_param(ieee80211_disable_40mhz_24ghz, bool, 0644); |
39 | MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, | 39 | MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, |
40 | "Disable 40MHz support in the 2.4GHz band"); | 40 | "Disable 40MHz support in the 2.4GHz band"); |
@@ -723,6 +723,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
723 | } | 723 | } |
724 | channels += sband->n_channels; | 724 | channels += sband->n_channels; |
725 | 725 | ||
726 | /* | ||
727 | * Since ieee80211_disable_40mhz_24ghz is global, we can | ||
728 | * modify the sband's ht data even if the driver uses a | ||
729 | * global structure for that. | ||
730 | */ | ||
731 | if (ieee80211_disable_40mhz_24ghz && | ||
732 | band == IEEE80211_BAND_2GHZ && | ||
733 | sband->ht_cap.ht_supported) { | ||
734 | sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
735 | sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
736 | } | ||
737 | |||
726 | if (max_bitrates < sband->n_bitrates) | 738 | if (max_bitrates < sband->n_bitrates) |
727 | max_bitrates = sband->n_bitrates; | 739 | max_bitrates = sband->n_bitrates; |
728 | supp_ht = supp_ht || sband->ht_cap.ht_supported; | 740 | supp_ht = supp_ht || sband->ht_cap.ht_supported; |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index cf68700abffa..26fd5d29af7f 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -986,12 +986,6 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, | |||
986 | u16 cap = sband->ht_cap.cap; | 986 | u16 cap = sband->ht_cap.cap; |
987 | __le16 tmp; | 987 | __le16 tmp; |
988 | 988 | ||
989 | if (ieee80211_disable_40mhz_24ghz && | ||
990 | sband->band == IEEE80211_BAND_2GHZ) { | ||
991 | cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
992 | cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
993 | } | ||
994 | |||
995 | *pos++ = WLAN_EID_HT_CAPABILITY; | 989 | *pos++ = WLAN_EID_HT_CAPABILITY; |
996 | *pos++ = sizeof(struct ieee80211_ht_cap); | 990 | *pos++ = sizeof(struct ieee80211_ht_cap); |
997 | memset(pos, 0, sizeof(struct ieee80211_ht_cap)); | 991 | memset(pos, 0, sizeof(struct ieee80211_ht_cap)); |
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index 64f2b2871282..204f0a4db969 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -126,12 +126,6 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie, | |||
126 | 126 | ||
127 | /* determine capability flags */ | 127 | /* determine capability flags */ |
128 | 128 | ||
129 | if (ieee80211_disable_40mhz_24ghz && | ||
130 | sband->band == IEEE80211_BAND_2GHZ) { | ||
131 | cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
132 | cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
133 | } | ||
134 | |||
135 | switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { | 129 | switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { |
136 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: | 130 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: |
137 | if (flags & IEEE80211_CHAN_NO_HT40PLUS) { | 131 | if (flags & IEEE80211_CHAN_NO_HT40PLUS) { |