aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-08-26 02:10:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-29 15:25:31 -0400
commitcefeaa5fa0be02cd51968975fec9cfaf7973bb3a (patch)
tree64e687e4008687ea201bd024cce3c07595985300 /drivers/net/wireless/iwlwifi
parentd618912417fbce4f6514fe1cbef7df2e73bdb6c2 (diff)
iwlagn: cmd_queue moves to iwl_shared
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-prph.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.c8
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 048ccbae82f0..6db90854048d 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)
1103 1103
1104 /* waiting for all the tx frames complete might take a while */ 1104 /* waiting for all the tx frames complete might take a while */
1105 for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) { 1105 for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) {
1106 if (cnt == priv->cmd_queue) 1106 if (cnt == priv->shrd->cmd_queue)
1107 continue; 1107 continue;
1108 txq = &priv->txq[cnt]; 1108 txq = &priv->txq[cnt];
1109 q = &txq->q; 1109 q = &txq->q;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e8177fb7ae2c..e61c68958b8c 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)
1244 1244
1245 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { 1245 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) {
1246 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; 1246 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
1247 priv->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM; 1247 priv->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
1248 } else { 1248 } else {
1249 priv->sta_key_max_num = STA_KEY_MAX_NUM; 1249 priv->sta_key_max_num = STA_KEY_MAX_NUM;
1250 priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; 1250 priv->shrd->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
1251 } 1251 }
1252 1252
1253 /* 1253 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 2aeafa18579f..02b70dcb93c3 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)
1818 return; 1818 return;
1819 1819
1820 /* monitor and check for stuck cmd queue */ 1820 /* monitor and check for stuck cmd queue */
1821 if (iwl_check_stuck_queue(priv, priv->cmd_queue)) 1821 if (iwl_check_stuck_queue(priv, priv->shrd->cmd_queue))
1822 return; 1822 return;
1823 1823
1824 /* monitor and check for other stuck queues */ 1824 /* monitor and check for other stuck queues */
1825 if (iwl_is_any_associated(priv)) { 1825 if (iwl_is_any_associated(priv)) {
1826 for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) { 1826 for (cnt = 0; cnt < hw_params(priv).max_txq_num; cnt++) {
1827 /* skip as we already checked the command queue */ 1827 /* skip as we already checked the command queue */
1828 if (cnt == priv->cmd_queue) 1828 if (cnt == priv->shrd->cmd_queue)
1829 continue; 1829 continue;
1830 if (iwl_check_stuck_queue(priv, cnt)) 1830 if (iwl_check_stuck_queue(priv, cnt))
1831 return; 1831 return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 57445c22fcbc..19a0ea9f5045 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1237,9 +1237,6 @@ struct iwl_priv {
1237 /* microcode/device supports multiple contexts */ 1237 /* microcode/device supports multiple contexts */
1238 u8 valid_contexts; 1238 u8 valid_contexts;
1239 1239
1240 /* command queue number */
1241 u8 cmd_queue;
1242
1243 /* max number of station keys */ 1240 /* max number of station keys */
1244 u8 sta_key_max_num; 1241 u8 sta_key_max_num;
1245 1242
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 40f6dd4decff..bebdd828f324 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -218,7 +218,7 @@
218 218
219#define SCD_QUEUECHAIN_SEL_ALL(priv) \ 219#define SCD_QUEUECHAIN_SEL_ALL(priv) \
220 (((1<<hw_params(priv).max_txq_num) - 1) &\ 220 (((1<<hw_params(priv).max_txq_num) - 1) &\
221 (~(1<<(priv)->cmd_queue))) 221 (~(1<<(priv)->shrd->cmd_queue)))
222 222
223#define SCD_BASE (PRPH_BASE + 0xa02c00) 223#define SCD_BASE (PRPH_BASE + 0xa02c00)
224 224
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 483785c3fb04..05621746825a 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 {
143 * 143 *
144 * @dbg_level_dev: dbg level set per device. Prevails on 144 * @dbg_level_dev: dbg level set per device. Prevails on
145 * iwlagn_mod_params.debug_level if set (!= 0) 145 * iwlagn_mod_params.debug_level if set (!= 0)
146 * @cmd_queue: command queue number
146 * @bus: pointer to the bus layer data 147 * @bus: pointer to the bus layer data
147 * @priv: pointer to the upper layer data 148 * @priv: pointer to the upper layer data
148 * @hw_params: see struct iwl_hw_params 149 * @hw_params: see struct iwl_hw_params
@@ -152,6 +153,8 @@ struct iwl_shared {
152 u32 dbg_level_dev; 153 u32 dbg_level_dev;
153#endif /* CONFIG_IWLWIFI_DEBUG */ 154#endif /* CONFIG_IWLWIFI_DEBUG */
154 155
156 u8 cmd_queue;
157
155 struct iwl_bus *bus; 158 struct iwl_bus *bus;
156 struct iwl_priv *priv; 159 struct iwl_priv *priv;
157 struct iwl_hw_params hw_params; 160 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 a6b2b1db0b1d..b751f52905c0 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,
349 349
350 WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX); 350 WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX);
351 351
352 if (txq_id != priv->cmd_queue) 352 if (txq_id != priv->shrd->cmd_queue)
353 sta_id = txq->cmd[read_ptr]->cmd.tx.sta_id; 353 sta_id = txq->cmd[read_ptr]->cmd.tx.sta_id;
354 354
355 bc_ent = cpu_to_le16(1 | (sta_id << 12)); 355 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,
526 */ 526 */
527static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) 527static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
528{ 528{
529 struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue]; 529 struct iwl_tx_queue *txq = &priv->txq[priv->shrd->cmd_queue];
530 struct iwl_queue *q = &txq->q; 530 struct iwl_queue *q = &txq->q;
531 struct iwl_device_cmd *out_cmd; 531 struct iwl_device_cmd *out_cmd;
532 struct iwl_cmd_meta *out_meta; 532 struct iwl_cmd_meta *out_meta;
@@ -618,8 +618,9 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
618 618
619 out_cmd->hdr.cmd = cmd->id; 619 out_cmd->hdr.cmd = cmd->id;
620 out_cmd->hdr.flags = 0; 620 out_cmd->hdr.flags = 0;
621 out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(priv->cmd_queue) | 621 out_cmd->hdr.sequence =
622 INDEX_TO_SEQ(q->write_ptr)); 622 cpu_to_le16(QUEUE_TO_SEQ(priv->shrd->cmd_queue) |
623 INDEX_TO_SEQ(q->write_ptr));
623 624
624 /* and copy the data that needs to be copied */ 625 /* and copy the data that needs to be copied */
625 626
@@ -638,7 +639,7 @@ static int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
638 get_cmd_string(out_cmd->hdr.cmd), 639 get_cmd_string(out_cmd->hdr.cmd),
639 out_cmd->hdr.cmd, 640 out_cmd->hdr.cmd,
640 le16_to_cpu(out_cmd->hdr.sequence), cmd_size, 641 le16_to_cpu(out_cmd->hdr.sequence), cmd_size,
641 q->write_ptr, idx, priv->cmd_queue); 642 q->write_ptr, idx, priv->shrd->cmd_queue);
642 643
643 phys_addr = dma_map_single(priv->bus->dev, &out_cmd->hdr, copy_size, 644 phys_addr = dma_map_single(priv->bus->dev, &out_cmd->hdr, copy_size,
644 DMA_BIDIRECTIONAL); 645 DMA_BIDIRECTIONAL);
@@ -752,17 +753,17 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
752 int cmd_index; 753 int cmd_index;
753 struct iwl_device_cmd *cmd; 754 struct iwl_device_cmd *cmd;
754 struct iwl_cmd_meta *meta; 755 struct iwl_cmd_meta *meta;
755 struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue]; 756 struct iwl_tx_queue *txq = &priv->txq[priv->shrd->cmd_queue];
756 unsigned long flags; 757 unsigned long flags;
757 758
758 /* If a Tx command is being handled and it isn't in the actual 759 /* If a Tx command is being handled and it isn't in the actual
759 * command queue then there a command routing bug has been introduced 760 * command queue then there a command routing bug has been introduced
760 * in the queue management code. */ 761 * in the queue management code. */
761 if (WARN(txq_id != priv->cmd_queue, 762 if (WARN(txq_id != priv->shrd->cmd_queue,
762 "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n", 763 "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n",
763 txq_id, priv->cmd_queue, sequence, 764 txq_id, priv->shrd->cmd_queue, sequence,
764 priv->txq[priv->cmd_queue].q.read_ptr, 765 priv->txq[priv->shrd->cmd_queue].q.read_ptr,
765 priv->txq[priv->cmd_queue].q.write_ptr)) { 766 priv->txq[priv->shrd->cmd_queue].q.write_ptr)) {
766 iwl_print_hex_error(priv, pkt, 32); 767 iwl_print_hex_error(priv, pkt, 32);
767 return; 768 return;
768 } 769 }
@@ -1002,7 +1003,7 @@ cancel:
1002 * in later, it will possibly set an invalid 1003 * in later, it will possibly set an invalid
1003 * address (cmd->meta.source). 1004 * address (cmd->meta.source).
1004 */ 1005 */
1005 priv->txq[priv->cmd_queue].meta[cmd_idx].flags &= 1006 priv->txq[priv->shrd->cmd_queue].meta[cmd_idx].flags &=
1006 ~CMD_WANT_SKB; 1007 ~CMD_WANT_SKB;
1007 } 1008 }
1008fail: 1009fail:
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index 92128383cae7..7a689df99496 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,
311 /* Alloc driver data array and TFD circular buffer */ 311 /* Alloc driver data array and TFD circular buffer */
312 /* Driver private data, only for Tx (not command) queues, 312 /* Driver private data, only for Tx (not command) queues,
313 * not shared with device. */ 313 * not shared with device. */
314 if (txq_id != priv->cmd_queue) { 314 if (txq_id != priv->shrd->cmd_queue) {
315 txq->txb = kzalloc(sizeof(txq->txb[0]) * 315 txq->txb = kzalloc(sizeof(txq->txb[0]) *
316 TFD_QUEUE_SIZE_MAX, GFP_KERNEL); 316 TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
317 if (!txq->txb) { 317 if (!txq->txb) {
@@ -515,7 +515,7 @@ static int iwl_trans_tx_alloc(struct iwl_priv *priv)
515 515
516 /* Alloc and init all Tx queues, including the command queue (#4/#9) */ 516 /* Alloc and init all Tx queues, including the command queue (#4/#9) */
517 for (txq_id = 0; txq_id < hw_params(priv).max_txq_num; txq_id++) { 517 for (txq_id = 0; txq_id < hw_params(priv).max_txq_num; txq_id++) {
518 slots_num = (txq_id == priv->cmd_queue) ? 518 slots_num = (txq_id == priv->shrd->cmd_queue) ?
519 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; 519 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
520 ret = iwl_trans_txq_alloc(priv, &priv->txq[txq_id], slots_num, 520 ret = iwl_trans_txq_alloc(priv, &priv->txq[txq_id], slots_num,
521 txq_id); 521 txq_id);
@@ -558,7 +558,7 @@ static int iwl_tx_init(struct iwl_priv *priv)
558 558
559 /* Alloc and init all Tx queues, including the command queue (#4/#9) */ 559 /* Alloc and init all Tx queues, including the command queue (#4/#9) */
560 for (txq_id = 0; txq_id < hw_params(priv).max_txq_num; txq_id++) { 560 for (txq_id = 0; txq_id < hw_params(priv).max_txq_num; txq_id++) {
561 slots_num = (txq_id == priv->cmd_queue) ? 561 slots_num = (txq_id == priv->shrd->cmd_queue) ?
562 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; 562 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
563 ret = iwl_trans_txq_init(priv, &priv->txq[txq_id], slots_num, 563 ret = iwl_trans_txq_init(priv, &priv->txq[txq_id], slots_num,
564 txq_id); 564 txq_id);
@@ -841,7 +841,7 @@ static void iwl_trans_tx_start(struct iwl_priv *priv)
841 else 841 else
842 queue_to_fifo = iwlagn_default_queue_to_tx_fifo; 842 queue_to_fifo = iwlagn_default_queue_to_tx_fifo;
843 843
844 iwl_trans_set_wr_ptrs(priv, priv->cmd_queue, 0); 844 iwl_trans_set_wr_ptrs(priv, priv->shrd->cmd_queue, 0);
845 845
846 /* make sure all queue are not stopped */ 846 /* make sure all queue are not stopped */
847 memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped)); 847 memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped));