aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-12-01 12:29:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-22 13:31:17 -0500
commitf38fd12fa7b7b98e158a9b31d388da34eef25c22 (patch)
treebf5f8407e3456e691e4ef873d343c3403974937a
parent8b73d13a21ae889e747cac180ff27c5a0a88e6a4 (diff)
mac80211: allow disabling 40MHz on 2.4GHz
In some situations it is required that a system be configured with no support for 40 MHz channels in the 2.4 GHz band. Rather than imposing any such restrictions on everybody, allow configuration a system like that with a module parameter. It is writable at runtime but only takes effect at the time of the next association. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c6
-rw-r--r--net/mac80211/mlme.c6
-rw-r--r--net/mac80211/util.c14
4 files changed, 25 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e63aecbddfbe..6fb3f7181536 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -881,6 +881,8 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
881void ieee80211_configure_filter(struct ieee80211_local *local); 881void ieee80211_configure_filter(struct ieee80211_local *local);
882u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); 882u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
883 883
884extern bool ieee80211_disable_40mhz_24ghz;
885
884/* STA code */ 886/* STA code */
885void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); 887void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
886int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, 888int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e1293e8ed83a..25f52098b636 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -33,6 +33,12 @@
33#include "cfg.h" 33#include "cfg.h"
34#include "debugfs.h" 34#include "debugfs.h"
35 35
36
37bool ieee80211_disable_40mhz_24ghz;
38module_param(ieee80211_disable_40mhz_24ghz, bool, 0644);
39MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz,
40 "Disable 40MHz support in the 2.4GHz band");
41
36void ieee80211_configure_filter(struct ieee80211_local *local) 42void ieee80211_configure_filter(struct ieee80211_local *local)
37{ 43{
38 u64 mc; 44 u64 mc;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0a762a9ba4df..a7472c979c63 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -400,6 +400,12 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
400 400
401 /* determine capability flags */ 401 /* determine capability flags */
402 402
403 if (ieee80211_disable_40mhz_24ghz &&
404 sband->band == IEEE80211_BAND_2GHZ) {
405 cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
406 cap &= ~IEEE80211_HT_CAP_SGI_40;
407 }
408
403 switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 409 switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
404 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 410 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
405 if (flags & IEEE80211_CHAN_NO_HT40PLUS) { 411 if (flags & IEEE80211_CHAN_NO_HT40PLUS) {
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 086ef6257b4b..acb6626ad0a4 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -908,16 +908,24 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
908 } 908 }
909 909
910 if (sband->ht_cap.ht_supported) { 910 if (sband->ht_cap.ht_supported) {
911 __le16 tmp = cpu_to_le16(sband->ht_cap.cap); 911 u16 cap = sband->ht_cap.cap;
912 __le16 tmp;
913
914 if (ieee80211_disable_40mhz_24ghz &&
915 sband->band == IEEE80211_BAND_2GHZ) {
916 cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
917 cap &= ~IEEE80211_HT_CAP_SGI_40;
918 }
912 919
913 *pos++ = WLAN_EID_HT_CAPABILITY; 920 *pos++ = WLAN_EID_HT_CAPABILITY;
914 *pos++ = sizeof(struct ieee80211_ht_cap); 921 *pos++ = sizeof(struct ieee80211_ht_cap);
915 memset(pos, 0, sizeof(struct ieee80211_ht_cap)); 922 memset(pos, 0, sizeof(struct ieee80211_ht_cap));
923 tmp = cpu_to_le16(cap);
916 memcpy(pos, &tmp, sizeof(u16)); 924 memcpy(pos, &tmp, sizeof(u16));
917 pos += sizeof(u16); 925 pos += sizeof(u16);
918 /* TODO: needs a define here for << 2 */
919 *pos++ = sband->ht_cap.ampdu_factor | 926 *pos++ = sband->ht_cap.ampdu_factor |
920 (sband->ht_cap.ampdu_density << 2); 927 (sband->ht_cap.ampdu_density <<
928 IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
921 memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs)); 929 memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
922 pos += sizeof(sband->ht_cap.mcs); 930 pos += sizeof(sband->ht_cap.mcs);
923 pos += 2 + 4 + 1; /* ext info, BF cap, antsel */ 931 pos += 2 + 4 + 1; /* ext info, BF cap, antsel */