2021-01-05 03:10:06

by Wen Gong

[permalink] [raw]
Subject: [PATCH v3 0/2] mac80211: set NSS correct for supported HE-MCS and NSS set

The NSS number should be the intersection of peer and own capbility.

v3: added "mac80211: remove NSS number of 160MHz if not support 160MHz for HE"

v2: fix build warning

Wen Gong (2):
mac80211: remove NSS number of 160MHz if not support 160MHz for HE
mac80211: do intersection with he mcs and nss set of peer and own

net/mac80211/he.c | 94 ++++++++++++++++++++++++++++++++++++++
net/mac80211/ieee80211_i.h | 5 ++
net/mac80211/vht.c | 9 +++-
3 files changed, 107 insertions(+), 1 deletion(-)

--
2.23.0


2021-01-05 03:11:31

by Wen Gong

[permalink] [raw]
Subject: [PATCH v3 1/2] mac80211: remove NSS number of 160MHz if not support 160MHz for HE

When it does not support 160MHz in HE phy capabilities information,
it should not treat the NSS number of 160MHz as a valid number,
otherwise the final NSS will be set to 0.

Signed-off-by: Wen Gong <[email protected]>
---
net/mac80211/vht.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
index d87e020715b3..d872f1d4d946 100644
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -484,6 +484,7 @@ enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta)
void ieee80211_sta_set_rx_nss(struct sta_info *sta)
{
u8 ht_rx_nss = 0, vht_rx_nss = 0, he_rx_nss = 0, rx_nss;
+ bool support_160;

/* if we received a notification already don't overwrite it */
if (sta->sta.rx_nss)
@@ -514,7 +515,13 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta)
}
}

- he_rx_nss = min(rx_mcs_80, rx_mcs_160);
+ support_160 = !!(he_cap->he_cap_elem.phy_cap_info[0] &
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G);
+
+ if (support_160)
+ he_rx_nss = min(rx_mcs_80, rx_mcs_160);
+ else
+ he_rx_nss = rx_mcs_80;
}

if (sta->sta.ht_cap.ht_supported) {
--
2.23.0