From: Emmanuel Grumbach We hit a WARNING in mac80211 in sniffer that complains that rx_status->nss is 0. This happens on frames that the firmware doesn't really understand and when that happens, somehow the STBC bit is set. The driver divides the number of antennas by 2 to get the NSS with STBC set because each stream requires 2 antennas. Since NSTS=1, NSS end up being 0. Since we don't have devices with more than 2 antennas, just consider that when we receive STBC traffic, we have one spatial stream. Since this problem has been seen on HE traffic only, don't apply this logic on VHT / HT code paths. Signed-off-by: Emmanuel Grumbach Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mld/rx.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mld/rx.c b/drivers/net/wireless/intel/iwlwifi/mld/rx.c index 5f18aa551af5..8fa438fd7815 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/rx.c @@ -553,7 +553,10 @@ iwl_mld_decode_he_tb_phy_data(struct iwl_mld_rx_phy_data *phy_data, nsts = le32_get_bits(phy_data->ntfy->sigs.he_tb.tb_rx1, OFDM_UCODE_TRIG_BASE_RX_NSTS) + 1; - rx_status->nss = nsts >> !!(rate_n_flags & RATE_MCS_STBC_MSK); + + rx_status->nss = nsts; + if (rate_n_flags & RATE_MCS_STBC_MSK) + rx_status->nss = 1; } static void @@ -589,7 +592,9 @@ iwl_mld_decode_he_phy_data(struct iwl_mld_rx_phy_data *phy_data, break; } - rx_status->nss = nsts >> !!(rate_n_flags & RATE_MCS_STBC_MSK); + rx_status->nss = nsts; + if (rate_n_flags & RATE_MCS_STBC_MSK) + rx_status->nss = 1; he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN | IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN); -- 2.34.1