linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@kernel.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 06/12] iwlwifi: pcie: Adapt rx queue write pointer for Bz family
Date: Fri,  4 Feb 2022 12:25:05 +0200	[thread overview]
Message-ID: <iwlwifi.20220204122220.57bd62a4365c.I873aa9b3d13abf5633a4963c55c3a09a833254f0@changeid> (raw)
In-Reply-To: <20220204102511.606112-1-luca@coelho.fi>

From: Matti Gottlieb <matti.gottlieb@intel.com>

Adapt rx queue write pointer for Bz family.
The register has moved to the same one as Tx.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 3 +++
 drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
index f90d4662c164..c0a18e820b51 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
@@ -533,6 +533,9 @@ enum {
  * 11-8:  queue selector
  */
 #define HBUS_TARG_WRPTR         (HBUS_BASE+0x060)
+/* This register is common for Tx and Rx, Rx queues start from 512 */
+#define HBUS_TARG_WRPTR_Q_SHIFT (16)
+#define HBUS_TARG_WRPTR_RX_Q(q) (((q) + 512) << HBUS_TARG_WRPTR_Q_SHIFT)
 
 /**********************************************************
  * CSR values
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index 331c1a059183..71db571a42e0 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -190,11 +190,14 @@ static void iwl_pcie_rxq_inc_wr_ptr(struct iwl_trans *trans,
 	}
 
 	rxq->write_actual = round_down(rxq->write, 8);
-	if (trans->trans_cfg->mq_rx_supported)
+	if (!trans->trans_cfg->mq_rx_supported)
+		iwl_write32(trans, FH_RSCSR_CHNL0_WPTR, rxq->write_actual);
+	else if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
+		iwl_write32(trans, HBUS_TARG_WRPTR, rxq->write_actual |
+			    HBUS_TARG_WRPTR_RX_Q(rxq->id));
+	else
 		iwl_write32(trans, RFH_Q_FRBDCB_WIDX_TRG(rxq->id),
 			    rxq->write_actual);
-	else
-		iwl_write32(trans, FH_RSCSR_CHNL0_WPTR, rxq->write_actual);
 }
 
 static void iwl_pcie_rxq_check_wrptr(struct iwl_trans *trans)
-- 
2.34.1


  parent reply	other threads:[~2022-02-04 10:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 10:24 [PATCH 00/12] iwlwifi: updates intended for v5.18 2022-02-04 Luca Coelho
2022-02-04 10:25 ` [PATCH 01/12] iwlwifi: mvm: Correctly set fragmented EBS Luca Coelho
2022-02-04 10:25 ` [PATCH 02/12] iwlwifi: yoyo: Avoid using dram data if allocation failed Luca Coelho
2022-02-04 10:25 ` [PATCH 03/12] iwlwifi: scan: Modify return value of a function Luca Coelho
2022-02-04 10:25 ` [PATCH 04/12] iwlwifi: mvm: Passively scan non PSC channels only when requested so Luca Coelho
2022-03-25 17:11   ` Ben Greear
2022-04-04 19:02     ` Peer, Ilan
2022-04-05 19:05       ` Ben Greear
2022-04-06  6:22         ` Peer, Ilan
2022-02-04 10:25 ` [PATCH 05/12] iwlwifi: pcie: adjust to Bz completion descriptor Luca Coelho
2022-02-04 10:25 ` Luca Coelho [this message]
2022-02-04 10:25 ` [PATCH 07/12] iwlwifi: drv: load tlv debug data earlier Luca Coelho
2022-02-04 10:25 ` [PATCH 08/12] iwlwifi: eeprom: clean up macros Luca Coelho
2022-02-04 10:25 ` [PATCH 09/12] iwlwifi: remove unused macros Luca Coelho
2022-02-04 10:25 ` [PATCH 10/12] iwlwifi: debugfs: remove useless double condition Luca Coelho
2022-02-04 10:25 ` [PATCH 11/12] iwlwifi: mei: use C99 initializer for device IDs Luca Coelho
2022-02-04 10:25 ` [PATCH 12/12] iwlwifi: mvm: Unify the scan iteration functions 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=iwlwifi.20220204122220.57bd62a4365c.I873aa9b3d13abf5633a4963c55c3a09a833254f0@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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).