iwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vec
authorShaul Triebitz <shaul.triebitz@intel.com>
Wed, 24 Oct 2018 15:37:46 +0000 (18:37 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 29 Jan 2019 14:10:29 +0000 (16:10 +0200)
Take the NSS value from 'rx_vec' rather than from 'rate_n_flags'.
The rate_n_flags has only 2 bits for the NSS giving a max of 4SS
(0 = 1SS etc.). Since there may be up to 8SS use the rx_vec which
has 3 bits for the NSS.
While at it, fix the rx_vec array to length of 2.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index b4f7ea30a7c14e71bcb53575f3fe64063804c8d2..11c25f32a286b84782cd167d7cde2d8625e4cedc 100644 (file)
@@ -719,6 +719,9 @@ struct iwl_rx_mpdu_desc {
 #define RX_NO_DATA_FRAME_TIME_POS      0
 #define RX_NO_DATA_FRAME_TIME_MSK      (0xfffff << RX_NO_DATA_FRAME_TIME_POS)
 
+#define RX_NO_DATA_RX_VEC0_HE_NSTS_MSK 0x03800000
+#define RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK        0x38000000
+
 /**
  * struct iwl_rx_no_data - RX no data descriptor
  * @info: 7:0 frame type, 15:8 RX error type
@@ -739,7 +742,7 @@ struct iwl_rx_no_data {
        __le32 fr_time;
        __le32 rate;
        __le32 phy_info[2];
-       __le32 rx_vec[3];
+       __le32 rx_vec[2];
 } __packed; /* RX_NO_DATA_NTFY_API_S_VER_1 */
 
 /**
index 786e93f6b5025f914648a6697413a490751fb6a0..07ddd7bc07ce796b8792dd7c1580822a0ce01005 100644 (file)
@@ -1701,15 +1701,24 @@ void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi,
        } else if (rate_n_flags & RATE_MCS_VHT_MSK) {
                u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >>
                                RATE_MCS_STBC_POS;
-               rx_status->nss =
-                       ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >>
-                                               RATE_VHT_MCS_NSS_POS) + 1;
                rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK;
                rx_status->encoding = RX_ENC_VHT;
                rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
                if (rate_n_flags & RATE_MCS_BF_MSK)
                        rx_status->enc_flags |= RX_ENC_FLAG_BF;
-       } else if (!(rate_n_flags & RATE_MCS_HE_MSK)) {
+               /*
+                * take the nss from the rx_vec since the rate_n_flags has
+                * only 2 bits for the nss which gives a max of 4 ss but
+                * there may be up to 8 spatial streams
+                */
+               rx_status->nss =
+                       le32_get_bits(desc->rx_vec[0],
+                                     RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK) + 1;
+       } else if (rate_n_flags & RATE_MCS_HE_MSK) {
+               rx_status->nss =
+                       le32_get_bits(desc->rx_vec[0],
+                                     RX_NO_DATA_RX_VEC0_HE_NSTS_MSK) + 1;
+       } else {
                int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags,
                                                               rx_status->band);