mac80211: allow overriding station bandwidth.
Subsystems (2)
PATCH v2 1/1 mac80211: allow overriding station bandwidth.
From: Ben Greear <[email protected]>
This allows one to disable VHT160 (or 80+80) on hardware that might otherwise try to use it.
---
v2: Change description
include/linux/ieee80211.h | 1 + net/mac80211/main.c | 1 + net/mac80211/vht.c | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+)
include/linux/ieee80211.h +1 -0
@@ -1542,6 +1542,7 @@ struct ieee80211_vht_operation {#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000C +#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_SHIFT 2#define IEEE80211_VHT_CAP_RXLDPC 0x00000010#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
net/mac80211/main.c +1 -0
@@ -464,6 +464,7 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = {static const struct ieee80211_vht_cap mac80211_vht_capa_mod_mask = { .vht_cap_info = cpu_to_le32(IEEE80211_VHT_CAP_RXLDPC | + IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK | IEEE80211_VHT_CAP_SHORT_GI_80 | IEEE80211_VHT_CAP_SHORT_GI_160 | IEEE80211_VHT_CAP_RXSTBC_1 |
net/mac80211/vht.c +23 -0
@@ -56,6 +56,29 @@ void ieee80211_apply_vhtcap_overrides(struct ieee80211_sub_if_data *sdata,__check_vhtcap_disable (sdata, vht_cap,IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN ); +/* Allow disabling 160Mhz or 80+80 */ +if (sdata->u.mgd.vht_capa_mask.vht_cap_info & +cpu_to_le32 (IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK )) { +u32 cap, n; + + n =le32_to_cpu (sdata->u.mgd.vht_capa.vht_cap_info) & +IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK ; + n >>=IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_SHIFT ; + cap = vht_cap->cap &IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK ; + cap >>=IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_SHIFT ; + +if (n < cap) { + vht_cap->cap &= + ~IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK ; + vht_cap->cap |= + n <<IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_SHIFT ; + +/* Cannot do short GI 160 if we cannot do 160 or 80+80 */ +if (n ==0 ) + vht_cap->cap &= ~IEEE80211_VHT_CAP_SHORT_GI_160 ; + } + } +/* Allow user to decrease AMPDU length exponent */ if (sdata->u.mgd.vht_capa_mask.vht_cap_info &cpu_to_le32 (IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK )) {
Signature · 1 line
2.4.11
Johannes Berg
maintainerQuoted 4 lines · On Wed, 2017-02-15 at 17:16 -0800, [email protected] wrote:
From: Ben Greear <[email protected]>
This allows one to disable VHT160 (or 80+80) on hardware that might otherwise try to use it.
I just decided against applying this now because of the changing VHT extended NSS BW stuff. This would in that case not actually override the 160/80+80 capability, which would probably actually be the right thing given how this works (mask & shift stuff), but without also allowing to override the *new* things you'd not actually gain the ability to get rid of 160/80+80... so overall I think right now that's just confusing things even more.
johannes