1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -1446,7 +1446,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
4 REGWRITE_BUFFER_FLUSH(ah);
7 - for (i = 0; i < ah->caps.total_queues; i++)
8 + for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
9 ath9k_hw_resettxqueue(ah, i);
11 ath9k_hw_init_interrupt_masks(ah, ah->opmode);
12 @@ -1894,12 +1894,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw
14 pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
16 - if (capField & AR_EEPROM_EEPCAP_MAXQCU)
17 - pCap->total_queues =
18 - MS(capField, AR_EEPROM_EEPCAP_MAXQCU);
20 - pCap->total_queues = ATH9K_NUM_TX_QUEUES;
22 if (capField & AR_EEPROM_EEPCAP_KC_ENTRIES)
24 1 << MS(capField, AR_EEPROM_EEPCAP_KC_ENTRIES);
25 --- a/drivers/net/wireless/ath/ath9k/hw.h
26 +++ b/drivers/net/wireless/ath/ath9k/hw.h
27 @@ -191,7 +191,6 @@ enum ath9k_hw_caps {
29 struct ath9k_hw_capabilities {
30 u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
33 u16 low_5ghz_chan, high_5ghz_chan;
34 u16 low_2ghz_chan, high_2ghz_chan;
35 --- a/drivers/net/wireless/ath/ath9k/mac.c
36 +++ b/drivers/net/wireless/ath/ath9k/mac.c
37 @@ -209,15 +209,8 @@ bool ath9k_hw_set_txq_props(struct ath_h
40 struct ath_common *common = ath9k_hw_common(ah);
41 - struct ath9k_hw_capabilities *pCap = &ah->caps;
42 struct ath9k_tx_queue_info *qi;
44 - if (q >= pCap->total_queues) {
45 - ath_dbg(common, ATH_DBG_QUEUE,
46 - "Set TXQ properties, invalid queue: %u\n", q);
51 if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
52 ath_dbg(common, ATH_DBG_QUEUE,
53 @@ -280,15 +273,8 @@ bool ath9k_hw_get_txq_props(struct ath_h
54 struct ath9k_tx_queue_info *qinfo)
56 struct ath_common *common = ath9k_hw_common(ah);
57 - struct ath9k_hw_capabilities *pCap = &ah->caps;
58 struct ath9k_tx_queue_info *qi;
60 - if (q >= pCap->total_queues) {
61 - ath_dbg(common, ATH_DBG_QUEUE,
62 - "Get TXQ properties, invalid queue: %u\n", q);
67 if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
68 ath_dbg(common, ATH_DBG_QUEUE,
69 @@ -320,28 +306,27 @@ int ath9k_hw_setuptxqueue(struct ath_hw
71 struct ath_common *common = ath9k_hw_common(ah);
72 struct ath9k_tx_queue_info *qi;
73 - struct ath9k_hw_capabilities *pCap = &ah->caps;
77 case ATH9K_TX_QUEUE_BEACON:
78 - q = pCap->total_queues - 1;
79 + q = ATH9K_NUM_TX_QUEUES - 1;
81 case ATH9K_TX_QUEUE_CAB:
82 - q = pCap->total_queues - 2;
83 + q = ATH9K_NUM_TX_QUEUES - 2;
85 case ATH9K_TX_QUEUE_PSPOLL:
88 case ATH9K_TX_QUEUE_UAPSD:
89 - q = pCap->total_queues - 3;
90 + q = ATH9K_NUM_TX_QUEUES - 3;
92 case ATH9K_TX_QUEUE_DATA:
93 - for (q = 0; q < pCap->total_queues; q++)
94 + for (q = 0; q < ATH9K_NUM_TX_QUEUES; q++)
95 if (ah->txq[q].tqi_type ==
96 ATH9K_TX_QUEUE_INACTIVE)
98 - if (q == pCap->total_queues) {
99 + if (q == ATH9K_NUM_TX_QUEUES) {
100 ath_err(common, "No available TX queue\n");
103 @@ -382,15 +367,9 @@ EXPORT_SYMBOL(ath9k_hw_setuptxqueue);
105 bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q)
107 - struct ath9k_hw_capabilities *pCap = &ah->caps;
108 struct ath_common *common = ath9k_hw_common(ah);
109 struct ath9k_tx_queue_info *qi;
111 - if (q >= pCap->total_queues) {
112 - ath_dbg(common, ATH_DBG_QUEUE,
113 - "Release TXQ, invalid queue: %u\n", q);
117 if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
118 ath_dbg(common, ATH_DBG_QUEUE,
119 @@ -414,18 +393,11 @@ EXPORT_SYMBOL(ath9k_hw_releasetxqueue);
121 bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
123 - struct ath9k_hw_capabilities *pCap = &ah->caps;
124 struct ath_common *common = ath9k_hw_common(ah);
125 struct ath9k_channel *chan = ah->curchan;
126 struct ath9k_tx_queue_info *qi;
127 u32 cwMin, chanCwMin, value;
129 - if (q >= pCap->total_queues) {
130 - ath_dbg(common, ATH_DBG_QUEUE,
131 - "Reset TXQ, invalid queue: %u\n", q);
136 if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
137 ath_dbg(common, ATH_DBG_QUEUE,