aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-23 04:46:33 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-27 11:27:29 -0400
commit13bb9483e190b95b04b22280ec9efa6b48469fd6 (patch)
treefdc39df48473db0ed02193eeb92d0e6a06a33ff8 /drivers/net/wireless/iwlwifi/iwl-tx.c
parent246ed355221076884d225f9d8a4c30a048be8162 (diff)
iwlwifi: prepare for PAN queue/fifo assignment
PAN ucode will require a different queue assignment, in particular queue 9 instead of 4 should be used for commands. This is required because the ucode will stop/start queues 4 and 8 depending on the PAN state, since queue 8 will be used for PAN multicast (after DTIM). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index c308dab14673..347d3dc6a015 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -134,7 +134,7 @@ EXPORT_SYMBOL(iwl_tx_queue_free);
134 */ 134 */
135void iwl_cmd_queue_free(struct iwl_priv *priv) 135void iwl_cmd_queue_free(struct iwl_priv *priv)
136{ 136{
137 struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM]; 137 struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue];
138 struct iwl_queue *q = &txq->q; 138 struct iwl_queue *q = &txq->q;
139 struct device *dev = &priv->pci_dev->dev; 139 struct device *dev = &priv->pci_dev->dev;
140 int i; 140 int i;
@@ -271,7 +271,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
271 271
272 /* Driver private data, only for Tx (not command) queues, 272 /* Driver private data, only for Tx (not command) queues,
273 * not shared with device. */ 273 * not shared with device. */
274 if (id != IWL_CMD_QUEUE_NUM) { 274 if (id != priv->cmd_queue) {
275 txq->txb = kzalloc(sizeof(txq->txb[0]) * 275 txq->txb = kzalloc(sizeof(txq->txb[0]) *
276 TFD_QUEUE_SIZE_MAX, GFP_KERNEL); 276 TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
277 if (!txq->txb) { 277 if (!txq->txb) {
@@ -314,13 +314,13 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
314 314
315 /* 315 /*
316 * Alloc buffer array for commands (Tx or other types of commands). 316 * Alloc buffer array for commands (Tx or other types of commands).
317 * For the command queue (#4), allocate command space + one big 317 * For the command queue (#4/#9), allocate command space + one big
318 * command for scan, since scan command is very huge; the system will 318 * command for scan, since scan command is very huge; the system will
319 * not have two scans at the same time, so only one is needed. 319 * not have two scans at the same time, so only one is needed.
320 * For normal Tx queues (all other queues), no super-size command 320 * For normal Tx queues (all other queues), no super-size command
321 * space is needed. 321 * space is needed.
322 */ 322 */
323 if (txq_id == IWL_CMD_QUEUE_NUM) 323 if (txq_id == priv->cmd_queue)
324 actual_slots++; 324 actual_slots++;
325 325
326 txq->meta = kzalloc(sizeof(struct iwl_cmd_meta) * actual_slots, 326 txq->meta = kzalloc(sizeof(struct iwl_cmd_meta) * actual_slots,
@@ -355,7 +355,7 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
355 * need an swq_id so don't set one to catch errors, all others can 355 * need an swq_id so don't set one to catch errors, all others can
356 * be set up to the identity mapping. 356 * be set up to the identity mapping.
357 */ 357 */
358 if (txq_id != IWL_CMD_QUEUE_NUM) 358 if (txq_id != priv->cmd_queue)
359 txq->swq_id = txq_id; 359 txq->swq_id = txq_id;
360 360
361 /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise 361 /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
@@ -385,7 +385,7 @@ void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
385{ 385{
386 int actual_slots = slots_num; 386 int actual_slots = slots_num;
387 387
388 if (txq_id == IWL_CMD_QUEUE_NUM) 388 if (txq_id == priv->cmd_queue)
389 actual_slots++; 389 actual_slots++;
390 390
391 memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots); 391 memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots);
@@ -413,7 +413,7 @@ EXPORT_SYMBOL(iwl_tx_queue_reset);
413 */ 413 */
414int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) 414int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
415{ 415{
416 struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM]; 416 struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue];
417 struct iwl_queue *q = &txq->q; 417 struct iwl_queue *q = &txq->q;
418 struct iwl_device_cmd *out_cmd; 418 struct iwl_device_cmd *out_cmd;
419 struct iwl_cmd_meta *out_meta; 419 struct iwl_cmd_meta *out_meta;
@@ -483,7 +483,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
483 * information */ 483 * information */
484 484
485 out_cmd->hdr.flags = 0; 485 out_cmd->hdr.flags = 0;
486 out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(IWL_CMD_QUEUE_NUM) | 486 out_cmd->hdr.sequence = cpu_to_le16(QUEUE_TO_SEQ(priv->cmd_queue) |
487 INDEX_TO_SEQ(q->write_ptr)); 487 INDEX_TO_SEQ(q->write_ptr));
488 if (cmd->flags & CMD_SIZE_HUGE) 488 if (cmd->flags & CMD_SIZE_HUGE)
489 out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; 489 out_cmd->hdr.sequence |= SEQ_HUGE_FRAME;
@@ -500,15 +500,15 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
500 get_cmd_string(out_cmd->hdr.cmd), 500 get_cmd_string(out_cmd->hdr.cmd),
501 out_cmd->hdr.cmd, 501 out_cmd->hdr.cmd,
502 le16_to_cpu(out_cmd->hdr.sequence), fix_size, 502 le16_to_cpu(out_cmd->hdr.sequence), fix_size,
503 q->write_ptr, idx, IWL_CMD_QUEUE_NUM); 503 q->write_ptr, idx, priv->cmd_queue);
504 break; 504 break;
505 default: 505 default:
506 IWL_DEBUG_HC(priv, "Sending command %s (#%x), seq: 0x%04X, " 506 IWL_DEBUG_HC(priv, "Sending command %s (#%x), seq: 0x%04X, "
507 "%d bytes at %d[%d]:%d\n", 507 "%d bytes at %d[%d]:%d\n",
508 get_cmd_string(out_cmd->hdr.cmd), 508 get_cmd_string(out_cmd->hdr.cmd),
509 out_cmd->hdr.cmd, 509 out_cmd->hdr.cmd,
510 le16_to_cpu(out_cmd->hdr.sequence), fix_size, 510 le16_to_cpu(out_cmd->hdr.sequence), fix_size,
511 q->write_ptr, idx, IWL_CMD_QUEUE_NUM); 511 q->write_ptr, idx, priv->cmd_queue);
512 } 512 }
513#endif 513#endif
514 txq->need_update = 1; 514 txq->need_update = 1;
@@ -587,16 +587,16 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
587 bool huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME); 587 bool huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME);
588 struct iwl_device_cmd *cmd; 588 struct iwl_device_cmd *cmd;
589 struct iwl_cmd_meta *meta; 589 struct iwl_cmd_meta *meta;
590 struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM]; 590 struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue];
591 591
592 /* If a Tx command is being handled and it isn't in the actual 592 /* If a Tx command is being handled and it isn't in the actual
593 * command queue then there a command routing bug has been introduced 593 * command queue then there a command routing bug has been introduced
594 * in the queue management code. */ 594 * in the queue management code. */
595 if (WARN(txq_id != IWL_CMD_QUEUE_NUM, 595 if (WARN(txq_id != priv->cmd_queue,
596 "wrong command queue %d, sequence 0x%X readp=%d writep=%d\n", 596 "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n",
597 txq_id, sequence, 597 txq_id, priv->cmd_queue, sequence,
598 priv->txq[IWL_CMD_QUEUE_NUM].q.read_ptr, 598 priv->txq[priv->cmd_queue].q.read_ptr,
599 priv->txq[IWL_CMD_QUEUE_NUM].q.write_ptr)) { 599 priv->txq[priv->cmd_queue].q.write_ptr)) {
600 iwl_print_hex_error(priv, pkt, 32); 600 iwl_print_hex_error(priv, pkt, 32);
601 return; 601 return;
602 } 602 }