All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 08/60] iwlagn: cmd_queue moves to iwl_shared
Date: Thu, 25 Aug 2011 23:10:40 -0700	[thread overview]
Message-ID: <1314339092-20797-9-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1314339092-20797-1-git-send-email-wey-yi.w.guy@intel.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c       |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c           |    4 +-
 drivers/net/wireless/iwlwifi/iwl-core.c          |    4 +-
 drivers/net/wireless/iwlwifi/iwl-dev.h           |    3 --
 drivers/net/wireless/iwlwifi/iwl-prph.h          |    2 +-
 drivers/net/wireless/iwlwifi/iwl-shared.h        |    3 ++
 drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c |   23 +++++++++++----------
 drivers/net/wireless/iwlwifi/iwl-trans.c         |    8 +++---
 8 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 048ccba..6db9085 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1103,7 +1103,7 @@ int iwlagn_wait_tx_queue_empty(struct iwl_priv *priv)
 
 	/* waiting for all the tx frames complete might take a while */
 	for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) {
-		if (cnt == priv->cmd_queue)
+		if (cnt == priv->shrd->cmd_queue)
 			continue;
 		txq = &priv->txq[cnt];
 		q = &txq->q;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e8177fb..e61c689 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1244,10 +1244,10 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
 
 	if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) {
 		priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
-		priv->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
+		priv->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
 	} else {
 		priv->sta_key_max_num = STA_KEY_MAX_NUM;
-		priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
+		priv->shrd->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
 	}
 
 	/*
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 2aeafa1..02b70dc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1818,14 +1818,14 @@ void iwl_bg_watchdog(unsigned long data)
 		return;
 
 	/* monitor and check for stuck cmd queue */
-	if (iwl_check_stuck_queue(priv, priv->cmd_queue))
+	if (iwl_check_stuck_queue(priv, priv->shrd->cmd_queue))
 		return;
 
 	/* monitor and check for other stuck queues */
 	if (iwl_is_any_associated(priv)) {
 		for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) {
 			/* skip as we already checked the command queue */
-			if (cnt == priv->cmd_queue)
+			if (cnt == priv->shrd->cmd_queue)
 				continue;
 			if (iwl_check_stuck_queue(priv, cnt))
 				return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 57445c2..19a0ea9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1237,9 +1237,6 @@ struct iwl_priv {
 	/* microcode/device supports multiple contexts */
 	u8 valid_contexts;
 
-	/* command queue number */
-	u8 cmd_queue;
-
 	/* max number of station keys */
 	u8 sta_key_max_num;
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 40f6dd4..bebdd82 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -218,7 +218,7 @@
 
 #define SCD_QUEUECHAIN_SEL_ALL(priv)	\
 	(((1<<hw_params(priv).max_txq_num) - 1) &\
-	(~(1<<(priv)->cmd_queue)))
+	(~(1<<(priv)->shrd->cmd_queue)))
 
 #define SCD_BASE			(PRPH_BASE + 0xa02c00)
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 483785c..0562174 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -143,6 +143,7 @@ struct iwl_hw_params {
  *
  * @dbg_level_dev: dbg level set per device. Prevails on
  *	iwlagn_mod_params.debug_level if set (!= 0)
+ * @cmd_queue: command queue number
  * @bus: pointer to the bus layer data
  * @priv: pointer to the upper layer data
  * @hw_params: see struct iwl_hw_params
@@ -152,6 +153,8 @@ struct iwl_shared {
 	u32 dbg_level_dev;
 #endif /* CONFIG_IWLWIFI_DEBUG */
 
+	u8 cmd_queue;
+
 	struct iwl_bus *bus;
 	struct iwl_priv *priv;
 	struct iwl_hw_params hw_params;
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
index a6b2b1d..b751f52 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
@@ -349,7 +349,7 @@ void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
 
 	WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX);
 
-	if (txq_id != priv->cmd_queue)
+	if (txq_id != priv->shrd->cmd_queue)
 		sta_id = txq->cmd[read_ptr]->cmd.tx.sta_id;
 
 	bc_ent = cpu_to_le16(1 | (sta_id << 12));
@@ -526,7 +526,7 @@ int iwl_trans_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
  */
 static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 {
-	struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue];
+	struct iwl_tx_queue *txq = &priv->txq[priv->shrd->cmd_queue];
 	struct iwl_queue *q = &txq->q;
 	struct iwl_device_cmd *out_cmd;
 	struct iwl_cmd_meta *out_meta;
@@ -618,8 +618,9 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 
 	out_cmd->hdr.cmd = cmd->id;
 	out_cmd->hdr.flags = 0;
-	out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(priv->cmd_queue) |
-					    INDEX_TO_SEQ(q->write_ptr));
+	out_cmd->hdr.sequence =
+		cpu_to_le16(QUEUE_TO_SEQ(priv->shrd->cmd_queue) |
+					 INDEX_TO_SEQ(q->write_ptr));
 
 	/* and copy the data that needs to be copied */
 
@@ -638,7 +639,7 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 			get_cmd_string(out_cmd->hdr.cmd),
 			out_cmd->hdr.cmd,
 			le16_to_cpu(out_cmd->hdr.sequence), cmd_size,
-			q->write_ptr, idx, priv->cmd_queue);
+			q->write_ptr, idx, priv->shrd->cmd_queue);
 
 	phys_addr = dma_map_single(priv->bus->dev, &out_cmd->hdr, copy_size,
 				DMA_BIDIRECTIONAL);
@@ -752,17 +753,17 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
 	int cmd_index;
 	struct iwl_device_cmd *cmd;
 	struct iwl_cmd_meta *meta;
-	struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue];
+	struct iwl_tx_queue *txq = &priv->txq[priv->shrd->cmd_queue];
 	unsigned long flags;
 
 	/* If a Tx command is being handled and it isn't in the actual
 	 * command queue then there a command routing bug has been introduced
 	 * in the queue management code. */
-	if (WARN(txq_id != priv->cmd_queue,
+	if (WARN(txq_id != priv->shrd->cmd_queue,
 		 "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n",
-		  txq_id, priv->cmd_queue, sequence,
-		  priv->txq[priv->cmd_queue].q.read_ptr,
-		  priv->txq[priv->cmd_queue].q.write_ptr)) {
+		  txq_id, priv->shrd->cmd_queue, sequence,
+		  priv->txq[priv->shrd->cmd_queue].q.read_ptr,
+		  priv->txq[priv->shrd->cmd_queue].q.write_ptr)) {
 		iwl_print_hex_error(priv, pkt, 32);
 		return;
 	}
@@ -1002,7 +1003,7 @@ cancel:
 		 * in later, it will possibly set an invalid
 		 * address (cmd->meta.source).
 		 */
-		priv->txq[priv->cmd_queue].meta[cmd_idx].flags &=
+		priv->txq[priv->shrd->cmd_queue].meta[cmd_idx].flags &=
 							~CMD_WANT_SKB;
 	}
 fail:
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index 9212838..7a689df 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.c
@@ -311,7 +311,7 @@ static int iwl_trans_txq_alloc(struct iwl_priv *priv, struct iwl_tx_queue *txq,
 	/* Alloc driver data array and TFD circular buffer */
 	/* Driver private data, only for Tx (not command) queues,
 	 * not shared with device. */
-	if (txq_id != priv->cmd_queue) {
+	if (txq_id != priv->shrd->cmd_queue) {
 		txq->txb = kzalloc(sizeof(txq->txb[0]) *
 				   TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
 		if (!txq->txb) {
@@ -515,7 +515,7 @@ static int iwl_trans_tx_alloc(struct iwl_priv *priv)
 
 	/* Alloc and init all Tx queues, including the command queue (#4/#9) */
 	for (txq_id = 0; txq_id < hw_params(priv).max_txq_num; txq_id++) {
-		slots_num = (txq_id == priv->cmd_queue) ?
+		slots_num = (txq_id == priv->shrd->cmd_queue) ?
 					TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
 		ret = iwl_trans_txq_alloc(priv, &priv->txq[txq_id], slots_num,
 				       txq_id);
@@ -558,7 +558,7 @@ static int iwl_tx_init(struct iwl_priv *priv)
 
 	/* Alloc and init all Tx queues, including the command queue (#4/#9) */
 	for (txq_id = 0; txq_id < hw_params(priv).max_txq_num; txq_id++) {
-		slots_num = (txq_id == priv->cmd_queue) ?
+		slots_num = (txq_id == priv->shrd->cmd_queue) ?
 					TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
 		ret = iwl_trans_txq_init(priv, &priv->txq[txq_id], slots_num,
 				       txq_id);
@@ -841,7 +841,7 @@ static void iwl_trans_tx_start(struct iwl_priv *priv)
 	else
 		queue_to_fifo = iwlagn_default_queue_to_tx_fifo;
 
-	iwl_trans_set_wr_ptrs(priv, priv->cmd_queue, 0);
+	iwl_trans_set_wr_ptrs(priv, priv->shrd->cmd_queue, 0);
 
 	/* make sure all queue are not stopped */
 	memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped));
-- 
1.7.0.4


  parent reply	other threads:[~2011-08-26  6:53 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  6:10 [RESEND PATCH 00/60] update for 3.2 Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 01/60] iwlagn: Rename iwlcore prefix Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 02/60] iwlagn: remove out-dated comments Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 03/60] iwlagn: use iwl_get_debug_level instead of iwl_debug_level Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 04/60] iwlagn: introduce iwl-shared.h Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 05/60] iwlagn: introduce struct iwl-shared - known by all layers Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 06/60] iwlagn: debug_level moves to struct iwl_shared Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 07/60] iwlagn: hw_params moves to iwl_shared Wey-Yi Guy
