aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-04-15 12:13:56 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-04-22 11:23:19 -0400
commit9a07bf507dfc5402e63d96596341f2a15e4142c7 (patch)
tree362283a76debc6f0be9bab2b649af1fae6ec2c39 /net/mac80211
parent96cce12ff6e0bc9d9fcb2235e08b7fc150f96fd2 (diff)
mac80211: Allow HT capa override to add 40 MHz intolerant
This can be useful for testing purposes to confirm valid AP behavior on HT 20/40 co-existence functionality. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ht.c18
-rw-r--r--net/mac80211/main.c3
2 files changed, 19 insertions, 2 deletions
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 1495b9e39484..15702ff64a4c 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -31,6 +31,18 @@ static void __check_htcap_disable(struct ieee80211_ht_cap *ht_capa,
31 } 31 }
32} 32}
33 33
34static void __check_htcap_enable(struct ieee80211_ht_cap *ht_capa,
35 struct ieee80211_ht_cap *ht_capa_mask,
36 struct ieee80211_sta_ht_cap *ht_cap,
37 u16 flag)
38{
39 __le16 le_flag = cpu_to_le16(flag);
40
41 if ((ht_capa_mask->cap_info & le_flag) &&
42 (ht_capa->cap_info & le_flag))
43 ht_cap->cap |= flag;
44}
45
34void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, 46void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
35 struct ieee80211_sta_ht_cap *ht_cap) 47 struct ieee80211_sta_ht_cap *ht_cap)
36{ 48{
@@ -59,7 +71,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
59 smask = (u8 *)(&ht_capa_mask->mcs.rx_mask); 71 smask = (u8 *)(&ht_capa_mask->mcs.rx_mask);
60 72
61 /* NOTE: If you add more over-rides here, update register_hw 73 /* NOTE: If you add more over-rides here, update register_hw
62 * ht_capa_mod_msk logic in main.c as well. 74 * ht_capa_mod_mask logic in main.c as well.
63 * And, if this method can ever change ht_cap.ht_supported, fix 75 * And, if this method can ever change ht_cap.ht_supported, fix
64 * the check in ieee80211_add_ht_ie. 76 * the check in ieee80211_add_ht_ie.
65 */ 77 */
@@ -90,6 +102,10 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
90 __check_htcap_disable(ht_capa, ht_capa_mask, ht_cap, 102 __check_htcap_disable(ht_capa, ht_capa_mask, ht_cap,
91 IEEE80211_HT_CAP_LDPC_CODING); 103 IEEE80211_HT_CAP_LDPC_CODING);
92 104
105 /* Allow user to enable 40 MHz intolerant bit. */
106 __check_htcap_enable(ht_capa, ht_capa_mask, ht_cap,
107 IEEE80211_HT_CAP_40MHZ_INTOLERANT);
108
93 /* Allow user to decrease AMPDU factor */ 109 /* Allow user to decrease AMPDU factor */
94 if (ht_capa_mask->ampdu_params_info & 110 if (ht_capa_mask->ampdu_params_info &
95 IEEE80211_HT_AMPDU_PARM_FACTOR) { 111 IEEE80211_HT_AMPDU_PARM_FACTOR) {
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index cfc24e912947..5854699a9082 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -445,7 +445,8 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = {
445 IEEE80211_HT_CAP_MAX_AMSDU | 445 IEEE80211_HT_CAP_MAX_AMSDU |
446 IEEE80211_HT_CAP_SGI_20 | 446 IEEE80211_HT_CAP_SGI_20 |
447 IEEE80211_HT_CAP_SGI_40 | 447 IEEE80211_HT_CAP_SGI_40 |
448 IEEE80211_HT_CAP_LDPC_CODING), 448 IEEE80211_HT_CAP_LDPC_CODING |
449 IEEE80211_HT_CAP_40MHZ_INTOLERANT),
449 .mcs = { 450 .mcs = {
450 .rx_mask = { 0xff, 0xff, 0xff, 0xff, 0xff, 451 .rx_mask = { 0xff, 0xff, 0xff, 0xff, 0xff,
451 0xff, 0xff, 0xff, 0xff, 0xff, }, 452 0xff, 0xff, 0xff, 0xff, 0xff, },