Skip to content

Commit 33181ea

Browse files
shaydeveljmberg-intel
authored andcommitted
mac80211: fix wrong 160/80+80 MHz setting
Before this patch, STA's would set new width of 160/80+80 MHz based on AP capability only. This is wrong because STA may not support > 80MHz BW. Fix is to verify STA has 160/80+80 MHz capability before increasing its width to > 80MHz. The "support_80_80" and "support_160" setting is based on: "Table 9-272 — Setting of the Supported Channel Width Set subfield and Extended NSS BW Support subfield at a STA transmitting the VHT Capabilities Information field" From "Draft P802.11REVmd_D3.0.pdf" Signed-off-by: Aviad Brikman <[email protected]> Signed-off-by: Shay Bar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent ea75080 commit 33181ea

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

net/mac80211/util.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,10 +2993,22 @@ bool ieee80211_chandef_vht_oper(struct ieee80211_hw *hw,
29932993
int cf0, cf1;
29942994
int ccfs0, ccfs1, ccfs2;
29952995
int ccf0, ccf1;
2996+
u32 vht_cap;
2997+
bool support_80_80 = false;
2998+
bool support_160 = false;
29962999

29973000
if (!oper || !htop)
29983001
return false;
29993002

3003+
vht_cap = hw->wiphy->bands[chandef->chan->band]->vht_cap.cap;
3004+
support_160 = (vht_cap & (IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK |
3005+
IEEE80211_VHT_CAP_EXT_NSS_BW_MASK));
3006+
support_80_80 = ((vht_cap &
3007+
IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) ||
3008+
(vht_cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
3009+
vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) ||
3010+
((vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) >>
3011+
IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT > 1));
30003012
ccfs0 = oper->center_freq_seg0_idx;
30013013
ccfs1 = oper->center_freq_seg1_idx;
30023014
ccfs2 = (le16_to_cpu(htop->operation_mode) &
@@ -3024,10 +3036,10 @@ bool ieee80211_chandef_vht_oper(struct ieee80211_hw *hw,
30243036
unsigned int diff;
30253037

30263038
diff = abs(ccf1 - ccf0);
3027-
if (diff == 8) {
3039+
if ((diff == 8) && support_160) {
30283040
new.width = NL80211_CHAN_WIDTH_160;
30293041
new.center_freq1 = cf1;
3030-
} else if (diff > 8) {
3042+
} else if ((diff > 8) && support_80_80) {
30313043
new.width = NL80211_CHAN_WIDTH_80P80;
30323044
new.center_freq2 = cf1;
30333045
}

0 commit comments

Comments
 (0)