ath9k: fix hardware tx queue allocation order
[openwrt.git] / package / kernel / mac80211 / patches / 324-ath9k_hw-fix-hardware-queue-allocation.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Sun, 30 Nov 2014 20:30:46 +0100
3 Subject: [PATCH] ath9k_hw: fix hardware queue allocation
4
5 The driver passes the desired hardware queue index for a WMM data queue
6 in qinfo->tqi_subtype. This was ignored in ath9k_hw_setuptxqueue, which
7 instead relied on the order in which the function is called.
8
9 Cc: stable@vger.kernel.org
10 Reported-by: Hubert Feurstein <h.feurstein@gmail.com>
11 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
12 ---
13
14 --- a/drivers/net/wireless/ath/ath9k/mac.c
15 +++ b/drivers/net/wireless/ath/ath9k/mac.c
16 @@ -311,14 +311,7 @@ int ath9k_hw_setuptxqueue(struct ath_hw 
17                 q = ATH9K_NUM_TX_QUEUES - 3;
18                 break;
19         case ATH9K_TX_QUEUE_DATA:
20 -               for (q = 0; q < ATH9K_NUM_TX_QUEUES; q++)
21 -                       if (ah->txq[q].tqi_type ==
22 -                           ATH9K_TX_QUEUE_INACTIVE)
23 -                               break;
24 -               if (q == ATH9K_NUM_TX_QUEUES) {
25 -                       ath_err(common, "No available TX queue\n");
26 -                       return -1;
27 -               }
28 +               q = qinfo->tqi_subtype;
29                 break;
30         default:
31                 ath_err(common, "Invalid TX queue type: %u\n", type);