Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Golan Ben Ami <golan.ben.ami@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH v2 16/17] iwlwifi: pcie: allow using tx init for other queues but the command queue
Date: Tue, 21 Aug 2018 08:09:51 +0300	[thread overview]
Message-ID: <20180821050952.31603-17-luca@coelho.fi> (raw)
In-Reply-To: <20180821050952.31603-1-luca@coelho.fi>

From: Golan Ben Ami <golan.ben.ami@intel.com>

We would like to allow using tx init code for other queues but
the command queue - for newer devices.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../wireless/intel/iwlwifi/pcie/internal.h    |  3 ++-
 .../wireless/intel/iwlwifi/pcie/trans-gen2.c  |  2 +-
 .../net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 23 ++++++++++---------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
index 0127386de6c6..da6d367de76e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
@@ -640,7 +640,8 @@ void iwl_pcie_disable_ict(struct iwl_trans *trans);
 * TX / HCMD
 ******************************************************/
 int iwl_pcie_tx_init(struct iwl_trans *trans);
-int iwl_pcie_gen2_tx_init(struct iwl_trans *trans);
+int iwl_pcie_gen2_tx_init(struct iwl_trans *trans, int txq_id,
+			  int queue_size);
 void iwl_pcie_tx_start(struct iwl_trans *trans, u32 scd_base_addr);
 int iwl_pcie_tx_stop(struct iwl_trans *trans);
 void iwl_pcie_tx_free(struct iwl_trans *trans);
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
index 2bc67219ed3e..3e5c732a89db 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
@@ -265,7 +265,7 @@ static int iwl_pcie_gen2_nic_init(struct iwl_trans *trans)
 		return -ENOMEM;
 
 	/* Allocate or reset and init all Tx and Command queues */
-	if (iwl_pcie_gen2_tx_init(trans))
+	if (iwl_pcie_gen2_tx_init(trans, trans_pcie->cmd_queue, TFD_CMD_SLOTS))
 		return -ENOMEM;
 
 	/* enable shadow regs in HW */
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
index b99f33ff9123..9ce7b2072613 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -1251,30 +1251,31 @@ void iwl_pcie_gen2_tx_free(struct iwl_trans *trans)
 	}
 }
 
-int iwl_pcie_gen2_tx_init(struct iwl_trans *trans)
+int iwl_pcie_gen2_tx_init(struct iwl_trans *trans, int txq_id, int queue_size)
 {
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
-	struct iwl_txq *cmd_queue;
-	int txq_id = trans_pcie->cmd_queue, ret;
+	struct iwl_txq *queue;
+	int ret;
 
-	/* alloc and init the command queue */
+	/* alloc and init the tx queue */
 	if (!trans_pcie->txq[txq_id]) {
-		cmd_queue = kzalloc(sizeof(*cmd_queue), GFP_KERNEL);
-		if (!cmd_queue) {
-			IWL_ERR(trans, "Not enough memory for command queue\n");
+		queue = kzalloc(sizeof(*queue), GFP_KERNEL);
+		if (!queue) {
+			IWL_ERR(trans, "Not enough memory for tx queue\n");
 			return -ENOMEM;
 		}
-		trans_pcie->txq[txq_id] = cmd_queue;
-		ret = iwl_pcie_txq_alloc(trans, cmd_queue, TFD_CMD_SLOTS, true);
+		trans_pcie->txq[txq_id] = queue;
+		ret = iwl_pcie_txq_alloc(trans, queue, queue_size, true);
 		if (ret) {
 			IWL_ERR(trans, "Tx %d queue init failed\n", txq_id);
 			goto error;
 		}
 	} else {
-		cmd_queue = trans_pcie->txq[txq_id];
+		queue = trans_pcie->txq[txq_id];
 	}
 
-	ret = iwl_pcie_txq_init(trans, cmd_queue, TFD_CMD_SLOTS, true);
+	ret = iwl_pcie_txq_init(trans, queue, queue_size,
+				(txq_id == trans_pcie->cmd_queue));
 	if (ret) {
 		IWL_ERR(trans, "Tx %d queue alloc failed\n", txq_id);
 		goto error;
-- 
2.18.0

  parent reply	other threads:[~2018-08-21  8:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21  5:09 [PATCH v2 00/17] iwlwifi: updates intended for v4.20 2018-08-18 Luca Coelho
2018-08-21  5:09 ` [PATCH v2 01/17] iwlwifi: turn timestamp marker cmd off by default Luca Coelho
2018-08-21  5:09 ` [PATCH v2 02/17] iwlwifi: remove unused TLC debugging commands Luca Coelho
2018-08-21  5:09 ` [PATCH v2 03/17] iwlwifi: runtime: avoid calling debugfs read functions more than once Luca Coelho
2018-08-21  5:09 ` [PATCH v2 04/17] iwlwifi: set the tid for non-QOS frames to zero Luca Coelho
2018-08-21  5:09 ` [PATCH v2 05/17] iwlwifi: add d3 debug data support Luca Coelho
2018-08-22 11:37   ` Kalle Valo
2018-08-22 11:40     ` Luca Coelho
2018-08-21  5:09 ` [PATCH v2 06/17] iwlwifi: mvm: remove duplicate if in iwl_mvm_setup_connection_keep() Luca Coelho
2018-08-21  5:09 ` [PATCH v2 07/17] iwlwifi: mvm: protect D0i3 code behind CONFIG_PM Luca Coelho
2018-08-21  5:09 ` [PATCH v2 08/17] iwlwifi: mvm: support new WoWLAN status FW API Luca Coelho
2018-08-21  5:09 ` [PATCH v2 09/17] iwlwifi: mvm: add NOA and CSA to a probe response Luca Coelho
2018-08-21  5:09 ` [PATCH v2 10/17] iwlwifi: add required include to iwl-fh.h Luca Coelho
2018-08-21  5:09 ` [PATCH v2 11/17] iwlwifi: mvm: add bss color to radiotap Luca Coelho
2018-08-21  5:09 ` [PATCH v2 12/17] iwlwifi: mvm: add support for RX_AMPDU_EOF bit for HE SU Luca Coelho
2018-08-21  5:09 ` [PATCH v2 13/17] iwlwifi: mvm: move he RX handling to a separate function Luca Coelho
2018-08-21  5:09 ` [PATCH v2 14/17] iwlwifi: enable reading the value of delay in timestamp_marker cmd Luca Coelho
2018-08-21  5:09 ` [PATCH v2 15/17] iwlwifi: drop packets with bad status in CD Luca Coelho
2018-08-21  5:09 ` Luca Coelho [this message]
2018-08-21  5:09 ` [PATCH v2 17/17] iwlwifi: pcie: make non-static hcmd and rx code 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=20180821050952.31603-17-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=golan.ben.ami@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@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