Commit 2d5e09d0 authored by Wen Gong's avatar Wen Gong Committed by Johannes Berg

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: default avatarWen Gong <wgong@codeaurora.org>
Link: https://lore.kernel.org/r/1609816120-9411-2-git-send-email-wgong@codeaurora.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 28881922
...@@ -484,6 +484,7 @@ enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta) ...@@ -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) 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; 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 we received a notification already don't overwrite it */
if (sta->sta.rx_nss) if (sta->sta.rx_nss)
...@@ -514,7 +515,13 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta) ...@@ -514,7 +515,13 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta)
} }
} }
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); he_rx_nss = min(rx_mcs_80, rx_mcs_160);
else
he_rx_nss = rx_mcs_80;
} }
if (sta->sta.ht_cap.ht_supported) { if (sta->sta.ht_cap.ht_supported) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment