mwl8k: don't hardcode the number of transmit queues
authorLennert Buytenhek <buytenh@wantstofly.org>
Tue, 18 Aug 2009 02:15:22 +0000 (04:15 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:38:06 +0000 (11:38 -0400)
Use MWL8K_TX_QUEUES instead of a hardcoded "4" in a couple of places.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c

index cc0aa80..0281e70 100644 (file)
@@ -1080,17 +1080,17 @@ struct mwl8k_txq_info {
 };
 
 static int mwl8k_scan_tx_ring(struct mwl8k_priv *priv,
 };
 
 static int mwl8k_scan_tx_ring(struct mwl8k_priv *priv,
-                               struct mwl8k_txq_info txinfo[],
-                               u32 num_queues)
+                               struct mwl8k_txq_info *txinfo)
 {
        int count, desc, status;
        struct mwl8k_tx_queue *txq;
        struct mwl8k_tx_desc *tx_desc;
        int ndescs = 0;
 
 {
        int count, desc, status;
        struct mwl8k_tx_queue *txq;
        struct mwl8k_tx_desc *tx_desc;
        int ndescs = 0;
 
-       memset(txinfo, 0, num_queues * sizeof(struct mwl8k_txq_info));
+       memset(txinfo, 0, MWL8K_TX_QUEUES * sizeof(struct mwl8k_txq_info));
+
        spin_lock_bh(&priv->tx_lock);
        spin_lock_bh(&priv->tx_lock);
-       for (count = 0; count < num_queues; count++) {
+       for (count = 0; count < MWL8K_TX_QUEUES; count++) {
                txq = priv->txq + count;
                txinfo[count].len = txq->tx_stats.len;
                txinfo[count].head = txq->tx_head;
                txq = priv->txq + count;
                txinfo[count].len = txq->tx_stats.len;
                txinfo[count].head = txq->tx_head;
@@ -1135,7 +1135,7 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw, u32 delay_ms)
        spin_unlock_bh(&priv->tx_lock);
 
        if (count) {
        spin_unlock_bh(&priv->tx_lock);
 
        if (count) {
-               struct mwl8k_txq_info txinfo[4];
+               struct mwl8k_txq_info txinfo[MWL8K_TX_QUEUES];
                int index;
                int newcount;
 
                int index;
                int newcount;
 
@@ -1152,8 +1152,8 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw, u32 delay_ms)
                printk(KERN_ERR "%s(%u) TIMEDOUT:%ums Pend:%u-->%u\n",
                       __func__, __LINE__, delay_ms, count, newcount);
 
                printk(KERN_ERR "%s(%u) TIMEDOUT:%ums Pend:%u-->%u\n",
                       __func__, __LINE__, delay_ms, count, newcount);
 
-               mwl8k_scan_tx_ring(priv, txinfo, 4);
-               for (index = 0; index < 4; index++)
+               mwl8k_scan_tx_ring(priv, txinfo);
+               for (index = 0; index < MWL8K_TX_QUEUES; index++)
                        printk(KERN_ERR
                                "TXQ:%u L:%u H:%u T:%u FW:%u DRV:%u U:%u\n",
                                        index,
                        printk(KERN_ERR
                                "TXQ:%u L:%u H:%u T:%u FW:%u DRV:%u U:%u\n",
                                        index,