linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Shaul Triebitz <shaul.triebitz@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 03/17] iwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vec
Date: Fri, 25 Jan 2019 22:12:51 +0200	[thread overview]
Message-ID: <20190125201305.5616-4-luca@coelho.fi> (raw)
In-Reply-To: <20190125201305.5616-1-luca@coelho.fi>

From: Shaul Triebitz <shaul.triebitz@intel.com>

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 |  5 ++++-
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c  | 17 +++++++++++++----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
index b4f7ea30a7c1..11c25f32a286 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
@@ -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 */
 
 /**
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 786e93f6b502..07ddd7bc07ce 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -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);
 
-- 
2.20.1


  parent reply	other threads:[~2019-01-25 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 20:12 [PATCH 00/17] iwlwifi: updates intended for v5.1 2019-01-25 Luca Coelho
2019-01-25 20:12 ` [PATCH 01/17] iwlwifi: pcie: fix the use of a wrong define Luca Coelho
2019-01-25 20:12 ` [PATCH 02/17] iwlwifi: iwlmvm: ignore HE PPDU type regarding EOF Luca Coelho
2019-01-25 20:12 ` Luca Coelho [this message]
2019-01-25 20:12 ` [PATCH 04/17] iwlwifi: pcie: add prints to track virtual ID Luca Coelho
2019-01-25 20:12 ` [PATCH 05/17] iwlwifi: mvm: fix %16 to %016 print format Luca Coelho
2019-01-25 20:12 ` [PATCH 06/17] iwlwifi: mvm: read IWL_RX_MPDU_PHY_SHORT_PREAMBLE only for CCK Luca Coelho
2019-01-25 20:12 ` [PATCH 07/17] iwlwifi: pcie: align licensing to dual GPL/BSD Luca Coelho
2019-01-25 20:12 ` [PATCH 08/17] iwlwifi: mvm: clean up LDBG config command usage Luca Coelho
2019-01-25 20:12 ` [PATCH 09/17] iwlwifi: mvm: save and export regdb blob from the NVM Luca Coelho
2019-01-25 20:12 ` [PATCH 10/17] iwlwifi: make iwl_fw_dbg_start_stop_hcmd() inline Luca Coelho
2019-01-25 20:12 ` [PATCH 11/17] iwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.h Luca Coelho
2019-01-25 20:13 ` [PATCH 12/17] iwlwifi: mvm: pre-initialize alive_data in wait_alive() Luca Coelho
2019-01-25 20:13 ` [PATCH 13/17] iwlwifi: calculate pointers from out_cmd instead of out_cmd->hdr Luca Coelho
2019-01-25 20:13 ` [PATCH 14/17] iwlwifi: make sure cur_fw_img is valid before accessing img Luca Coelho
2019-01-25 20:13 ` [PATCH 15/17] iwlwifi: mvm: remove sta key on wep ap Luca Coelho
2019-01-25 20:13 ` [PATCH 16/17] iwlwifi: monitor dumping flow cleanup Luca Coelho
2019-01-25 20:13 ` [PATCH 17/17] iwlwifi: mvm: add an option to dereference vif by id Luca Coelho
2019-01-28  9:00   ` Kalle Valo
2019-01-28  9:04     ` Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190125201305.5616-4-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=shaul.triebitz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).