Commit f46209b9 authored by Tova Mussai's avatar Tova Mussai Committed by Johannes Berg

mac80211: HE: set RX NSS

In case of HE, the RX NSS is taken from the HE capabilities.
If the supported NSS capabilities that are reported by AP for
HE mode in the HE Capabilities element are different from the NSS
capabilities that are reported by AP for the VHT mode in the VHT
Capabilities element, use the lowest supported NSS to not get all
the values confused.
Signed-off-by: default avatarTova Mussai <tova.mussai@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20200131111300.891737-9-luca@coelho.fiSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent cf2c9cc3
...@@ -481,12 +481,40 @@ enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta) ...@@ -481,12 +481,40 @@ 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; u8 ht_rx_nss = 0, vht_rx_nss = 0, he_rx_nss = 0, rx_nss;
/* 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)
return; return;
if (sta->sta.he_cap.has_he) {
int i;
u8 rx_mcs_80 = 0, rx_mcs_160 = 0;
const struct ieee80211_sta_he_cap *he_cap = &sta->sta.he_cap;
u16 mcs_160_map =
le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160);
u16 mcs_80_map = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80);
for (i = 7; i >= 0; i--) {
u8 mcs_160 = (mcs_160_map >> (2 * i)) & 3;
if (mcs_160 != IEEE80211_VHT_MCS_NOT_SUPPORTED) {
rx_mcs_160 = i + 1;
break;
}
}
for (i = 7; i >= 0; i--) {
u8 mcs_80 = (mcs_80_map >> (2 * i)) & 3;
if (mcs_80 != IEEE80211_VHT_MCS_NOT_SUPPORTED) {
rx_mcs_80 = i + 1;
break;
}
}
he_rx_nss = min(rx_mcs_80, rx_mcs_160);
}
if (sta->sta.ht_cap.ht_supported) { if (sta->sta.ht_cap.ht_supported) {
if (sta->sta.ht_cap.mcs.rx_mask[0]) if (sta->sta.ht_cap.mcs.rx_mask[0])
ht_rx_nss++; ht_rx_nss++;
...@@ -516,8 +544,9 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta) ...@@ -516,8 +544,9 @@ void ieee80211_sta_set_rx_nss(struct sta_info *sta)
/* FIXME: consider rx_highest? */ /* FIXME: consider rx_highest? */
} }
ht_rx_nss = max(ht_rx_nss, vht_rx_nss); rx_nss = max(vht_rx_nss, ht_rx_nss);
sta->sta.rx_nss = max_t(u8, 1, ht_rx_nss); rx_nss = max(he_rx_nss, rx_nss);
sta->sta.rx_nss = max_t(u8, 1, rx_nss);
} }
u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata, u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
......
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