rt2x00: Include ATIM queue support in rt2x00queue_get_tx_queue.
authorGertjan van Wingerde <gwingerde@gmail.com>
Thu, 3 Mar 2011 18:46:29 +0000 (19:46 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Mar 2011 19:06:49 +0000 (14:06 -0500)
The ATIM queue is considered to be a TX queue by the drivers that support
the queue. Therefore include support for the ATIM queue to the
rt2x00queue_get_tx_queue function so that the drivers that support the ATIM
queue can also use that function.

Add the support in such a way that drivers that do not support the ATIM
queue are not penalized in their efficiency.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00mac.c

index d78d39e4730a898733aaa5489fc7821ec5ea47b4..329f3283697b65a4c5c27c91c2268affa3b1dd8c 100644 (file)
@@ -1278,7 +1278,7 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry,
 static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
                             const enum data_queue_qid queue_idx)
 {
-       struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
+       struct data_queue *queue = rt2x00queue_get_tx_queue(rt2x00dev, queue_idx);
        struct queue_entry_priv_pci *entry_priv;
        struct queue_entry *entry;
        struct txdone_entry_desc txdesc;
index 3fb09151c9183f00251825ceb365558054840739..5cd6575b63582603353ac380e37a12bfe46048a4 100644 (file)
@@ -1410,7 +1410,7 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry,
 static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
                             const enum data_queue_qid queue_idx)
 {
-       struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
+       struct data_queue *queue = rt2x00queue_get_tx_queue(rt2x00dev, queue_idx);
        struct queue_entry_priv_pci *entry_priv;
        struct queue_entry *entry;
        struct txdone_entry_desc txdesc;
index 65636a7eba1613c8ff79f6343619a356a662207f..6a88c56b43ffa20fab17e9ed01f4b24f00e1f3da 100644 (file)
@@ -1076,6 +1076,9 @@ rt2x00queue_get_tx_queue(struct rt2x00_dev *rt2x00dev,
        if (queue < rt2x00dev->ops->tx_queues && rt2x00dev->tx)
                return &rt2x00dev->tx[queue];
 
+       if (queue == QID_ATIM)
+               return rt2x00dev->atim;
+
        return NULL;
 }
 
index 778b6d9cd686727e7708d23d2767a54314e858ce..72345787fea6b5167661c51b034c6252d6c893d6 100644 (file)
@@ -116,13 +116,13 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                goto exit_fail;
 
        /*
-        * Determine which queue to put packet on.
+        * Use the ATIM queue if appropriate and present.
         */
        if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM &&
            test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags))
-               queue = rt2x00queue_get_queue(rt2x00dev, QID_ATIM);
-       else
-               queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
+               qid = QID_ATIM;
+
+       queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
        if (unlikely(!queue)) {
                ERROR(rt2x00dev,
                      "Attempt to send packet over invalid queue %d.\n"