mac80211: Allow HT capa override to add 40 MHz intolerant
PATCH 1/1 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.
--- net/mac80211/ht.c | 18 +++++++++++++++++- net/mac80211/main.c | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-)
net/mac80211/ht.c +17 -1
@@ -31,6 +31,18 @@ static void __check_htcap_disable(struct ieee80211_ht_cap *ht_capa, } } +static void __check_htcap_enable (struct ieee80211_ht_cap *ht_capa, +struct ieee80211_ht_cap *ht_capa_mask, +struct ieee80211_sta_ht_cap *ht_cap, +u16 flag) +{ +__le16 le_flag =cpu_to_le16 (flag); + +if ((ht_capa_mask->cap_info & le_flag) && + (ht_capa->cap_info & le_flag)) + ht_cap->cap |= flag; +} +void ieee80211_apply_htcap_overrides (struct ieee80211_sub_if_data *sdata,struct ieee80211_sta_ht_cap *ht_cap) {
@@ -59,7 +71,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, smask = (u8 *)(&ht_capa_mask->mcs.rx_mask);/* NOTE: If you add more over-rides here, update register_hw -* ht_capa_mod_msk logic in main.c as well. +* ht_capa_mod_mask logic in main.c as well. * And, if this method can ever change ht_cap.ht_supported, fix * the check in ieee80211_add_ht_ie. */
@@ -86,6 +98,10 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,__check_htcap_disable (ht_capa, ht_capa_mask, ht_cap,IEEE80211_HT_CAP_MAX_AMSDU ); +/* Allow user to enable 40 MHz intolerant bit. */ +__check_htcap_enable (ht_capa, ht_capa_mask, ht_cap, +IEEE80211_HT_CAP_40MHZ_INTOLERANT ); +/* Allow user to decrease AMPDU factor */ if (ht_capa_mask->ampdu_params_info &IEEE80211_HT_AMPDU_PARM_FACTOR ) {
net/mac80211/main.c +2 -1
@@ -446,7 +446,8 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = { .cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_SGI_40), + IEEE80211_HT_CAP_SGI_40 | + IEEE80211_HT_CAP_40MHZ_INTOLERANT), .mcs = { .rx_mask = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, },
Signature · 5 lines
1.7.9.5 -- Jouni Malinen PGP id EFC895FA
Quoted 2 lines · Jouni Malinen
This can be useful for testing purposes to confirm valid AP behavior on HT 20/40 co-existence functionality.
Applied.
net/mac80211/main.c static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = { · line 450
Quoted 8 lines
+++
b/net/mac80211/main.cnet/mac80211/main.c +2
-1@@ -446,7 +446,8 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = { .cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 |IEEE80211_HT_CAP_MAX_AMSDU |IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_SGI_40), +IEEE80211_HT_CAP_SGI_40 | + IEEE80211_HT_CAP_40MHZ_INTOLERANT),
This had a conflict because LDPC was already in those flags ... I think I did the right thing by just adding 40MHZ_INTOLERANT.
johannes
Quoted 11 lines · Johannes Berg
net/mac80211/main.c static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = { · line 450
Quoted 8 lines
+++
b/net/mac80211/main.cnet/mac80211/main.c +2
-1@@ -446,7 +446,8 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = { .cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 |IEEE80211_HT_CAP_MAX_AMSDU |IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_SGI_40), +IEEE80211_HT_CAP_SGI_40 | + IEEE80211_HT_CAP_40MHZ_INTOLERANT),This had a conflict because LDPC was already in those flags ... I think I did the right thing by just adding 40MHZ_INTOLERANT.
Thanks, that looks good to me.
Signature · 1 line
Jouni Malinen PGP id EFC895FA