2011-08-26  6:10 ` Wey-Yi Guy [this message]
2011-08-26  6:10 ` [PATCH 09/60] iwlagn: workqueue " Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 10/60] iwlagn: priv->status " Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 11/60] iwlagn: priv->lock " Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 12/60] iwlagn: priv->mutex " Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 13/60] iwlagn: modify the debug macro to be usable by all the layers Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 14/60] iwlagn: add IWL_DEBUG_FW_ERRORS Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 15/60] iwlagn: priv->sta_lock moves to iwl_shared Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 16/60] iwlagn: bus layer chooses its transport layer Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 17/60] iwlagn: add comments to iwl_bus / iwl_trans Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 18/60] iwlagn: transport handler can register debugfs entries Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 19/60] iwlagn: iwl_rx_queue moves to the iwl_trans_pcie Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 20/60] iwlagn: move iwl_suspend / iwl_resume to the transport layer Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 21/60] iwlagn: move ISR related data to " Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 22/60] iwlagn: move the NIC error flow to the " Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 23/60] iwlagn: enable 11n aggregation without checking traffic load Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 24/60] iwlagn: support small form factor SKU of 6205 Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 25/60] iwlagn: more comments for bt channel inhibition Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 26/60] iwlagn: add comments to module parameters Wey-Yi Guy
2011-08-26  6:10 ` [PATCH 27/60] iwlagn: move isr_statistics to transport layer Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 28/60] iwlagn: reclaim the packets in " Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 29/60] iwlagn: move reclaim related functions Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 30/60] iwlagn: move scd_bc_tbls and scd_base_addr to iwl_trans_pcie Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 31/60] iwlagn: fix the check of IWLAGN_FIRST_AMPDU_QUEUE Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 33/60] iwlagn: move iwl_free_pages to iwl-shared.h Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 34/60] iwlagn: transport layer should receive iwl_trans Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 35/60] iwlagn: move hcmd_lock to transport layer Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 36/60] iwlagn: move dump_csr and dump_fh " Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 37/60] iwlagn: remove references to priv from the " Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 38/60] iwlagn: remove unused parameters from hw_params Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 39/60] iwlagn: iwl-dev.h doesn't include iwl-fh.h any more Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 40/60] iwlagn: move Keep Warm to transport layer Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 41/60] iwlagn: add missing includes Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 42/60] iwlagn: all function iwl-io.c receive iwl_bus Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 43/60] iwlagn: fix compile warnings when CONFIG_PM_SLEEP is not set Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 44/60] iwlagn: iwl-pci doesn't include iwl-dev any more Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 45/60] iwlagn: adding special "D" SKU for 2000 series Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 46/60] iwlagn: iwl_tid_data moves to iwl-shared Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 47/60] iwlagn: remove dereferences of priv from transport Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 48/60] iwlagn: stop the device before freeing it Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 49/60] iwlagn: upper layer stores iwl_rxon_context in skb's CB Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 50/60] iwlagn: set tx_fifo for ampdu in transport layer Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 51/60] iwlagn: upper layer uses slabs to allocate tx cmds Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 52/60] iwlagn: move the mapping ac to queue / fifo to transport Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 53/60] iwlagn: allocate resources for TX BA session in transport Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 54/60] iwlagn: move the check_empty logic to the transport layer Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 55/60] iwlagn: move the disable agg logic to " Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 56/60] iwlagn: cosmetics in iwl-trans.h Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 57/60] iwlagn: move wait_for_tx_queue_empty to transport layer Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 58/60] iwlagn: move check_stuck_queue " Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 59/60] iwlagn: move the stop / wake queue logic " Wey-Yi Guy
2011-08-26  6:11 ` [PATCH 60/60] iwlagn: move tx queues " Wey-Yi Guy
  -- strict thread matches above, loose matches on Subject: below --
2011-08-13 17:37 [PATCH 00/60] update for 3.2 Wey-Yi Guy
2011-08-13 17:37 ` [PATCH 08/60] iwlagn: cmd_queue moves to iwl_shared Wey-Yi Guy

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=1314339092-20797-9-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.