OSDN Git Service

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 b4f7ea3..11c25f3 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 786e93f..07ddd7b 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);