7e0c70182971b8b60679ae3fdd420b71fe6ea1b3
[openwrt.git] / package / mac80211 / patches / 550-ath9k_pending_work.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
3 @@ -852,7 +852,7 @@ static int ar5008_hw_process_ini(struct 
4  
5         REG_WRITE_ARRAY(&ah->iniBB_RfGain, freqIndex, regWrites);
6  
7 -       if (AR_SREV_9280_20(ah) && IS_CHAN_A_5MHZ_SPACED(chan)) {
8 +       if (IS_CHAN_A_FAST_CLOCK(ah, chan)) {
9                 REG_WRITE_ARRAY(&ah->iniModesAdditional, modesIndex,
10                                 regWrites);
11         }
12 @@ -894,8 +894,7 @@ static void ar5008_hw_set_rfmode(struct 
13                 rfMode |= (IS_CHAN_5GHZ(chan)) ?
14                         AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ;
15  
16 -       if ((AR_SREV_9280_20(ah) || AR_SREV_9300_20_OR_LATER(ah))
17 -           && IS_CHAN_A_5MHZ_SPACED(chan))
18 +       if (IS_CHAN_A_FAST_CLOCK(ah, chan))
19                 rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE);
20  
21         REG_WRITE(ah, AR_PHY_MODE, rfMode);
22 --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
23 +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
24 @@ -455,16 +455,12 @@ static u32 ar9002_hw_compute_pll_control
25                 pll |= SM(0x2, AR_RTC_9160_PLL_CLKSEL);
26  
27         if (chan && IS_CHAN_5GHZ(chan)) {
28 -               pll |= SM(0x28, AR_RTC_9160_PLL_DIV);
29 -
30 -
31 -               if (AR_SREV_9280_20(ah)) {
32 -                       if (((chan->channel % 20) == 0)
33 -                           || ((chan->channel % 10) == 0))
34 -                               pll = 0x2850;
35 -                       else
36 -                               pll = 0x142c;
37 -               }
38 +               if (IS_CHAN_A_FAST_CLOCK(ah, chan))
39 +                       pll = 0x142c;
40 +               else if (AR_SREV_9280_20(ah))
41 +                       pll = 0x2850;
42 +               else
43 +                       pll |= SM(0x28, AR_RTC_9160_PLL_DIV);
44         } else {
45                 pll |= SM(0x2c, AR_RTC_9160_PLL_DIV);
46         }
47 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
48 +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
49 @@ -755,7 +755,8 @@ static bool ar9003_hw_init_cal(struct at
50         }
51  
52         /* Do Tx IQ Calibration */
53 -       ar9003_hw_tx_iq_cal(ah);
54 +       if (ah->config.tx_iq_calibration)
55 +               ar9003_hw_tx_iq_cal(ah);
56  
57         /* Revert chainmasks to their original values before NF cal */
58         ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
59 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
60 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
61 @@ -659,6 +659,9 @@ static void ar9300_swap_eeprom(struct ar
62         word = swab16(eep->baseEepHeader.regDmn[1]);
63         eep->baseEepHeader.regDmn[1] = word;
64  
65 +       dword = swab32(eep->baseEepHeader.swreg);
66 +       eep->baseEepHeader.swreg = dword;
67 +
68         dword = swab32(eep->modalHeader2G.antCtrlCommon);
69         eep->modalHeader2G.antCtrlCommon = dword;
70  
71 @@ -1200,7 +1203,7 @@ static u8 ar9003_hw_eeprom_get_tgt_pwr(s
72         u8 *pFreqBin;
73  
74         if (is2GHz) {
75 -               numPiers = AR9300_NUM_5G_20_TARGET_POWERS;
76 +               numPiers = AR9300_NUM_2G_20_TARGET_POWERS;
77                 pEepromTargetPwr = eep->calTargetPower2G;
78                 pFreqBin = eep->calTarget_freqbin_2G;
79         } else {
80 @@ -1236,7 +1239,7 @@ static u8 ar9003_hw_eeprom_get_ht20_tgt_
81         u8 *pFreqBin;
82  
83         if (is2GHz) {
84 -               numPiers = AR9300_NUM_5G_20_TARGET_POWERS;
85 +               numPiers = AR9300_NUM_2G_20_TARGET_POWERS;
86                 pEepromTargetPwr = eep->calTargetPower2GHT20;
87                 pFreqBin = eep->calTarget_freqbin_2GHT20;
88         } else {
89 @@ -1817,6 +1820,7 @@ static void ath9k_hw_ar9300_set_txpower(
90                                         u8 twiceMaxRegulatoryPower,
91                                         u8 powerLimit)
92  {
93 +       ah->txpower_limit = powerLimit;
94         ar9003_hw_set_target_power_eeprom(ah, chan->channel);
95         ar9003_hw_calibration_apply(ah, chan->channel);
96  }
97 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
98 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
99 @@ -265,7 +265,7 @@ struct cal_ctl_edge_pwr {
100  } __packed;
101  
102  struct cal_ctl_data_2g {
103 -       struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G];
104 +       struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G];
105  } __packed;
106  
107  struct cal_ctl_data_5g {
108 --- a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
109 +++ b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
110 @@ -31,7 +31,7 @@ static const u32 ar9300_2p0_radio_postam
111  
112  static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = {
113         /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
114 -       {0x0000a410, 0x000050da, 0x000050da, 0x000050da, 0x000050da},
115 +       {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
116         {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
117         {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
118         {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
119 @@ -545,7 +545,7 @@ static const u32 ar9300_2p0_soc_postambl
120  };
121  
122  static const u32 ar9200_merlin_2p0_radio_core[][2] = {
123 -       /* Addr      common    */
124 +       /* Addr      allmodes  */
125         {0x00007800, 0x00040000},
126         {0x00007804, 0xdb005012},
127         {0x00007808, 0x04924914},
128 @@ -835,71 +835,71 @@ static const u32 ar9300_2p0_baseband_cor
129  
130  static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = {
131         /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
132 -       {0x0000a410, 0x000050d9, 0x000050d9, 0x000050da, 0x000050da},
133 +       {0x0000a410, 0x000050db, 0x000050db, 0x000050d9, 0x000050d9},
134         {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000},
135         {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002},
136 -       {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004},
137 -       {0x0000a50c, 0x10022223, 0x10022223, 0x0b000200, 0x0b000200},
138 -       {0x0000a510, 0x17022620, 0x17022620, 0x0f000202, 0x0f000202},
139 -       {0x0000a514, 0x1b022622, 0x1b022622, 0x11000400, 0x11000400},
140 -       {0x0000a518, 0x1f022822, 0x1f022822, 0x15000402, 0x15000402},
141 -       {0x0000a51c, 0x24022842, 0x24022842, 0x19000404, 0x19000404},
142 -       {0x0000a520, 0x28042840, 0x28042840, 0x1b000603, 0x1b000603},
143 -       {0x0000a524, 0x2c042842, 0x2c042842, 0x1f000a02, 0x1f000a02},
144 -       {0x0000a528, 0x30042844, 0x30042844, 0x23000a04, 0x23000a04},
145 -       {0x0000a52c, 0x34042846, 0x34042846, 0x26000a20, 0x26000a20},
146 -       {0x0000a530, 0x39042869, 0x39042869, 0x2a000e20, 0x2a000e20},
147 -       {0x0000a534, 0x3d062869, 0x3d062869, 0x2e000e22, 0x2e000e22},
148 -       {0x0000a538, 0x44062c69, 0x44062c69, 0x31000e24, 0x31000e24},
149 -       {0x0000a53c, 0x48063069, 0x48063069, 0x34001640, 0x34001640},
150 -       {0x0000a540, 0x4c0a3065, 0x4c0a3065, 0x38001660, 0x38001660},
151 -       {0x0000a544, 0x500a3069, 0x500a3069, 0x3b001861, 0x3b001861},
152 -       {0x0000a548, 0x530a3469, 0x530a3469, 0x3e001a81, 0x3e001a81},
153 -       {0x0000a54c, 0x590a7464, 0x590a7464, 0x42001a83, 0x42001a83},
154 -       {0x0000a550, 0x5e0a7865, 0x5e0a7865, 0x44001c84, 0x44001c84},
155 -       {0x0000a554, 0x630a7e66, 0x630a7e66, 0x48001ce3, 0x48001ce3},
156 -       {0x0000a558, 0x680a7e89, 0x680a7e89, 0x4c001ce5, 0x4c001ce5},
157 -       {0x0000a55c, 0x6e0a7e8c, 0x6e0a7e8c, 0x50001ce9, 0x50001ce9},
158 -       {0x0000a560, 0x730e7e8c, 0x730e7e8c, 0x54001ceb, 0x54001ceb},
159 -       {0x0000a564, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
160 -       {0x0000a568, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
161 -       {0x0000a56c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
162 -       {0x0000a570, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
163 -       {0x0000a574, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
164 -       {0x0000a578, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
165 -       {0x0000a57c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
166 +       {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
167 +       {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
168 +       {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
169 +       {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
170 +       {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
171 +       {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
172 +       {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
173 +       {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
174 +       {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
175 +       {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
176 +       {0x0000a530, 0x34043643, 0x34043643, 0x2a000e20, 0x2a000e20},
177 +       {0x0000a534, 0x38043a44, 0x38043a44, 0x2e000e22, 0x2e000e22},
178 +       {0x0000a538, 0x3b043e45, 0x3b043e45, 0x31000e24, 0x31000e24},
179 +       {0x0000a53c, 0x40063e46, 0x40063e46, 0x34001640, 0x34001640},
180 +       {0x0000a540, 0x44083e46, 0x44083e46, 0x38001660, 0x38001660},
181 +       {0x0000a544, 0x46083e66, 0x46083e66, 0x3b001861, 0x3b001861},
182 +       {0x0000a548, 0x4b0a3e69, 0x4b0a3e69, 0x3e001a81, 0x3e001a81},
183 +       {0x0000a54c, 0x4f0a5e66, 0x4f0a5e66, 0x42001a83, 0x42001a83},
184 +       {0x0000a550, 0x540a7e66, 0x540a7e66, 0x44001c84, 0x44001c84},
185 +       {0x0000a554, 0x570a7e89, 0x570a7e89, 0x48001ce3, 0x48001ce3},
186 +       {0x0000a558, 0x5c0e7e8a, 0x5c0e7e8a, 0x4c001ce5, 0x4c001ce5},
187 +       {0x0000a55c, 0x60127e8b, 0x60127e8b, 0x50001ce9, 0x50001ce9},
188 +       {0x0000a560, 0x65127ecc, 0x65127ecc, 0x54001ceb, 0x54001ceb},
189 +       {0x0000a564, 0x6b169ecd, 0x6b169ecd, 0x56001eec, 0x56001eec},
190 +       {0x0000a568, 0x70169f0e, 0x70169f0e, 0x56001eec, 0x56001eec},
191 +       {0x0000a56c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
192 +       {0x0000a570, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
193 +       {0x0000a574, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
194 +       {0x0000a578, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
195 +       {0x0000a57c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
196         {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000},
197         {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002},
198 -       {0x0000a588, 0x0b822220, 0x0b822220, 0x08800004, 0x08800004},
199 -       {0x0000a58c, 0x10822223, 0x10822223, 0x0b800200, 0x0b800200},
200 -       {0x0000a590, 0x17822620, 0x17822620, 0x0f800202, 0x0f800202},
201 -       {0x0000a594, 0x1b822622, 0x1b822622, 0x11800400, 0x11800400},
202 -       {0x0000a598, 0x1f822822, 0x1f822822, 0x15800402, 0x15800402},
203 -       {0x0000a59c, 0x24822842, 0x24822842, 0x19800404, 0x19800404},
204 -       {0x0000a5a0, 0x28842840, 0x28842840, 0x1b800603, 0x1b800603},
205 -       {0x0000a5a4, 0x2c842842, 0x2c842842, 0x1f800a02, 0x1f800a02},
206 -       {0x0000a5a8, 0x30842844, 0x30842844, 0x23800a04, 0x23800a04},
207 -       {0x0000a5ac, 0x34842846, 0x34842846, 0x26800a20, 0x26800a20},
208 -       {0x0000a5b0, 0x39842869, 0x39842869, 0x2a800e20, 0x2a800e20},
209 -       {0x0000a5b4, 0x3d862869, 0x3d862869, 0x2e800e22, 0x2e800e22},
210 -       {0x0000a5b8, 0x44862c69, 0x44862c69, 0x31800e24, 0x31800e24},
211 -       {0x0000a5bc, 0x48863069, 0x48863069, 0x34801640, 0x34801640},
212 -       {0x0000a5c0, 0x4c8a3065, 0x4c8a3065, 0x38801660, 0x38801660},
213 -       {0x0000a5c4, 0x508a3069, 0x508a3069, 0x3b801861, 0x3b801861},
214 -       {0x0000a5c8, 0x538a3469, 0x538a3469, 0x3e801a81, 0x3e801a81},
215 -       {0x0000a5cc, 0x598a7464, 0x598a7464, 0x42801a83, 0x42801a83},
216 -       {0x0000a5d0, 0x5e8a7865, 0x5e8a7865, 0x44801c84, 0x44801c84},
217 -       {0x0000a5d4, 0x638a7e66, 0x638a7e66, 0x48801ce3, 0x48801ce3},
218 -       {0x0000a5d8, 0x688a7e89, 0x688a7e89, 0x4c801ce5, 0x4c801ce5},
219 -       {0x0000a5dc, 0x6e8a7e8c, 0x6e8a7e8c, 0x50801ce9, 0x50801ce9},
220 -       {0x0000a5e0, 0x738e7e8c, 0x738e7e8c, 0x54801ceb, 0x54801ceb},
221 -       {0x0000a5e4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
222 -       {0x0000a5e8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
223 -       {0x0000a5ec, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
224 -       {0x0000a5f0, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
225 -       {0x0000a5f4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
226 -       {0x0000a5f8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
227 -       {0x0000a5fc, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
228 +       {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004},
229 +       {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200},
230 +       {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202},
231 +       {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400},
232 +       {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402},
233 +       {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404},
234 +       {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603},
235 +       {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02},
236 +       {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04},
237 +       {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20},
238 +       {0x0000a5b0, 0x34843643, 0x34843643, 0x2a800e20, 0x2a800e20},
239 +       {0x0000a5b4, 0x38843a44, 0x38843a44, 0x2e800e22, 0x2e800e22},
240 +       {0x0000a5b8, 0x3b843e45, 0x3b843e45, 0x31800e24, 0x31800e24},
241 +       {0x0000a5bc, 0x40863e46, 0x40863e46, 0x34801640, 0x34801640},
242 +       {0x0000a5c0, 0x4c8a3065, 0x44883e46, 0x44883e46, 0x38801660},
243 +       {0x0000a5c4, 0x46883e66, 0x46883e66, 0x3b801861, 0x3b801861},
244 +       {0x0000a5c8, 0x4b8a3e69, 0x4b8a3e69, 0x3e801a81, 0x3e801a81},
245 +       {0x0000a5cc, 0x4f8a5e66, 0x4f8a5e66, 0x42801a83, 0x42801a83},
246 +       {0x0000a5d0, 0x548a7e66, 0x548a7e66, 0x44801c84, 0x44801c84},
247 +       {0x0000a5d4, 0x578a7e89, 0x578a7e89, 0x48801ce3, 0x48801ce3},
248 +       {0x0000a5d8, 0x5c8e7e8a, 0x5c8e7e8a, 0x4c801ce5, 0x4c801ce5},
249 +       {0x0000a5dc, 0x60927e8b, 0x60927e8b, 0x50801ce9, 0x50801ce9},
250 +       {0x0000a5e0, 0x65927ecc, 0x65927ecc, 0x54801ceb, 0x54801ceb},
251 +       {0x0000a5e4, 0x6b969ecd, 0x6b969ecd, 0x56801eec, 0x56801eec},
252 +       {0x0000a5e8, 0x70969f0e, 0x70969f0e, 0x56801eec, 0x56801eec},
253 +       {0x0000a5ec, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
254 +       {0x0000a5f0, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
255 +       {0x0000a5f4, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
256 +       {0x0000a5f8, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
257 +       {0x0000a5fc, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
258         {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
259         {0x00016048, 0xad241a61, 0xad241a61, 0xad241a61, 0xad241a61},
260         {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
261 @@ -913,71 +913,71 @@ static const u32 ar9300Modes_high_power_
262  
263  static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p0[][5] = {
264         /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
265 -       {0x0000a410, 0x000050d9, 0x000050d9, 0x000050da, 0x000050da},
266 +       {0x0000a410, 0x000050db, 0x000050db, 0x000050d9, 0x000050d9},
267         {0x0000a500, 0x00020220, 0x00020220, 0x00000000, 0x00000000},
268         {0x0000a504, 0x06020223, 0x06020223, 0x04000002, 0x04000002},
269 -       {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004},
270 -       {0x0000a50c, 0x10022223, 0x10022223, 0x0b000200, 0x0b000200},
271 -       {0x0000a510, 0x17022620, 0x17022620, 0x0f000202, 0x0f000202},
272 -       {0x0000a514, 0x1b022622, 0x1b022622, 0x11000400, 0x11000400},
273 -       {0x0000a518, 0x1f022822, 0x1f022822, 0x15000402, 0x15000402},
274 -       {0x0000a51c, 0x24022842, 0x24022842, 0x19000404, 0x19000404},
275 -       {0x0000a520, 0x28042840, 0x28042840, 0x1b000603, 0x1b000603},
276 -       {0x0000a524, 0x2c042842, 0x2c042842, 0x1f000a02, 0x1f000a02},
277 -       {0x0000a528, 0x30042844, 0x30042844, 0x23000a04, 0x23000a04},
278 -       {0x0000a52c, 0x34042846, 0x34042846, 0x26000a20, 0x26000a20},
279 -       {0x0000a530, 0x39042869, 0x39042869, 0x2a000e20, 0x2a000e20},
280 -       {0x0000a534, 0x3d062869, 0x3d062869, 0x2e000e22, 0x2e000e22},
281 -       {0x0000a538, 0x44062c69, 0x44062c69, 0x31000e24, 0x31000e24},
282 -       {0x0000a53c, 0x48063069, 0x48063069, 0x34001640, 0x34001640},
283 -       {0x0000a540, 0x4c0a3065, 0x4c0a3065, 0x38001660, 0x38001660},
284 -       {0x0000a544, 0x500a3069, 0x500a3069, 0x3b001861, 0x3b001861},
285 -       {0x0000a548, 0x530a3469, 0x530a3469, 0x3e001a81, 0x3e001a81},
286 -       {0x0000a54c, 0x590a7464, 0x590a7464, 0x42001a83, 0x42001a83},
287 -       {0x0000a550, 0x5e0a7865, 0x5e0a7865, 0x44001c84, 0x44001c84},
288 -       {0x0000a554, 0x630a7e66, 0x630a7e66, 0x48001ce3, 0x48001ce3},
289 -       {0x0000a558, 0x680a7e89, 0x680a7e89, 0x4c001ce5, 0x4c001ce5},
290 -       {0x0000a55c, 0x6e0a7e8c, 0x6e0a7e8c, 0x50001ce9, 0x50001ce9},
291 -       {0x0000a560, 0x730e7e8c, 0x730e7e8c, 0x54001ceb, 0x54001ceb},
292 -       {0x0000a564, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
293 -       {0x0000a568, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
294 -       {0x0000a56c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
295 -       {0x0000a570, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
296 -       {0x0000a574, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
297 -       {0x0000a578, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
298 -       {0x0000a57c, 0x730e7e8c, 0x730e7e8c, 0x56001eec, 0x56001eec},
299 +       {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
300 +       {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
301 +       {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
302 +       {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
303 +       {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
304 +       {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
305 +       {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
306 +       {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
307 +       {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
308 +       {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
309 +       {0x0000a530, 0x34043643, 0x34043643, 0x2a000e20, 0x2a000e20},
310 +       {0x0000a534, 0x38043a44, 0x38043a44, 0x2e000e22, 0x2e000e22},
311 +       {0x0000a538, 0x3b043e45, 0x3b043e45, 0x31000e24, 0x31000e24},
312 +       {0x0000a53c, 0x40063e46, 0x40063e46, 0x34001640, 0x34001640},
313 +       {0x0000a540, 0x44083e46, 0x44083e46, 0x38001660, 0x38001660},
314 +       {0x0000a544, 0x46083e66, 0x46083e66, 0x3b001861, 0x3b001861},
315 +       {0x0000a548, 0x4b0a3e69, 0x4b0a3e69, 0x3e001a81, 0x3e001a81},
316 +       {0x0000a54c, 0x4f0a5e66, 0x4f0a5e66, 0x42001a83, 0x42001a83},
317 +       {0x0000a550, 0x540a7e66, 0x540a7e66, 0x44001c84, 0x44001c84},
318 +       {0x0000a554, 0x570a7e89, 0x570a7e89, 0x48001ce3, 0x48001ce3},
319 +       {0x0000a558, 0x5c0e7e8a, 0x5c0e7e8a, 0x4c001ce5, 0x4c001ce5},
320 +       {0x0000a55c, 0x60127e8b, 0x60127e8b, 0x50001ce9, 0x50001ce9},
321 +       {0x0000a560, 0x65127ecc, 0x65127ecc, 0x54001ceb, 0x54001ceb},
322 +       {0x0000a564, 0x6b169ecd, 0x6b169ecd, 0x56001eec, 0x56001eec},
323 +       {0x0000a568, 0x70169f0e, 0x70169f0e, 0x56001eec, 0x56001eec},
324 +       {0x0000a56c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
325 +       {0x0000a570, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
326 +       {0x0000a574, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
327 +       {0x0000a578, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
328 +       {0x0000a57c, 0x75169f4f, 0x75169f4f, 0x56001eec, 0x56001eec},
329         {0x0000a580, 0x00820220, 0x00820220, 0x00800000, 0x00800000},
330         {0x0000a584, 0x06820223, 0x06820223, 0x04800002, 0x04800002},
331 -       {0x0000a588, 0x0b822220, 0x0b822220, 0x08800004, 0x08800004},
332 -       {0x0000a58c, 0x10822223, 0x10822223, 0x0b800200, 0x0b800200},
333 -       {0x0000a590, 0x17822620, 0x17822620, 0x0f800202, 0x0f800202},
334 -       {0x0000a594, 0x1b822622, 0x1b822622, 0x11800400, 0x11800400},
335 -       {0x0000a598, 0x1f822822, 0x1f822822, 0x15800402, 0x15800402},
336 -       {0x0000a59c, 0x24822842, 0x24822842, 0x19800404, 0x19800404},
337 -       {0x0000a5a0, 0x28842840, 0x28842840, 0x1b800603, 0x1b800603},
338 -       {0x0000a5a4, 0x2c842842, 0x2c842842, 0x1f800a02, 0x1f800a02},
339 -       {0x0000a5a8, 0x30842844, 0x30842844, 0x23800a04, 0x23800a04},
340 -       {0x0000a5ac, 0x34842846, 0x34842846, 0x26800a20, 0x26800a20},
341 -       {0x0000a5b0, 0x39842869, 0x39842869, 0x2a800e20, 0x2a800e20},
342 -       {0x0000a5b4, 0x3d862869, 0x3d862869, 0x2e800e22, 0x2e800e22},
343 -       {0x0000a5b8, 0x44862c69, 0x44862c69, 0x31800e24, 0x31800e24},
344 -       {0x0000a5bc, 0x48863069, 0x48863069, 0x34801640, 0x34801640},
345 -       {0x0000a5c0, 0x4c8a3065, 0x4c8a3065, 0x38801660, 0x38801660},
346 -       {0x0000a5c4, 0x508a3069, 0x508a3069, 0x3b801861, 0x3b801861},
347 -       {0x0000a5c8, 0x538a3469, 0x538a3469, 0x3e801a81, 0x3e801a81},
348 -       {0x0000a5cc, 0x598a7464, 0x598a7464, 0x42801a83, 0x42801a83},
349 -       {0x0000a5d0, 0x5e8a7865, 0x5e8a7865, 0x44801c84, 0x44801c84},
350 -       {0x0000a5d4, 0x638a7e66, 0x638a7e66, 0x48801ce3, 0x48801ce3},
351 -       {0x0000a5d8, 0x688a7e89, 0x688a7e89, 0x4c801ce5, 0x4c801ce5},
352 -       {0x0000a5dc, 0x6e8a7e8c, 0x6e8a7e8c, 0x50801ce9, 0x50801ce9},
353 -       {0x0000a5e0, 0x738e7e8c, 0x738e7e8c, 0x54801ceb, 0x54801ceb},
354 -       {0x0000a5e4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
355 -       {0x0000a5e8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
356 -       {0x0000a5ec, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
357 -       {0x0000a5f0, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
358 -       {0x0000a5f4, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
359 -       {0x0000a5f8, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
360 -       {0x0000a5fc, 0x738e7e8c, 0x738e7e8c, 0x56801eec, 0x56801eec},
361 +       {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004},
362 +       {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200},
363 +       {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202},
364 +       {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400},
365 +       {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402},
366 +       {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404},
367 +       {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603},
368 +       {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02},
369 +       {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04},
370 +       {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20},
371 +       {0x0000a5b0, 0x34843643, 0x34843643, 0x2a800e20, 0x2a800e20},
372 +       {0x0000a5b4, 0x38843a44, 0x38843a44, 0x2e800e22, 0x2e800e22},
373 +       {0x0000a5b8, 0x3b843e45, 0x3b843e45, 0x31800e24, 0x31800e24},
374 +       {0x0000a5bc, 0x40863e46, 0x40863e46, 0x34801640, 0x34801640},
375 +       {0x0000a5c0, 0x44883e46, 0x44883e46, 0x38801660, 0x38801660},
376 +       {0x0000a5c4, 0x46883e66, 0x46883e66, 0x3b801861, 0x3b801861},
377 +       {0x0000a5c8, 0x4b8a3e69, 0x4b8a3e69, 0x3e801a81, 0x3e801a81},
378 +       {0x0000a5cc, 0x4f8a5e66, 0x4f8a5e66, 0x42801a83, 0x42801a83},
379 +       {0x0000a5d0, 0x548a7e66, 0x548a7e66, 0x44801c84, 0x44801c84},
380 +       {0x0000a5d4, 0x578a7e89, 0x578a7e89, 0x48801ce3, 0x48801ce3},
381 +       {0x0000a5d8, 0x5c8e7e8a, 0x5c8e7e8a, 0x4c801ce5, 0x4c801ce5},
382 +       {0x0000a5dc, 0x60927e8b, 0x60927e8b, 0x50801ce9, 0x50801ce9},
383 +       {0x0000a5e0, 0x65927ecc, 0x65927ecc, 0x54801ceb, 0x54801ceb},
384 +       {0x0000a5e4, 0x6b969ecd, 0x6b969ecd, 0x56801eec, 0x56801eec},
385 +       {0x0000a5e8, 0x70969f0e, 0x70969f0e, 0x56801eec, 0x56801eec},
386 +       {0x0000a5ec, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
387 +       {0x0000a5f0, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
388 +       {0x0000a5f4, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
389 +       {0x0000a5f8, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
390 +       {0x0000a5fc, 0x75969f4f, 0x75969f4f, 0x56801eec, 0x56801eec},
391         {0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
392         {0x00016048, 0x8c001a61, 0x8c001a61, 0x8c001a61, 0x8c001a61},
393         {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
394 @@ -1251,7 +1251,7 @@ static const u32 ar9300Common_rx_gain_ta
395  
396  static const u32 ar9300Modes_low_ob_db_tx_gain_table_2p0[][5] = {
397         /* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
398 -       {0x0000a410, 0x000050da, 0x000050da, 0x000050da, 0x000050da},
399 +       {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
400         {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
401         {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
402         {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
403 @@ -1760,31 +1760,22 @@ static const u32 ar9300_2p0_soc_preamble
404         {0x00007038, 0x000004c2},
405  };
406  
407 -/*
408 - * PCIE-PHY programming array, to be used prior to entering
409 - * full sleep (holding RTC in reset, PLL is ON in L1 mode)
410 - */
411  static const u32 ar9300PciePhy_pll_on_clkreq_disable_L1_2p0[][2] = {
412 +       /* Addr      allmodes  */
413         {0x00004040, 0x08212e5e},
414         {0x00004040, 0x0008003b},
415         {0x00004044, 0x00000000},
416  };
417  
418 -/*
419 - * PCIE-PHY programming array, to be used when not in
420 - * full sleep (holding RTC in reset)
421 - */
422  static const u32 ar9300PciePhy_clkreq_enable_L1_2p0[][2] = {
423 +       /* Addr      allmodes  */
424         {0x00004040, 0x08253e5e},
425         {0x00004040, 0x0008003b},
426         {0x00004044, 0x00000000},
427  };
428  
429 -/*
430 - * PCIE-PHY programming array, to be used prior to entering
431 - * full sleep (holding RTC in reset)
432 - */
433  static const u32 ar9300PciePhy_clkreq_disable_L1_2p0[][2] = {
434 +       /* Addr      allmodes  */
435         {0x00004040, 0x08213e5e},
436         {0x00004040, 0x0008003b},
437         {0x00004044, 0x00000000},
438 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
439 +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
440 @@ -311,6 +311,9 @@ static void ar9003_hw_set11n_txdesc(stru
441  {
442         struct ar9003_txc *ads = (struct ar9003_txc *) ds;
443  
444 +       if (txpower > ah->txpower_limit)
445 +               txpower = ah->txpower_limit;
446 +
447         txpower += ah->txpower_indexoffset;
448         if (txpower > 63)
449                 txpower = 63;
450 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
451 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
452 @@ -375,16 +375,7 @@ static u32 ar9003_hw_compute_pll_control
453         else if (chan && IS_CHAN_QUARTER_RATE(chan))
454                 pll |= SM(0x2, AR_RTC_9300_PLL_CLKSEL);
455  
456 -       if (chan && IS_CHAN_5GHZ(chan)) {
457 -               pll |= SM(0x28, AR_RTC_9300_PLL_DIV);
458 -
459 -               /*
460 -                * When doing fast clock, set PLL to 0x142c
461 -                */
462 -               if (IS_CHAN_A_5MHZ_SPACED(chan))
463 -                       pll = 0x142c;
464 -       } else
465 -               pll |= SM(0x2c, AR_RTC_9300_PLL_DIV);
466 +       pll |= SM(0x2c, AR_RTC_9300_PLL_DIV);
467  
468         return pll;
469  }
470 @@ -592,7 +583,7 @@ static int ar9003_hw_process_ini(struct 
471          * For 5GHz channels requiring Fast Clock, apply
472          * different modal values.
473          */
474 -       if (IS_CHAN_A_5MHZ_SPACED(chan))
475 +       if (IS_CHAN_A_FAST_CLOCK(ah, chan))
476                 REG_WRITE_ARRAY(&ah->iniModesAdditional,
477                                 modesIndex, regWrites);
478  
479 @@ -622,7 +613,7 @@ static void ar9003_hw_set_rfmode(struct 
480         rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan))
481                 ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM;
482  
483 -       if (IS_CHAN_A_5MHZ_SPACED(chan))
484 +       if (IS_CHAN_A_FAST_CLOCK(ah, chan))
485                 rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE);
486  
487         REG_WRITE(ah, AR_PHY_MODE, rfMode);
488 @@ -1102,6 +1093,7 @@ static void ar9003_hw_loadnf(struct ath_
489                 ath_print(common, ATH_DBG_ANY, "Timeout while waiting for nf "
490                           "to load: AR_PHY_AGC_CONTROL=0x%x\n",
491                           REG_READ(ah, AR_PHY_AGC_CONTROL));
492 +               return;
493         }
494  
495         /*
496 --- a/drivers/net/wireless/ath/ath9k/eeprom.h
497 +++ b/drivers/net/wireless/ath/ath9k/eeprom.h
498 @@ -300,7 +300,8 @@ struct base_eep_header {
499         u32 binBuildNumber;
500         u8 deviceType;
501         u8 pwdclkind;
502 -       u8 futureBase_1[2];
503 +       u8 fastClk5g;
504 +       u8 divChain;
505         u8 rxGainType;
506         u8 dacHiPwrMode_5G;
507         u8 openLoopPwrCntl;
508 --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
509 +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
510 @@ -274,6 +274,8 @@ static u32 ath9k_hw_def_get_eeprom(struc
511                 return pBase->txMask;
512         case EEP_RX_MASK:
513                 return pBase->rxMask;
514 +       case EEP_FSTCLK_5G:
515 +               return pBase->fastClk5g;
516         case EEP_RXGAIN_TYPE:
517                 return pBase->rxGainType;
518         case EEP_TXGAIN_TYPE:
519 --- a/drivers/net/wireless/ath/ath9k/hw.c
520 +++ b/drivers/net/wireless/ath/ath9k/hw.c
521 @@ -29,6 +29,7 @@
522  #define ATH9K_CLOCK_RATE_CCK           22
523  #define ATH9K_CLOCK_RATE_5GHZ_OFDM     40
524  #define ATH9K_CLOCK_RATE_2GHZ_OFDM     44
525 +#define ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM 44
526  
527  static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type);
528  
529 @@ -94,7 +95,11 @@ static u32 ath9k_hw_mac_clks(struct ath_
530                 return usecs *ATH9K_CLOCK_RATE_CCK;
531         if (conf->channel->band == IEEE80211_BAND_2GHZ)
532                 return usecs *ATH9K_CLOCK_RATE_2GHZ_OFDM;
533 -       return usecs *ATH9K_CLOCK_RATE_5GHZ_OFDM;
534 +
535 +       if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)
536 +               return usecs * ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM;
537 +       else
538 +               return usecs * ATH9K_CLOCK_RATE_5GHZ_OFDM;
539  }
540  
541  static u32 ath9k_hw_mac_to_clks(struct ath_hw *ah, u32 usecs)
542 @@ -390,6 +395,12 @@ static void ath9k_hw_init_config(struct 
543         ah->config.rx_intr_mitigation = true;
544  
545         /*
546 +        * Tx IQ Calibration (ah->config.tx_iq_calibration) is only
547 +        * used by AR9003, but it is showing reliability issues.
548 +        * It will take a while to fix so this is currently disabled.
549 +        */
550 +
551 +       /*
552          * We need this for PCI devices only (Cardbus, PCI, miniPCI)
553          * _and_ if on non-uniprocessor systems (Multiprocessor/HT).
554          * This means we use it for all AR5416 devices, and the few
555 @@ -1233,8 +1244,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
556             (chan->channel != ah->curchan->channel) &&
557             ((chan->channelFlags & CHANNEL_ALL) ==
558              (ah->curchan->channelFlags & CHANNEL_ALL)) &&
559 -            !(AR_SREV_9280(ah) || IS_CHAN_A_5MHZ_SPACED(chan) ||
560 -            IS_CHAN_A_5MHZ_SPACED(ah->curchan))) {
561 +           !AR_SREV_9280(ah)) {
562  
563                 if (ath9k_hw_channel_change(ah, chan)) {
564                         ath9k_hw_loadnf(ah, ah->curchan);
565 @@ -2198,7 +2208,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw
566         }
567  
568         if (AR_SREV_9300_20_OR_LATER(ah)) {
569 -               pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_LDPC;
570 +               pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_LDPC |
571 +                                ATH9K_HW_CAP_FASTCLOCK;
572                 pCap->rx_hp_qdepth = ATH9K_HW_RX_HP_QDEPTH;
573                 pCap->rx_lp_qdepth = ATH9K_HW_RX_LP_QDEPTH;
574                 pCap->rx_status_len = sizeof(struct ar9003_rxs);
575 @@ -2206,6 +2217,11 @@ int ath9k_hw_fill_cap_info(struct ath_hw
576                 pCap->txs_len = sizeof(struct ar9003_txs);
577         } else {
578                 pCap->tx_desc_len = sizeof(struct ath_desc);
579 +               if (AR_SREV_9280_20(ah) &&
580 +                   ((ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) <=
581 +                     AR5416_EEP_MINOR_VER_16) ||
582 +                    ah->eep_ops->get_eeprom(ah, EEP_FSTCLK_5G)))
583 +                       pCap->hw_caps |= ATH9K_HW_CAP_FASTCLOCK;
584         }
585  
586         if (AR_SREV_9300_20_OR_LATER(ah))
587 --- a/drivers/net/wireless/ath/ath9k/hw.h
588 +++ b/drivers/net/wireless/ath/ath9k/hw.h
589 @@ -198,6 +198,7 @@ enum ath9k_hw_caps {
590         ATH9K_HW_CAP_EDMA                       = BIT(17),
591         ATH9K_HW_CAP_RAC_SUPPORTED              = BIT(18),
592         ATH9K_HW_CAP_LDPC                       = BIT(19),
593 +       ATH9K_HW_CAP_FASTCLOCK                  = BIT(20),
594  };
595  
596  enum ath9k_capability_type {
597 @@ -261,6 +262,7 @@ struct ath9k_ops_config {
598  #define AR_BASE_FREQ_5GHZ      4900
599  #define AR_SPUR_FEEQ_BOUND_HT40 19
600  #define AR_SPUR_FEEQ_BOUND_HT20 10
601 +       bool tx_iq_calibration; /* Only available for >= AR9003 */
602         int spurmode;
603         u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
604         u8 max_txtrig_level;
605 @@ -367,10 +369,9 @@ struct ath9k_channel {
606  #define IS_CHAN_2GHZ(_c) (((_c)->channelFlags & CHANNEL_2GHZ) != 0)
607  #define IS_CHAN_HALF_RATE(_c) (((_c)->channelFlags & CHANNEL_HALF) != 0)
608  #define IS_CHAN_QUARTER_RATE(_c) (((_c)->channelFlags & CHANNEL_QUARTER) != 0)
609 -#define IS_CHAN_A_5MHZ_SPACED(_c)                      \
610 +#define IS_CHAN_A_FAST_CLOCK(_ah, _c)                  \
611         ((((_c)->channelFlags & CHANNEL_5GHZ) != 0) &&  \
612 -        (((_c)->channel % 20) != 0) &&                 \
613 -        (((_c)->channel % 10) != 0))
614 +        ((_ah)->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK))
615  
616  /* These macros check chanmode and not channelFlags */
617  #define IS_CHAN_B(_c) ((_c)->chanmode == CHANNEL_B)
618 @@ -718,6 +719,7 @@ struct ath_hw {
619         u32 *addac5416_21;
620         u32 *bank6Temp;
621  
622 +       u8 txpower_limit;
623         int16_t txpower_indexoffset;
624         int coverage_class;
625         u32 beacon_interval;
626 --- a/drivers/net/wireless/ath/ath9k/mac.c
627 +++ b/drivers/net/wireless/ath/ath9k/mac.c
628 @@ -878,10 +878,12 @@ enum ath9k_int ath9k_hw_set_interrupts(s
629         if (ints & ATH9K_INT_TX) {
630                 if (ah->config.tx_intr_mitigation)
631                         mask |= AR_IMR_TXMINTR | AR_IMR_TXINTM;
632 -               if (ah->txok_interrupt_mask)
633 -                       mask |= AR_IMR_TXOK;
634 -               if (ah->txdesc_interrupt_mask)
635 -                       mask |= AR_IMR_TXDESC;
636 +               else {
637 +                       if (ah->txok_interrupt_mask)
638 +                               mask |= AR_IMR_TXOK;
639 +                       if (ah->txdesc_interrupt_mask)
640 +                               mask |= AR_IMR_TXDESC;
641 +               }
642                 if (ah->txerr_interrupt_mask)
643                         mask |= AR_IMR_TXERR;
644                 if (ah->txeol_interrupt_mask)
645 --- a/drivers/net/wireless/ath/ath9k/xmit.c
646 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
647 @@ -2291,6 +2291,8 @@ void ath_tx_edma_tasklet(struct ath_soft
648                         ath_tx_complete_buf(sc, bf, txq, &bf_head,
649                                             &txs, txok, 0);
650  
651 +               ath_wake_mac80211_queue(sc, txq);
652 +
653                 spin_lock_bh(&txq->axq_lock);
654                 if (!list_empty(&txq->txq_fifo_pending)) {
655                         INIT_LIST_HEAD(&bf_head);