ath9k: add a few de-bloating and optimization patches
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 564-ath9k_remove_total_queues_cap.patch
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);
5
6 ah->intr_txqs = 0;
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);
10
11 ath9k_hw_init_interrupt_masks(ah, ah->opmode);
12 @@ -1894,12 +1894,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw
13 else
14 pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
15
16 - if (capField & AR_EEPROM_EEPCAP_MAXQCU)
17 - pCap->total_queues =
18 - MS(capField, AR_EEPROM_EEPCAP_MAXQCU);
19 - else
20 - pCap->total_queues = ATH9K_NUM_TX_QUEUES;
21 -
22 if (capField & AR_EEPROM_EEPCAP_KC_ENTRIES)
23 pCap->keycache_size =
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 {
28
29 struct ath9k_hw_capabilities {
30 u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */
31 - u16 total_queues;
32 u16 keycache_size;
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
38 {
39 u32 cw;
40 struct ath_common *common = ath9k_hw_common(ah);
41 - struct ath9k_hw_capabilities *pCap = &ah->caps;
42 struct ath9k_tx_queue_info *qi;
43
44 - if (q >= pCap->total_queues) {
45 - ath_dbg(common, ATH_DBG_QUEUE,
46 - "Set TXQ properties, invalid queue: %u\n", q);
47 - return false;
48 - }
49 -
50 qi = &ah->txq[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)
55 {
56 struct ath_common *common = ath9k_hw_common(ah);
57 - struct ath9k_hw_capabilities *pCap = &ah->caps;
58 struct ath9k_tx_queue_info *qi;
59
60 - if (q >= pCap->total_queues) {
61 - ath_dbg(common, ATH_DBG_QUEUE,
62 - "Get TXQ properties, invalid queue: %u\n", q);
63 - return false;
64 - }
65 -
66 qi = &ah->txq[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
70 {
71 struct ath_common *common = ath9k_hw_common(ah);
72 struct ath9k_tx_queue_info *qi;
73 - struct ath9k_hw_capabilities *pCap = &ah->caps;
74 int q;
75
76 switch (type) {
77 case ATH9K_TX_QUEUE_BEACON:
78 - q = pCap->total_queues - 1;
79 + q = ATH9K_NUM_TX_QUEUES - 1;
80 break;
81 case ATH9K_TX_QUEUE_CAB:
82 - q = pCap->total_queues - 2;
83 + q = ATH9K_NUM_TX_QUEUES - 2;
84 break;
85 case ATH9K_TX_QUEUE_PSPOLL:
86 q = 1;
87 break;
88 case ATH9K_TX_QUEUE_UAPSD:
89 - q = pCap->total_queues - 3;
90 + q = ATH9K_NUM_TX_QUEUES - 3;
91 break;
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)
97 break;
98 - if (q == pCap->total_queues) {
99 + if (q == ATH9K_NUM_TX_QUEUES) {
100 ath_err(common, "No available TX queue\n");
101 return -1;
102 }
103 @@ -382,15 +367,9 @@ EXPORT_SYMBOL(ath9k_hw_setuptxqueue);
104
105 bool ath9k_hw_releasetxqueue(struct ath_hw *ah, u32 q)
106 {
107 - struct ath9k_hw_capabilities *pCap = &ah->caps;
108 struct ath_common *common = ath9k_hw_common(ah);
109 struct ath9k_tx_queue_info *qi;
110
111 - if (q >= pCap->total_queues) {
112 - ath_dbg(common, ATH_DBG_QUEUE,
113 - "Release TXQ, invalid queue: %u\n", q);
114 - return false;
115 - }
116 qi = &ah->txq[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);
120
121 bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
122 {
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;
128
129 - if (q >= pCap->total_queues) {
130 - ath_dbg(common, ATH_DBG_QUEUE,
131 - "Reset TXQ, invalid queue: %u\n", q);
132 - return false;
133 - }
134 -
135 qi = &ah->txq[q];
136 if (qi->tqi_type == ATH9K_TX_QUEUE_INACTIVE) {
137 ath_dbg(common, ATH_DBG_QUEUE,