]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iwlwifi: fix FIFO vs. queue confusion
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 6 Nov 2009 22:52:51 +0000 (14:52 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 11 Nov 2009 20:23:43 +0000 (15:23 -0500)
When I added that code setting the swq_id, I evidently
did not understand the distinction between FIFO and TX
queue yet and added code to compare a queue ID and a
FIFO number, which is bogus.

However, the code there need not be this specific, it
can just set all queues to the identity mapping which
will be overwritten by the aggregation queue code. As
a bit of defensive coding, don't assign an swq_id to
the command queue so that if we ever use it for frames
we notice quickly.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-tx.c

index cb2642c18da423a1c71a6d2107073909ba0530f1..b4e8145430396cb92b024e0ffdc91e9783efcdfd 100644 (file)
@@ -324,8 +324,9 @@ struct iwl_channel_info {
 #define IWL_MIN_NUM_QUEUES     10
 
 /*
- * uCode queue management definitions ...
- * Queue #4 is the command queue for 3945/4965/5x00/1000/6x00.
+ * Queue #4 is the command queue for 3945/4965/5x00/1000/6x00,
+ * the driver maps it into the appropriate device FIFO for the
+ * uCode.
  */
 #define IWL_CMD_QUEUE_NUM      4
 
index 05e75109d842e33c725fcf35e7f443937c263f1f..905ceca88b95c5a2bc440c13845dd9d86dc630f8 100644 (file)
@@ -364,8 +364,13 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
 
        txq->need_update = 0;
 
-       /* aggregation TX queues will get their ID when aggregation begins */
-       if (txq_id <= IWL_TX_FIFO_AC3)
+       /*
+        * Aggregation TX queues will get their ID when aggregation begins;
+        * they overwrite the setting done here. The command FIFO doesn't
+        * need an swq_id so don't set one to catch errors, all others can
+        * be set up to the identity mapping.
+        */
+       if (txq_id != IWL_CMD_QUEUE_NUM)
                txq->swq_id = txq_id;
 
        /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise