1 --- a/drivers/net/wireless/ath/ath10k/mac.c
2 +++ b/drivers/net/wireless/ath/ath10k/mac.c
3 @@ -1351,12 +1351,12 @@ static int ath10k_update_channel_list(st
7 - !(channel->flags & IEEE80211_CHAN_NO_IBSS);
8 + !(channel->flags & IEEE80211_CHAN_NO_IR);
11 !(channel->flags & IEEE80211_CHAN_NO_HT40PLUS);
13 - passive = channel->flags & IEEE80211_CHAN_PASSIVE_SCAN;
14 + passive = channel->flags & IEEE80211_CHAN_NO_IR;
15 ch->passive = passive;
17 ch->freq = channel->center_freq;
18 --- a/drivers/net/wireless/ath/ath9k/Kconfig
19 +++ b/drivers/net/wireless/ath/ath9k/Kconfig
20 @@ -90,7 +90,7 @@ config ATH9K_DFS_CERTIFIED
23 bool "Atheros ath9k TX99 testing support"
24 - depends on CFG80211_CERTIFICATION_ONUS
25 + depends on ATH9K_DEBUGFS && CFG80211_CERTIFICATION_ONUS
28 Say N. This should only be enabled on systems undergoing
29 @@ -108,6 +108,14 @@ config ATH9K_TX99
30 be evaluated to meet the RF exposure limits set forth in the
31 governmental SAR regulations.
34 + bool "Wake on Wireless LAN support (EXPERIMENTAL)"
35 + depends on ATH9K && PM
38 + This option enables Wake on Wireless LAN support for certain cards.
39 + Currently, AR9462 is supported.
41 config ATH9K_LEGACY_RATE_CONTROL
42 bool "Atheros ath9k rate control"
44 --- a/drivers/net/wireless/ath/ath9k/Makefile
45 +++ b/drivers/net/wireless/ath/ath9k/Makefile
46 @@ -13,9 +13,9 @@ ath9k-$(CPTCFG_ATH9K_PCI) += pci.o
47 ath9k-$(CPTCFG_ATH9K_AHB) += ahb.o
48 ath9k-$(CPTCFG_ATH9K_DEBUGFS) += debug.o
49 ath9k-$(CPTCFG_ATH9K_DFS_DEBUGFS) += dfs_debug.o
50 -ath9k-$(CPTCFG_ATH9K_DFS_CERTIFIED) += \
52 -ath9k-$(CONFIG_PM_SLEEP) += wow.o
53 +ath9k-$(CPTCFG_ATH9K_DFS_CERTIFIED) += dfs.o
54 +ath9k-$(CPTCFG_ATH9K_TX99) += tx99.o
55 +ath9k-$(CPTCFG_ATH9K_WOW) += wow.o
57 obj-$(CPTCFG_ATH9K) += ath9k.o
59 @@ -41,6 +41,8 @@ ath9k_hw-y:= \
63 +ath9k_hw-$(CPTCFG_ATH9K_WOW) += ar9003_wow.o
65 ath9k_hw-$(CPTCFG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \
67 obj-$(CPTCFG_ATH9K_HW) += ath9k_hw.o
68 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
69 +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
72 #include "ar9003_mac.h"
73 #include "ar9003_2p2_initvals.h"
74 +#include "ar9003_buffalo_initvals.h"
75 #include "ar9485_initvals.h"
76 #include "ar9340_initvals.h"
77 #include "ar9330_1p1_initvals.h"
79 #include "ar9462_2p0_initvals.h"
80 #include "ar9462_2p1_initvals.h"
81 #include "ar9565_1p0_initvals.h"
82 +#include "ar9565_1p1_initvals.h"
84 /* General hardware code for the AR9003 hadware family */
86 @@ -148,7 +150,11 @@ static void ar9003_hw_init_mode_regs(str
87 ar9340Modes_high_ob_db_tx_gain_table_1p0);
89 INIT_INI_ARRAY(&ah->iniModesFastClock,
90 - ar9340Modes_fast_clock_1p0);
91 + ar9340Modes_fast_clock_1p0);
92 + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
93 + ar9340_1p0_baseband_core_txfir_coeff_japan_2484);
94 + INIT_INI_ARRAY(&ah->ini_dfs,
95 + ar9340_1p0_baseband_postamble_dfs_channel);
97 if (!ah->is_clk_25mhz)
98 INIT_INI_ARRAY(&ah->iniAdditional,
99 @@ -187,17 +193,17 @@ static void ar9003_hw_init_mode_regs(str
100 INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
101 ar9485_1_1_baseband_core_txfir_coeff_japan_2484);
103 - /* Load PCIE SERDES settings from INI */
105 - /* Awake Setting */
107 - INIT_INI_ARRAY(&ah->iniPcieSerdes,
108 - ar9485_1_1_pcie_phy_clkreq_disable_L1);
110 - /* Sleep Setting */
112 - INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
113 - ar9485_1_1_pcie_phy_clkreq_disable_L1);
114 + if (ah->config.no_pll_pwrsave) {
115 + INIT_INI_ARRAY(&ah->iniPcieSerdes,
116 + ar9485_1_1_pcie_phy_clkreq_disable_L1);
117 + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
118 + ar9485_1_1_pcie_phy_clkreq_disable_L1);
120 + INIT_INI_ARRAY(&ah->iniPcieSerdes,
121 + ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
122 + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
123 + ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
125 } else if (AR_SREV_9462_21(ah)) {
126 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
127 ar9462_2p1_mac_core);
128 @@ -223,6 +229,10 @@ static void ar9003_hw_init_mode_regs(str
129 ar9462_2p1_modes_fast_clock);
130 INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
131 ar9462_2p1_baseband_core_txfir_coeff_japan_2484);
132 + INIT_INI_ARRAY(&ah->iniPcieSerdes,
133 + ar9462_2p1_pciephy_clkreq_disable_L1);
134 + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
135 + ar9462_2p1_pciephy_clkreq_disable_L1);
136 } else if (AR_SREV_9462_20(ah)) {
138 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9462_2p0_mac_core);
139 @@ -247,18 +257,18 @@ static void ar9003_hw_init_mode_regs(str
140 ar9462_2p0_soc_postamble);
142 INIT_INI_ARRAY(&ah->iniModesRxGain,
143 - ar9462_common_rx_gain_table_2p0);
144 + ar9462_2p0_common_rx_gain);
146 /* Awake -> Sleep Setting */
147 INIT_INI_ARRAY(&ah->iniPcieSerdes,
148 - ar9462_pciephy_clkreq_disable_L1_2p0);
149 + ar9462_2p0_pciephy_clkreq_disable_L1);
150 /* Sleep -> Awake Setting */
151 INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
152 - ar9462_pciephy_clkreq_disable_L1_2p0);
153 + ar9462_2p0_pciephy_clkreq_disable_L1);
155 /* Fast clock modal settings */
156 INIT_INI_ARRAY(&ah->iniModesFastClock,
157 - ar9462_modes_fast_clock_2p0);
158 + ar9462_2p0_modes_fast_clock);
160 INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
161 ar9462_2p0_baseband_core_txfir_coeff_japan_2484);
162 @@ -330,7 +340,46 @@ static void ar9003_hw_init_mode_regs(str
163 ar9580_1p0_low_ob_db_tx_gain_table);
165 INIT_INI_ARRAY(&ah->iniModesFastClock,
166 - ar9580_1p0_modes_fast_clock);
167 + ar9580_1p0_modes_fast_clock);
168 + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
169 + ar9580_1p0_baseband_core_txfir_coeff_japan_2484);
170 + INIT_INI_ARRAY(&ah->ini_dfs,
171 + ar9580_1p0_baseband_postamble_dfs_channel);
172 + } else if (AR_SREV_9565_11_OR_LATER(ah)) {
173 + INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
174 + ar9565_1p1_mac_core);
175 + INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST],
176 + ar9565_1p1_mac_postamble);
178 + INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE],
179 + ar9565_1p1_baseband_core);
180 + INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST],
181 + ar9565_1p1_baseband_postamble);
183 + INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE],
184 + ar9565_1p1_radio_core);
185 + INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST],
186 + ar9565_1p1_radio_postamble);
188 + INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE],
189 + ar9565_1p1_soc_preamble);
190 + INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST],
191 + ar9565_1p1_soc_postamble);
193 + INIT_INI_ARRAY(&ah->iniModesRxGain,
194 + ar9565_1p1_Common_rx_gain_table);
195 + INIT_INI_ARRAY(&ah->iniModesTxGain,
196 + ar9565_1p1_Modes_lowest_ob_db_tx_gain_table);
198 + INIT_INI_ARRAY(&ah->iniPcieSerdes,
199 + ar9565_1p1_pciephy_clkreq_disable_L1);
200 + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
201 + ar9565_1p1_pciephy_clkreq_disable_L1);
203 + INIT_INI_ARRAY(&ah->iniModesFastClock,
204 + ar9565_1p1_modes_fast_clock);
205 + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
206 + ar9565_1p1_baseband_core_txfir_coeff_japan_2484);
207 } else if (AR_SREV_9565(ah)) {
208 INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
209 ar9565_1p0_mac_core);
210 @@ -411,7 +460,11 @@ static void ar9003_hw_init_mode_regs(str
212 /* Fast clock modal settings */
213 INIT_INI_ARRAY(&ah->iniModesFastClock,
214 - ar9300Modes_fast_clock_2p2);
215 + ar9300Modes_fast_clock_2p2);
216 + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
217 + ar9300_2p2_baseband_core_txfir_coeff_japan_2484);
218 + INIT_INI_ARRAY(&ah->ini_dfs,
219 + ar9300_2p2_baseband_postamble_dfs_channel);
223 @@ -440,7 +493,10 @@ static void ar9003_tx_gain_table_mode0(s
224 ar9462_2p1_modes_low_ob_db_tx_gain);
225 else if (AR_SREV_9462_20(ah))
226 INIT_INI_ARRAY(&ah->iniModesTxGain,
227 - ar9462_modes_low_ob_db_tx_gain_table_2p0);
228 + ar9462_2p0_modes_low_ob_db_tx_gain);
229 + else if (AR_SREV_9565_11(ah))
230 + INIT_INI_ARRAY(&ah->iniModesTxGain,
231 + ar9565_1p1_modes_low_ob_db_tx_gain_table);
232 else if (AR_SREV_9565(ah))
233 INIT_INI_ARRAY(&ah->iniModesTxGain,
234 ar9565_1p0_modes_low_ob_db_tx_gain_table);
235 @@ -474,7 +530,10 @@ static void ar9003_tx_gain_table_mode1(s
236 ar9462_2p1_modes_high_ob_db_tx_gain);
237 else if (AR_SREV_9462_20(ah))
238 INIT_INI_ARRAY(&ah->iniModesTxGain,
239 - ar9462_modes_high_ob_db_tx_gain_table_2p0);
240 + ar9462_2p0_modes_high_ob_db_tx_gain);
241 + else if (AR_SREV_9565_11(ah))
242 + INIT_INI_ARRAY(&ah->iniModesTxGain,
243 + ar9565_1p1_modes_high_ob_db_tx_gain_table);
244 else if (AR_SREV_9565(ah))
245 INIT_INI_ARRAY(&ah->iniModesTxGain,
246 ar9565_1p0_modes_high_ob_db_tx_gain_table);
247 @@ -500,6 +559,9 @@ static void ar9003_tx_gain_table_mode2(s
248 else if (AR_SREV_9580(ah))
249 INIT_INI_ARRAY(&ah->iniModesTxGain,
250 ar9580_1p0_low_ob_db_tx_gain_table);
251 + else if (AR_SREV_9565_11(ah))
252 + INIT_INI_ARRAY(&ah->iniModesTxGain,
253 + ar9565_1p1_modes_low_ob_db_tx_gain_table);
254 else if (AR_SREV_9565(ah))
255 INIT_INI_ARRAY(&ah->iniModesTxGain,
256 ar9565_1p0_modes_low_ob_db_tx_gain_table);
257 @@ -525,12 +587,20 @@ static void ar9003_tx_gain_table_mode3(s
258 else if (AR_SREV_9580(ah))
259 INIT_INI_ARRAY(&ah->iniModesTxGain,
260 ar9580_1p0_high_power_tx_gain_table);
261 + else if (AR_SREV_9565_11(ah))
262 + INIT_INI_ARRAY(&ah->iniModesTxGain,
263 + ar9565_1p1_modes_high_power_tx_gain_table);
264 else if (AR_SREV_9565(ah))
265 INIT_INI_ARRAY(&ah->iniModesTxGain,
266 ar9565_1p0_modes_high_power_tx_gain_table);
268 - INIT_INI_ARRAY(&ah->iniModesTxGain,
269 - ar9300Modes_high_power_tx_gain_table_2p2);
271 + if (ah->config.tx_gain_buffalo)
272 + INIT_INI_ARRAY(&ah->iniModesTxGain,
273 + ar9300Modes_high_power_tx_gain_table_buffalo);
275 + INIT_INI_ARRAY(&ah->iniModesTxGain,
276 + ar9300Modes_high_power_tx_gain_table_2p2);
280 static void ar9003_tx_gain_table_mode4(struct ath_hw *ah)
281 @@ -546,7 +616,7 @@ static void ar9003_tx_gain_table_mode4(s
282 ar9462_2p1_modes_mix_ob_db_tx_gain);
283 else if (AR_SREV_9462_20(ah))
284 INIT_INI_ARRAY(&ah->iniModesTxGain,
285 - ar9462_modes_mix_ob_db_tx_gain_table_2p0);
286 + ar9462_2p0_modes_mix_ob_db_tx_gain);
288 INIT_INI_ARRAY(&ah->iniModesTxGain,
289 ar9300Modes_mixed_ob_db_tx_gain_table_2p2);
290 @@ -581,6 +651,13 @@ static void ar9003_tx_gain_table_mode6(s
291 ar9580_1p0_type6_tx_gain_table);
294 +static void ar9003_tx_gain_table_mode7(struct ath_hw *ah)
296 + if (AR_SREV_9340(ah))
297 + INIT_INI_ARRAY(&ah->iniModesTxGain,
298 + ar9340_cus227_tx_gain_table_1p0);
301 typedef void (*ath_txgain_tab)(struct ath_hw *ah);
303 static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
304 @@ -593,6 +670,7 @@ static void ar9003_tx_gain_table_apply(s
305 ar9003_tx_gain_table_mode4,
306 ar9003_tx_gain_table_mode5,
307 ar9003_tx_gain_table_mode6,
308 + ar9003_tx_gain_table_mode7,
310 int idx = ar9003_hw_get_tx_gain_idx(ah);
312 @@ -629,7 +707,10 @@ static void ar9003_rx_gain_table_mode0(s
313 ar9462_2p1_common_rx_gain);
314 else if (AR_SREV_9462_20(ah))
315 INIT_INI_ARRAY(&ah->iniModesRxGain,
316 - ar9462_common_rx_gain_table_2p0);
317 + ar9462_2p0_common_rx_gain);
318 + else if (AR_SREV_9565_11(ah))
319 + INIT_INI_ARRAY(&ah->iniModesRxGain,
320 + ar9565_1p1_Common_rx_gain_table);
321 else if (AR_SREV_9565(ah))
322 INIT_INI_ARRAY(&ah->iniModesRxGain,
323 ar9565_1p0_Common_rx_gain_table);
324 @@ -657,7 +738,7 @@ static void ar9003_rx_gain_table_mode1(s
325 ar9462_2p1_common_wo_xlna_rx_gain);
326 else if (AR_SREV_9462_20(ah))
327 INIT_INI_ARRAY(&ah->iniModesRxGain,
328 - ar9462_common_wo_xlna_rx_gain_table_2p0);
329 + ar9462_2p0_common_wo_xlna_rx_gain);
330 else if (AR_SREV_9550(ah)) {
331 INIT_INI_ARRAY(&ah->iniModesRxGain,
332 ar955x_1p0_common_wo_xlna_rx_gain_table);
333 @@ -666,6 +747,9 @@ static void ar9003_rx_gain_table_mode1(s
334 } else if (AR_SREV_9580(ah))
335 INIT_INI_ARRAY(&ah->iniModesRxGain,
336 ar9580_1p0_wo_xlna_rx_gain_table);
337 + else if (AR_SREV_9565_11(ah))
338 + INIT_INI_ARRAY(&ah->iniModesRxGain,
339 + ar9565_1p1_common_wo_xlna_rx_gain_table);
340 else if (AR_SREV_9565(ah))
341 INIT_INI_ARRAY(&ah->iniModesRxGain,
342 ar9565_1p0_common_wo_xlna_rx_gain_table);
343 @@ -687,7 +771,7 @@ static void ar9003_rx_gain_table_mode2(s
344 ar9462_2p1_baseband_postamble_5g_xlna);
345 } else if (AR_SREV_9462_20(ah)) {
346 INIT_INI_ARRAY(&ah->iniModesRxGain,
347 - ar9462_common_mixed_rx_gain_table_2p0);
348 + ar9462_2p0_common_mixed_rx_gain);
349 INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_core,
350 ar9462_2p0_baseband_core_mix_rxgain);
351 INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_postamble,
352 @@ -701,12 +785,12 @@ static void ar9003_rx_gain_table_mode3(s
354 if (AR_SREV_9462_21(ah)) {
355 INIT_INI_ARRAY(&ah->iniModesRxGain,
356 - ar9462_2p1_common_5g_xlna_only_rx_gain);
357 + ar9462_2p1_common_5g_xlna_only_rxgain);
358 INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna,
359 ar9462_2p1_baseband_postamble_5g_xlna);
360 } else if (AR_SREV_9462_20(ah)) {
361 INIT_INI_ARRAY(&ah->iniModesRxGain,
362 - ar9462_2p0_5g_xlna_only_rxgain);
363 + ar9462_2p0_common_5g_xlna_only_rxgain);
364 INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna,
365 ar9462_2p0_baseband_postamble_5g_xlna);
367 @@ -750,6 +834,9 @@ static void ar9003_hw_init_mode_gain_reg
368 static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
372 + struct ar5416IniArray *array;
375 * Increase L1 Entry Latency. Some WB222 boards don't have
376 * this change in eeprom/OTP.
377 @@ -775,18 +862,13 @@ static void ar9003_hw_configpcipowersave
378 * Configire PCIE after Ini init. SERDES values now come from ini file
379 * This enables PCIe low power mode.
381 - if (ah->config.pcieSerDesWrite) {
383 - struct ar5416IniArray *array;
385 - array = power_off ? &ah->iniPcieSerdes :
386 - &ah->iniPcieSerdesLowPower;
388 - for (i = 0; i < array->ia_rows; i++) {
390 - INI_RA(array, i, 0),
391 - INI_RA(array, i, 1));
393 + array = power_off ? &ah->iniPcieSerdes :
394 + &ah->iniPcieSerdesLowPower;
396 + for (i = 0; i < array->ia_rows; i++) {
398 + INI_RA(array, i, 0),
399 + INI_RA(array, i, 1));
403 --- a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
404 +++ b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
406 #ifndef INITVALS_9340_H
407 #define INITVALS_9340_H
409 +#define ar9340_1p0_mac_postamble ar9300_2p2_mac_postamble
411 +#define ar9340_1p0_soc_postamble ar9300_2p2_soc_postamble
413 +#define ar9340Modes_fast_clock_1p0 ar9300Modes_fast_clock_2p2
415 +#define ar9340Common_rx_gain_table_1p0 ar9300Common_rx_gain_table_2p2
417 +#define ar9340Common_wo_xlna_rx_gain_table_1p0 ar9300Common_wo_xlna_rx_gain_table_2p2
419 +#define ar9340_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
421 +#define ar9340_1p0_baseband_postamble_dfs_channel ar9300_2p2_baseband_postamble_dfs_channel
423 static const u32 ar9340_1p0_radio_postamble[][5] = {
424 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
425 {0x000160ac, 0xa4646800, 0xa4646800, 0xa4646800, 0xa4646800},
426 @@ -100,8 +114,6 @@ static const u32 ar9340Modes_lowest_ob_d
427 {0x00016448, 0x24925266, 0x24925266, 0x24925266, 0x24925266},
430 -#define ar9340Modes_fast_clock_1p0 ar9300Modes_fast_clock_2p2
432 static const u32 ar9340_1p0_radio_core[][2] = {
434 {0x00016000, 0x36db6db6},
435 @@ -215,16 +227,12 @@ static const u32 ar9340_1p0_radio_core_4
436 {0x0000824c, 0x0001e800},
439 -#define ar9340_1p0_mac_postamble ar9300_2p2_mac_postamble
441 -#define ar9340_1p0_soc_postamble ar9300_2p2_soc_postamble
443 static const u32 ar9340_1p0_baseband_postamble[][5] = {
444 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
445 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
446 {0x00009820, 0x206a022e, 0x206a022e, 0x206a022e, 0x206a022e},
447 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
448 - {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
449 + {0x00009828, 0x06903081, 0x06903081, 0x09103881, 0x09103881},
450 {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
451 {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
452 {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
453 @@ -340,9 +348,9 @@ static const u32 ar9340_1p0_baseband_cor
454 {0x0000a370, 0x00000000},
455 {0x0000a390, 0x00000001},
456 {0x0000a394, 0x00000444},
457 - {0x0000a398, 0x001f0e0f},
458 - {0x0000a39c, 0x0075393f},
459 - {0x0000a3a0, 0xb79f6427},
460 + {0x0000a398, 0x00000000},
461 + {0x0000a39c, 0x210d0401},
462 + {0x0000a3a0, 0xab9a7144},
463 {0x0000a3a4, 0x00000000},
464 {0x0000a3a8, 0xaaaaaaaa},
465 {0x0000a3ac, 0x3c466478},
466 @@ -714,266 +722,6 @@ static const u32 ar9340Modes_ub124_tx_ga
467 {0x0000b2e8, 0xfffe0000, 0xfffe0000, 0xfffc0000, 0xfffc0000},
470 -static const u32 ar9340Common_rx_gain_table_1p0[][2] = {
471 - /* Addr allmodes */
472 - {0x0000a000, 0x00010000},
473 - {0x0000a004, 0x00030002},
474 - {0x0000a008, 0x00050004},
475 - {0x0000a00c, 0x00810080},
476 - {0x0000a010, 0x00830082},
477 - {0x0000a014, 0x01810180},
478 - {0x0000a018, 0x01830182},
479 - {0x0000a01c, 0x01850184},
480 - {0x0000a020, 0x01890188},
481 - {0x0000a024, 0x018b018a},
482 - {0x0000a028, 0x018d018c},
483 - {0x0000a02c, 0x01910190},
484 - {0x0000a030, 0x01930192},
485 - {0x0000a034, 0x01950194},
486 - {0x0000a038, 0x038a0196},
487 - {0x0000a03c, 0x038c038b},
488 - {0x0000a040, 0x0390038d},
489 - {0x0000a044, 0x03920391},
490 - {0x0000a048, 0x03940393},
491 - {0x0000a04c, 0x03960395},
492 - {0x0000a050, 0x00000000},
493 - {0x0000a054, 0x00000000},
494 - {0x0000a058, 0x00000000},
495 - {0x0000a05c, 0x00000000},
496 - {0x0000a060, 0x00000000},
497 - {0x0000a064, 0x00000000},
498 - {0x0000a068, 0x00000000},
499 - {0x0000a06c, 0x00000000},
500 - {0x0000a070, 0x00000000},
501 - {0x0000a074, 0x00000000},
502 - {0x0000a078, 0x00000000},
503 - {0x0000a07c, 0x00000000},
504 - {0x0000a080, 0x22222229},
505 - {0x0000a084, 0x1d1d1d1d},
506 - {0x0000a088, 0x1d1d1d1d},
507 - {0x0000a08c, 0x1d1d1d1d},
508 - {0x0000a090, 0x171d1d1d},
509 - {0x0000a094, 0x11111717},
510 - {0x0000a098, 0x00030311},
511 - {0x0000a09c, 0x00000000},
512 - {0x0000a0a0, 0x00000000},
513 - {0x0000a0a4, 0x00000000},
514 - {0x0000a0a8, 0x00000000},
515 - {0x0000a0ac, 0x00000000},
516 - {0x0000a0b0, 0x00000000},
517 - {0x0000a0b4, 0x00000000},
518 - {0x0000a0b8, 0x00000000},
519 - {0x0000a0bc, 0x00000000},
520 - {0x0000a0c0, 0x001f0000},
521 - {0x0000a0c4, 0x01000101},
522 - {0x0000a0c8, 0x011e011f},
523 - {0x0000a0cc, 0x011c011d},
524 - {0x0000a0d0, 0x02030204},
525 - {0x0000a0d4, 0x02010202},
526 - {0x0000a0d8, 0x021f0200},
527 - {0x0000a0dc, 0x0302021e},
528 - {0x0000a0e0, 0x03000301},
529 - {0x0000a0e4, 0x031e031f},
530 - {0x0000a0e8, 0x0402031d},
531 - {0x0000a0ec, 0x04000401},
532 - {0x0000a0f0, 0x041e041f},
533 - {0x0000a0f4, 0x0502041d},
534 - {0x0000a0f8, 0x05000501},
535 - {0x0000a0fc, 0x051e051f},
536 - {0x0000a100, 0x06010602},
537 - {0x0000a104, 0x061f0600},
538 - {0x0000a108, 0x061d061e},
539 - {0x0000a10c, 0x07020703},
540 - {0x0000a110, 0x07000701},
541 - {0x0000a114, 0x00000000},
542 - {0x0000a118, 0x00000000},
543 - {0x0000a11c, 0x00000000},
544 - {0x0000a120, 0x00000000},
545 - {0x0000a124, 0x00000000},
546 - {0x0000a128, 0x00000000},
547 - {0x0000a12c, 0x00000000},
548 - {0x0000a130, 0x00000000},
549 - {0x0000a134, 0x00000000},
550 - {0x0000a138, 0x00000000},
551 - {0x0000a13c, 0x00000000},
552 - {0x0000a140, 0x001f0000},
553 - {0x0000a144, 0x01000101},
554 - {0x0000a148, 0x011e011f},
555 - {0x0000a14c, 0x011c011d},
556 - {0x0000a150, 0x02030204},
557 - {0x0000a154, 0x02010202},
558 - {0x0000a158, 0x021f0200},
559 - {0x0000a15c, 0x0302021e},
560 - {0x0000a160, 0x03000301},
561 - {0x0000a164, 0x031e031f},
562 - {0x0000a168, 0x0402031d},
563 - {0x0000a16c, 0x04000401},
564 - {0x0000a170, 0x041e041f},
565 - {0x0000a174, 0x0502041d},
566 - {0x0000a178, 0x05000501},
567 - {0x0000a17c, 0x051e051f},
568 - {0x0000a180, 0x06010602},
569 - {0x0000a184, 0x061f0600},
570 - {0x0000a188, 0x061d061e},
571 - {0x0000a18c, 0x07020703},
572 - {0x0000a190, 0x07000701},
573 - {0x0000a194, 0x00000000},
574 - {0x0000a198, 0x00000000},
575 - {0x0000a19c, 0x00000000},
576 - {0x0000a1a0, 0x00000000},
577 - {0x0000a1a4, 0x00000000},
578 - {0x0000a1a8, 0x00000000},
579 - {0x0000a1ac, 0x00000000},
580 - {0x0000a1b0, 0x00000000},
581 - {0x0000a1b4, 0x00000000},
582 - {0x0000a1b8, 0x00000000},
583 - {0x0000a1bc, 0x00000000},
584 - {0x0000a1c0, 0x00000000},
585 - {0x0000a1c4, 0x00000000},
586 - {0x0000a1c8, 0x00000000},
587 - {0x0000a1cc, 0x00000000},
588 - {0x0000a1d0, 0x00000000},
589 - {0x0000a1d4, 0x00000000},
590 - {0x0000a1d8, 0x00000000},
591 - {0x0000a1dc, 0x00000000},
592 - {0x0000a1e0, 0x00000000},
593 - {0x0000a1e4, 0x00000000},
594 - {0x0000a1e8, 0x00000000},
595 - {0x0000a1ec, 0x00000000},
596 - {0x0000a1f0, 0x00000396},
597 - {0x0000a1f4, 0x00000396},
598 - {0x0000a1f8, 0x00000396},
599 - {0x0000a1fc, 0x00000196},
600 - {0x0000b000, 0x00010000},
601 - {0x0000b004, 0x00030002},
602 - {0x0000b008, 0x00050004},
603 - {0x0000b00c, 0x00810080},
604 - {0x0000b010, 0x00830082},
605 - {0x0000b014, 0x01810180},
606 - {0x0000b018, 0x01830182},
607 - {0x0000b01c, 0x01850184},
608 - {0x0000b020, 0x02810280},
609 - {0x0000b024, 0x02830282},
610 - {0x0000b028, 0x02850284},
611 - {0x0000b02c, 0x02890288},
612 - {0x0000b030, 0x028b028a},
613 - {0x0000b034, 0x0388028c},
614 - {0x0000b038, 0x038a0389},
615 - {0x0000b03c, 0x038c038b},
616 - {0x0000b040, 0x0390038d},
617 - {0x0000b044, 0x03920391},
618 - {0x0000b048, 0x03940393},
619 - {0x0000b04c, 0x03960395},
620 - {0x0000b050, 0x00000000},
621 - {0x0000b054, 0x00000000},
622 - {0x0000b058, 0x00000000},
623 - {0x0000b05c, 0x00000000},
624 - {0x0000b060, 0x00000000},
625 - {0x0000b064, 0x00000000},
626 - {0x0000b068, 0x00000000},
627 - {0x0000b06c, 0x00000000},
628 - {0x0000b070, 0x00000000},
629 - {0x0000b074, 0x00000000},
630 - {0x0000b078, 0x00000000},
631 - {0x0000b07c, 0x00000000},
632 - {0x0000b080, 0x23232323},
633 - {0x0000b084, 0x21232323},
634 - {0x0000b088, 0x19191c1e},
635 - {0x0000b08c, 0x12141417},
636 - {0x0000b090, 0x07070e0e},
637 - {0x0000b094, 0x03030305},
638 - {0x0000b098, 0x00000003},
639 - {0x0000b09c, 0x00000000},
640 - {0x0000b0a0, 0x00000000},
641 - {0x0000b0a4, 0x00000000},
642 - {0x0000b0a8, 0x00000000},
643 - {0x0000b0ac, 0x00000000},
644 - {0x0000b0b0, 0x00000000},
645 - {0x0000b0b4, 0x00000000},
646 - {0x0000b0b8, 0x00000000},
647 - {0x0000b0bc, 0x00000000},
648 - {0x0000b0c0, 0x003f0020},
649 - {0x0000b0c4, 0x00400041},
650 - {0x0000b0c8, 0x0140005f},
651 - {0x0000b0cc, 0x0160015f},
652 - {0x0000b0d0, 0x017e017f},
653 - {0x0000b0d4, 0x02410242},
654 - {0x0000b0d8, 0x025f0240},
655 - {0x0000b0dc, 0x027f0260},
656 - {0x0000b0e0, 0x0341027e},
657 - {0x0000b0e4, 0x035f0340},
658 - {0x0000b0e8, 0x037f0360},
659 - {0x0000b0ec, 0x04400441},
660 - {0x0000b0f0, 0x0460045f},
661 - {0x0000b0f4, 0x0541047f},
662 - {0x0000b0f8, 0x055f0540},
663 - {0x0000b0fc, 0x057f0560},
664 - {0x0000b100, 0x06400641},
665 - {0x0000b104, 0x0660065f},
666 - {0x0000b108, 0x067e067f},
667 - {0x0000b10c, 0x07410742},
668 - {0x0000b110, 0x075f0740},
669 - {0x0000b114, 0x077f0760},
670 - {0x0000b118, 0x07800781},
671 - {0x0000b11c, 0x07a0079f},
672 - {0x0000b120, 0x07c107bf},
673 - {0x0000b124, 0x000007c0},
674 - {0x0000b128, 0x00000000},
675 - {0x0000b12c, 0x00000000},
676 - {0x0000b130, 0x00000000},
677 - {0x0000b134, 0x00000000},
678 - {0x0000b138, 0x00000000},
679 - {0x0000b13c, 0x00000000},
680 - {0x0000b140, 0x003f0020},
681 - {0x0000b144, 0x00400041},
682 - {0x0000b148, 0x0140005f},
683 - {0x0000b14c, 0x0160015f},
684 - {0x0000b150, 0x017e017f},
685 - {0x0000b154, 0x02410242},
686 - {0x0000b158, 0x025f0240},
687 - {0x0000b15c, 0x027f0260},
688 - {0x0000b160, 0x0341027e},
689 - {0x0000b164, 0x035f0340},
690 - {0x0000b168, 0x037f0360},
691 - {0x0000b16c, 0x04400441},
692 - {0x0000b170, 0x0460045f},
693 - {0x0000b174, 0x0541047f},
694 - {0x0000b178, 0x055f0540},
695 - {0x0000b17c, 0x057f0560},
696 - {0x0000b180, 0x06400641},
697 - {0x0000b184, 0x0660065f},
698 - {0x0000b188, 0x067e067f},
699 - {0x0000b18c, 0x07410742},
700 - {0x0000b190, 0x075f0740},
701 - {0x0000b194, 0x077f0760},
702 - {0x0000b198, 0x07800781},
703 - {0x0000b19c, 0x07a0079f},
704 - {0x0000b1a0, 0x07c107bf},
705 - {0x0000b1a4, 0x000007c0},
706 - {0x0000b1a8, 0x00000000},
707 - {0x0000b1ac, 0x00000000},
708 - {0x0000b1b0, 0x00000000},
709 - {0x0000b1b4, 0x00000000},
710 - {0x0000b1b8, 0x00000000},
711 - {0x0000b1bc, 0x00000000},
712 - {0x0000b1c0, 0x00000000},
713 - {0x0000b1c4, 0x00000000},
714 - {0x0000b1c8, 0x00000000},
715 - {0x0000b1cc, 0x00000000},
716 - {0x0000b1d0, 0x00000000},
717 - {0x0000b1d4, 0x00000000},
718 - {0x0000b1d8, 0x00000000},
719 - {0x0000b1dc, 0x00000000},
720 - {0x0000b1e0, 0x00000000},
721 - {0x0000b1e4, 0x00000000},
722 - {0x0000b1e8, 0x00000000},
723 - {0x0000b1ec, 0x00000000},
724 - {0x0000b1f0, 0x00000396},
725 - {0x0000b1f4, 0x00000396},
726 - {0x0000b1f8, 0x00000396},
727 - {0x0000b1fc, 0x00000196},
730 static const u32 ar9340Modes_low_ob_db_tx_gain_table_1p0[][5] = {
731 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
732 {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
733 @@ -1437,8 +1185,6 @@ static const u32 ar9340_1p0_mac_core[][2
734 {0x000083d0, 0x000101ff},
737 -#define ar9340Common_wo_xlna_rx_gain_table_1p0 ar9300Common_wo_xlna_rx_gain_table_2p2
739 static const u32 ar9340_1p0_soc_preamble[][2] = {
741 {0x00007008, 0x00000000},
742 @@ -1447,4 +1193,106 @@ static const u32 ar9340_1p0_soc_preamble
743 {0x00007038, 0x000004c2},
746 +static const u32 ar9340_cus227_tx_gain_table_1p0[][5] = {
747 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
748 + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
749 + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
750 + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
751 + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
752 + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
753 + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
754 + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
755 + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
756 + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
757 + {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
758 + {0x0000a514, 0x1c000223, 0x1c000223, 0x11000400, 0x11000400},
759 + {0x0000a518, 0x21002220, 0x21002220, 0x15000402, 0x15000402},
760 + {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
761 + {0x0000a520, 0x2c022220, 0x2c022220, 0x1b000603, 0x1b000603},
762 + {0x0000a524, 0x30022222, 0x30022222, 0x1f000a02, 0x1f000a02},
763 + {0x0000a528, 0x35022225, 0x35022225, 0x23000a04, 0x23000a04},
764 + {0x0000a52c, 0x3b02222a, 0x3b02222a, 0x26000a20, 0x26000a20},
765 + {0x0000a530, 0x3f02222c, 0x3f02222c, 0x2a000e20, 0x2a000e20},
766 + {0x0000a534, 0x4202242a, 0x4202242a, 0x2e000e22, 0x2e000e22},
767 + {0x0000a538, 0x4702244a, 0x4702244a, 0x31000e24, 0x31000e24},
768 + {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x34001640, 0x34001640},
769 + {0x0000a540, 0x4e02246c, 0x4e02246c, 0x38001660, 0x38001660},
770 + {0x0000a544, 0x5302266c, 0x5302266c, 0x3b001861, 0x3b001861},
771 + {0x0000a548, 0x5702286c, 0x5702286c, 0x3e001a81, 0x3e001a81},
772 + {0x0000a54c, 0x5c02486b, 0x5c02486b, 0x42001a83, 0x42001a83},
773 + {0x0000a550, 0x61024a6c, 0x61024a6c, 0x44001c84, 0x44001c84},
774 + {0x0000a554, 0x66026a6c, 0x66026a6c, 0x48001ce3, 0x48001ce3},
775 + {0x0000a558, 0x6b026e6c, 0x6b026e6c, 0x4c001ce5, 0x4c001ce5},
776 + {0x0000a55c, 0x7002708c, 0x7002708c, 0x50001ce9, 0x50001ce9},
777 + {0x0000a560, 0x7302b08a, 0x7302b08a, 0x54001ceb, 0x54001ceb},
778 + {0x0000a564, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
779 + {0x0000a568, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
780 + {0x0000a56c, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
781 + {0x0000a570, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
782 + {0x0000a574, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
783 + {0x0000a578, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
784 + {0x0000a57c, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
785 + {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
786 + {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
787 + {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
788 + {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
789 + {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202},
790 + {0x0000a594, 0x1c800223, 0x1c800223, 0x11800400, 0x11800400},
791 + {0x0000a598, 0x21820220, 0x21820220, 0x15800402, 0x15800402},
792 + {0x0000a59c, 0x27820223, 0x27820223, 0x19800404, 0x19800404},
793 + {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1b800603, 0x1b800603},
794 + {0x0000a5a4, 0x2f822222, 0x2f822222, 0x1f800a02, 0x1f800a02},
795 + {0x0000a5a8, 0x34822225, 0x34822225, 0x23800a04, 0x23800a04},
796 + {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x26800a20, 0x26800a20},
797 + {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2a800e20, 0x2a800e20},
798 + {0x0000a5b4, 0x4282242a, 0x4282242a, 0x2e800e22, 0x2e800e22},
799 + {0x0000a5b8, 0x4782244a, 0x4782244a, 0x31800e24, 0x31800e24},
800 + {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x34801640, 0x34801640},
801 + {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x38801660, 0x38801660},
802 + {0x0000a5c4, 0x5382266c, 0x5382266c, 0x3b801861, 0x3b801861},
803 + {0x0000a5c8, 0x5782286c, 0x5782286c, 0x3e801a81, 0x3e801a81},
804 + {0x0000a5cc, 0x5c84286b, 0x5c84286b, 0x42801a83, 0x42801a83},
805 + {0x0000a5d0, 0x61842a6c, 0x61842a6c, 0x44801c84, 0x44801c84},
806 + {0x0000a5d4, 0x66862a6c, 0x66862a6c, 0x48801ce3, 0x48801ce3},
807 + {0x0000a5d8, 0x6b862e6c, 0x6b862e6c, 0x4c801ce5, 0x4c801ce5},
808 + {0x0000a5dc, 0x7086308c, 0x7086308c, 0x50801ce9, 0x50801ce9},
809 + {0x0000a5e0, 0x738a308a, 0x738a308a, 0x54801ceb, 0x54801ceb},
810 + {0x0000a5e4, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
811 + {0x0000a5e8, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
812 + {0x0000a5ec, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
813 + {0x0000a5f0, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
814 + {0x0000a5f4, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
815 + {0x0000a5f8, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
816 + {0x0000a5fc, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
817 + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
818 + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
819 + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
820 + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
821 + {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
822 + {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
823 + {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
824 + {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
825 + {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
826 + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
827 + {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
828 + {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
829 + {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
830 + {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
831 + {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
832 + {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
833 + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
834 + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
835 + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
836 + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
837 + {0x00016044, 0x056db2db, 0x056db2db, 0x03b6d2e4, 0x03b6d2e4},
838 + {0x00016048, 0x24925666, 0x24925666, 0x8e481266, 0x8e481266},
839 + {0x00016280, 0x01000015, 0x01000015, 0x01001015, 0x01001015},
840 + {0x00016288, 0x30318000, 0x30318000, 0x00318000, 0x00318000},
841 + {0x00016444, 0x056db2db, 0x056db2db, 0x03b6d2e4, 0x03b6d2e4},
842 + {0x00016448, 0x24925666, 0x24925666, 0x8e481266, 0x8e481266},
843 + {0x0000a3a4, 0x00000011, 0x00000011, 0x00000011, 0x00000011},
844 + {0x0000a3a8, 0x3c3c3c3c, 0x3c3c3c3c, 0x3c3c3c3c, 0x3c3c3c3c},
845 + {0x0000a3ac, 0x30303030, 0x30303030, 0x30303030, 0x30303030},
848 #endif /* INITVALS_9340_H */
849 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
850 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
851 @@ -459,6 +459,7 @@ void ath_check_ani(struct ath_softc *sc)
852 int ath_update_survey_stats(struct ath_softc *sc);
853 void ath_update_survey_nf(struct ath_softc *sc, int channel);
854 void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type);
855 +void ath_ps_full_sleep(unsigned long data);
859 @@ -570,6 +571,34 @@ static inline void ath_fill_led_pin(stru
863 +/************************/
864 +/* Wake on Wireless LAN */
865 +/************************/
867 +#ifdef CONFIG_ATH9K_WOW
868 +void ath9k_init_wow(struct ieee80211_hw *hw);
869 +int ath9k_suspend(struct ieee80211_hw *hw,
870 + struct cfg80211_wowlan *wowlan);
871 +int ath9k_resume(struct ieee80211_hw *hw);
872 +void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled);
874 +static inline void ath9k_init_wow(struct ieee80211_hw *hw)
877 +static inline int ath9k_suspend(struct ieee80211_hw *hw,
878 + struct cfg80211_wowlan *wowlan)
882 +static inline int ath9k_resume(struct ieee80211_hw *hw)
886 +static inline void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
889 +#endif /* CONFIG_ATH9K_WOW */
891 /*******************************/
892 /* Antenna diversity/combining */
893 /*******************************/
894 @@ -632,15 +661,16 @@ void ath_ant_comb_scan(struct ath_softc
895 /* Main driver core */
896 /********************/
898 -#define ATH9K_PCI_CUS198 0x0001
899 -#define ATH9K_PCI_CUS230 0x0002
900 -#define ATH9K_PCI_CUS217 0x0004
901 -#define ATH9K_PCI_CUS252 0x0008
902 -#define ATH9K_PCI_WOW 0x0010
903 -#define ATH9K_PCI_BT_ANT_DIV 0x0020
904 -#define ATH9K_PCI_D3_L1_WAR 0x0040
905 -#define ATH9K_PCI_AR9565_1ANT 0x0080
906 -#define ATH9K_PCI_AR9565_2ANT 0x0100
907 +#define ATH9K_PCI_CUS198 0x0001
908 +#define ATH9K_PCI_CUS230 0x0002
909 +#define ATH9K_PCI_CUS217 0x0004
910 +#define ATH9K_PCI_CUS252 0x0008
911 +#define ATH9K_PCI_WOW 0x0010
912 +#define ATH9K_PCI_BT_ANT_DIV 0x0020
913 +#define ATH9K_PCI_D3_L1_WAR 0x0040
914 +#define ATH9K_PCI_AR9565_1ANT 0x0080
915 +#define ATH9K_PCI_AR9565_2ANT 0x0100
916 +#define ATH9K_PCI_NO_PLL_PWRSAVE 0x0200
919 * Default cache line size, in bytes.
920 @@ -723,6 +753,7 @@ struct ath_softc {
921 struct work_struct hw_check_work;
922 struct work_struct hw_reset_work;
923 struct completion paprd_complete;
924 + wait_queue_head_t tx_wait;
926 unsigned int hw_busy_count;
927 unsigned long sc_flags;
928 @@ -759,6 +790,7 @@ struct ath_softc {
929 struct delayed_work tx_complete_work;
930 struct delayed_work hw_pll_work;
931 struct timer_list rx_poll_timer;
932 + struct timer_list sleep_timer;
934 #ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT
935 struct ath_btcoex btcoex;
936 @@ -783,7 +815,7 @@ struct ath_softc {
940 -#ifdef CONFIG_PM_SLEEP
941 +#ifdef CONFIG_ATH9K_WOW
942 atomic_t wow_got_bmiss_intr;
943 atomic_t wow_sleep_proc_intr; /* in the middle of WoW sleep ? */
944 u32 wow_intr_before_sleep;
945 @@ -946,10 +978,25 @@ struct fft_sample_ht20_40 {
946 u8 data[SPECTRAL_HT20_40_NUM_BINS];
949 -int ath9k_tx99_init(struct ath_softc *sc);
950 -void ath9k_tx99_deinit(struct ath_softc *sc);
955 +#ifdef CONFIG_ATH9K_TX99
956 +void ath9k_tx99_init_debug(struct ath_softc *sc);
957 int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb,
958 struct ath_tx_control *txctl);
960 +static inline void ath9k_tx99_init_debug(struct ath_softc *sc)
963 +static inline int ath9k_tx99_send(struct ath_softc *sc,
964 + struct sk_buff *skb,
965 + struct ath_tx_control *txctl)
969 +#endif /* CONFIG_ATH9K_TX99 */
971 void ath9k_tasklet(unsigned long data);
972 int ath_cabq_update(struct ath_softc *);
973 @@ -966,6 +1013,9 @@ extern bool is_ath9k_unloaded;
975 u8 ath9k_parse_mpdudensity(u8 mpdudensity);
976 irqreturn_t ath_isr(int irq, void *dev);
977 +int ath_reset(struct ath_softc *sc);
978 +void ath_cancel_work(struct ath_softc *sc);
979 +void ath_restart_work(struct ath_softc *sc);
980 int ath9k_init_device(u16 devid, struct ath_softc *sc,
981 const struct ath_bus_ops *bus_ops);
982 void ath9k_deinit_device(struct ath_softc *sc);
983 --- a/drivers/net/wireless/ath/ath9k/debug.c
984 +++ b/drivers/net/wireless/ath/ath9k/debug.c
985 @@ -1782,111 +1782,6 @@ void ath9k_deinit_debug(struct ath_softc
989 -static ssize_t read_file_tx99(struct file *file, char __user *user_buf,
990 - size_t count, loff_t *ppos)
992 - struct ath_softc *sc = file->private_data;
996 - len = sprintf(buf, "%d\n", sc->tx99_state);
997 - return simple_read_from_buffer(user_buf, count, ppos, buf, len);
1000 -static ssize_t write_file_tx99(struct file *file, const char __user *user_buf,
1001 - size_t count, loff_t *ppos)
1003 - struct ath_softc *sc = file->private_data;
1004 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1010 - if (sc->nvifs > 1)
1011 - return -EOPNOTSUPP;
1013 - len = min(count, sizeof(buf) - 1);
1014 - if (copy_from_user(buf, user_buf, len))
1017 - if (strtobool(buf, &start))
1020 - if (start == sc->tx99_state) {
1023 - ath_dbg(common, XMIT, "Resetting TX99\n");
1024 - ath9k_tx99_deinit(sc);
1028 - ath9k_tx99_deinit(sc);
1032 - r = ath9k_tx99_init(sc);
1039 -static const struct file_operations fops_tx99 = {
1040 - .read = read_file_tx99,
1041 - .write = write_file_tx99,
1042 - .open = simple_open,
1043 - .owner = THIS_MODULE,
1044 - .llseek = default_llseek,
1047 -static ssize_t read_file_tx99_power(struct file *file,
1048 - char __user *user_buf,
1049 - size_t count, loff_t *ppos)
1051 - struct ath_softc *sc = file->private_data;
1055 - len = sprintf(buf, "%d (%d dBm)\n",
1057 - sc->tx99_power / 2);
1059 - return simple_read_from_buffer(user_buf, count, ppos, buf, len);
1062 -static ssize_t write_file_tx99_power(struct file *file,
1063 - const char __user *user_buf,
1064 - size_t count, loff_t *ppos)
1066 - struct ath_softc *sc = file->private_data;
1070 - r = kstrtou8_from_user(user_buf, count, 0, &tx_power);
1074 - if (tx_power > MAX_RATE_POWER)
1077 - sc->tx99_power = tx_power;
1079 - ath9k_ps_wakeup(sc);
1080 - ath9k_hw_tx99_set_txpower(sc->sc_ah, sc->tx99_power);
1081 - ath9k_ps_restore(sc);
1086 -static const struct file_operations fops_tx99_power = {
1087 - .read = read_file_tx99_power,
1088 - .write = write_file_tx99_power,
1089 - .open = simple_open,
1090 - .owner = THIS_MODULE,
1091 - .llseek = default_llseek,
1094 int ath9k_init_debug(struct ath_hw *ah)
1096 struct ath_common *common = ath9k_hw_common(ah);
1097 @@ -1903,6 +1798,7 @@ int ath9k_init_debug(struct ath_hw *ah)
1100 ath9k_dfs_init_debug(sc);
1101 + ath9k_tx99_init_debug(sc);
1103 debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
1105 @@ -1978,15 +1874,6 @@ int ath9k_init_debug(struct ath_hw *ah)
1106 debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
1109 - if (config_enabled(CPTCFG_ATH9K_TX99) &&
1110 - AR_SREV_9300_20_OR_LATER(ah)) {
1111 - debugfs_create_file("tx99", S_IRUSR | S_IWUSR,
1112 - sc->debug.debugfs_phy, sc,
1114 - debugfs_create_file("tx99_power", S_IRUSR | S_IWUSR,
1115 - sc->debug.debugfs_phy, sc,
1116 - &fops_tx99_power);
1121 --- a/drivers/net/wireless/ath/ath9k/hw.c
1122 +++ b/drivers/net/wireless/ath/ath9k/hw.c
1124 #include <linux/io.h>
1125 #include <linux/slab.h>
1126 #include <linux/module.h>
1127 +#include <linux/time.h>
1128 #include <asm/unaligned.h>
1131 @@ -454,7 +455,6 @@ static void ath9k_hw_init_config(struct
1134 ah->config.rx_intr_mitigation = true;
1135 - ah->config.pcieSerDesWrite = true;
1138 * We need this for PCI devices only (Cardbus, PCI, miniPCI)
1139 @@ -549,11 +549,11 @@ static int ath9k_hw_post_init(struct ath
1140 * EEPROM needs to be initialized before we do this.
1141 * This is required for regulatory compliance.
1143 - if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
1144 + if (AR_SREV_9300_20_OR_LATER(ah)) {
1145 u16 regdmn = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
1146 if ((regdmn & 0xF0) == CTL_FCC) {
1147 - ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_2GHZ;
1148 - ah->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_5GHZ;
1149 + ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_2GHZ;
1150 + ah->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_5GHZ;
1154 @@ -1502,8 +1502,9 @@ static bool ath9k_hw_channel_change(stru
1157 if (pCap->hw_caps & ATH9K_HW_CAP_FCC_BAND_SWITCH) {
1158 - band_switch = IS_CHAN_5GHZ(ah->curchan) != IS_CHAN_5GHZ(chan);
1159 - mode_diff = (chan->channelFlags != ah->curchan->channelFlags);
1160 + u32 flags_diff = chan->channelFlags ^ ah->curchan->channelFlags;
1161 + band_switch = !!(flags_diff & CHANNEL_5GHZ);
1162 + mode_diff = !!(flags_diff & ~CHANNEL_HT);
1165 for (qnum = 0; qnum < AR_NUM_QCU; qnum++) {
1166 @@ -1815,7 +1816,7 @@ static int ath9k_hw_do_fastcc(struct ath
1167 * If cross-band fcc is not supoprted, bail out if channelFlags differ.
1169 if (!(pCap->hw_caps & ATH9K_HW_CAP_FCC_BAND_SWITCH) &&
1170 - chan->channelFlags != ah->curchan->channelFlags)
1171 + ((chan->channelFlags ^ ah->curchan->channelFlags) & ~CHANNEL_HT))
1174 if (!ath9k_hw_check_alive(ah))
1175 @@ -1856,10 +1857,12 @@ int ath9k_hw_reset(struct ath_hw *ah, st
1176 struct ath9k_hw_cal_data *caldata, bool fastcc)
1178 struct ath_common *common = ath9k_hw_common(ah);
1179 + struct timespec ts;
1186 bool start_mci_reset = false;
1187 bool save_fullsleep = ah->chip_fullsleep;
1188 @@ -1902,10 +1905,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st
1190 macStaId1 = REG_READ(ah, AR_STA_ID1) & AR_STA_ID1_BASE_RATE_11B;
1192 - /* For chips on which RTC reset is done, save TSF before it gets cleared */
1193 - if (AR_SREV_9100(ah) ||
1194 - (AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)))
1195 - tsf = ath9k_hw_gettsf64(ah);
1196 + /* Save TSF before chip reset, a cold reset clears it */
1197 + tsf = ath9k_hw_gettsf64(ah);
1198 + getrawmonotonic(&ts);
1199 + usec = ts.tv_sec * 1000 + ts.tv_nsec / 1000;
1201 saveLedState = REG_READ(ah, AR_CFG_LED) &
1202 (AR_CFG_LED_ASSOC_CTL | AR_CFG_LED_MODE_SEL |
1203 @@ -1938,8 +1941,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
1208 - ath9k_hw_settsf64(ah, tsf);
1209 + getrawmonotonic(&ts);
1210 + usec = ts.tv_sec * 1000 + ts.tv_nsec / 1000 - usec;
1211 + ath9k_hw_settsf64(ah, tsf + usec);
1213 if (AR_SREV_9280_20_OR_LATER(ah))
1214 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
1215 --- a/drivers/net/wireless/ath/ath9k/hw.h
1216 +++ b/drivers/net/wireless/ath/ath9k/hw.h
1217 @@ -283,7 +283,6 @@ struct ath9k_ops_config {
1218 int additional_swba_backoff;
1220 u32 cwm_ignore_extcca;
1221 - bool pcieSerDesWrite;
1225 @@ -316,6 +315,8 @@ struct ath9k_ops_config {
1226 u32 ant_ctrl_comm2g_switch_enable;
1227 bool xatten_margin_cfg;
1228 bool alt_mingainidx;
1229 + bool no_pll_pwrsave;
1230 + bool tx_gain_buffalo;
1234 @@ -864,6 +865,7 @@ struct ath_hw {
1238 + struct ar5416IniArray ini_dfs;
1239 struct ar5416IniArray iniModes;
1240 struct ar5416IniArray iniCommon;
1241 struct ar5416IniArray iniBB_RfGain;
1242 @@ -920,7 +922,7 @@ struct ath_hw {
1243 /* Enterprise mode cap */
1246 -#ifdef CONFIG_PM_SLEEP
1247 +#ifdef CONFIG_ATH9K_WOW
1251 @@ -1126,7 +1128,7 @@ ath9k_hw_get_btcoex_scheme(struct ath_hw
1252 #endif /* CPTCFG_ATH9K_BTCOEX_SUPPORT */
1255 -#ifdef CONFIG_PM_SLEEP
1256 +#ifdef CONFIG_ATH9K_WOW
1257 const char *ath9k_hw_wow_event_to_string(u32 wow_event);
1258 void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
1259 u8 *user_mask, int pattern_count,
1260 --- a/drivers/net/wireless/ath/ath9k/init.c
1261 +++ b/drivers/net/wireless/ath/ath9k/init.c
1262 @@ -554,7 +554,7 @@ static void ath9k_init_misc(struct ath_s
1263 sc->spec_config.fft_period = 0xF;
1266 -static void ath9k_init_platform(struct ath_softc *sc)
1267 +static void ath9k_init_pcoem_platform(struct ath_softc *sc)
1269 struct ath_hw *ah = sc->sc_ah;
1270 struct ath9k_hw_capabilities *pCap = &ah->caps;
1271 @@ -609,6 +609,11 @@ static void ath9k_init_platform(struct a
1272 ah->config.pcie_waen = 0x0040473b;
1273 ath_info(common, "Enable WAR for ASPM D3/L1\n");
1276 + if (sc->driver_data & ATH9K_PCI_NO_PLL_PWRSAVE) {
1277 + ah->config.no_pll_pwrsave = true;
1278 + ath_info(common, "Disable PLL PowerSave\n");
1282 static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob,
1283 @@ -656,6 +661,27 @@ static void ath9k_eeprom_release(struct
1284 release_firmware(sc->sc_ah->eeprom_blob);
1287 +static int ath9k_init_soc_platform(struct ath_softc *sc)
1289 + struct ath9k_platform_data *pdata = sc->dev->platform_data;
1290 + struct ath_hw *ah = sc->sc_ah;
1296 + if (pdata->eeprom_name) {
1297 + ret = ath9k_eeprom_request(sc, pdata->eeprom_name);
1302 + if (pdata->tx_gain_buffalo)
1303 + ah->config.tx_gain_buffalo = true;
1308 static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
1309 const struct ath_bus_ops *bus_ops)
1311 @@ -683,6 +709,7 @@ static int ath9k_init_softc(u16 devid, s
1312 common = ath9k_hw_common(ah);
1313 sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
1314 sc->tx99_power = MAX_RATE_POWER + 1;
1315 + init_waitqueue_head(&sc->tx_wait);
1318 ah->ah_flags |= AH_USE_EEPROM;
1319 @@ -708,7 +735,11 @@ static int ath9k_init_softc(u16 devid, s
1323 - ath9k_init_platform(sc);
1324 + ath9k_init_pcoem_platform(sc);
1326 + ret = ath9k_init_soc_platform(sc);
1331 * Enable WLAN/BT RX Antenna diversity only when:
1332 @@ -722,7 +753,6 @@ static int ath9k_init_softc(u16 devid, s
1333 common->bt_ant_diversity = 1;
1335 spin_lock_init(&common->cc_lock);
1337 spin_lock_init(&sc->sc_serial_rw);
1338 spin_lock_init(&sc->sc_pm_lock);
1339 mutex_init(&sc->mutex);
1340 @@ -730,6 +760,7 @@ static int ath9k_init_softc(u16 devid, s
1341 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
1344 + setup_timer(&sc->sleep_timer, ath_ps_full_sleep, (unsigned long)sc);
1345 INIT_WORK(&sc->hw_reset_work, ath_reset_work);
1346 INIT_WORK(&sc->hw_check_work, ath_hw_check);
1347 INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
1348 @@ -743,12 +774,6 @@ static int ath9k_init_softc(u16 devid, s
1349 ath_read_cachesize(common, &csz);
1350 common->cachelsz = csz << 2; /* convert to bytes */
1352 - if (pdata && pdata->eeprom_name) {
1353 - ret = ath9k_eeprom_request(sc, pdata->eeprom_name);
1358 /* Initializes the hardware for all supported chipsets */
1359 ret = ath9k_hw_init(ah);
1361 @@ -845,7 +870,8 @@ static const struct ieee80211_iface_limi
1364 static const struct ieee80211_iface_limit if_dfs_limits[] = {
1365 - { .max = 1, .types = BIT(NL80211_IFTYPE_AP) },
1366 + { .max = 1, .types = BIT(NL80211_IFTYPE_AP) |
1367 + BIT(NL80211_IFTYPE_ADHOC) },
1370 static const struct ieee80211_iface_combination if_comb[] = {
1371 @@ -862,20 +888,11 @@ static const struct ieee80211_iface_comb
1372 .max_interfaces = 1,
1373 .num_different_channels = 1,
1374 .beacon_int_infra_match = true,
1375 - .radar_detect_widths = BIT(NL80211_CHAN_NO_HT) |
1376 - BIT(NL80211_CHAN_HT20),
1377 + .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
1378 + BIT(NL80211_CHAN_WIDTH_20),
1383 -static const struct wiphy_wowlan_support ath9k_wowlan_support = {
1384 - .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
1385 - .n_patterns = MAX_NUM_USER_PATTERN,
1386 - .pattern_min_len = 1,
1387 - .pattern_max_len = MAX_PATTERN_SIZE,
1391 void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
1393 struct ath_hw *ah = sc->sc_ah;
1394 @@ -925,16 +942,6 @@ void ath9k_set_hw_capab(struct ath_softc
1395 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
1396 hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
1398 -#ifdef CONFIG_PM_SLEEP
1399 - if ((ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
1400 - (sc->driver_data & ATH9K_PCI_WOW) &&
1401 - device_can_wakeup(sc->dev))
1402 - hw->wiphy->wowlan = &ath9k_wowlan_support;
1404 - atomic_set(&sc->wow_sleep_proc_intr, -1);
1405 - atomic_set(&sc->wow_got_bmiss_intr, -1);
1410 hw->channel_change_time = 5000;
1411 @@ -960,6 +967,7 @@ void ath9k_set_hw_capab(struct ath_softc
1412 hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
1413 &sc->sbands[IEEE80211_BAND_5GHZ];
1415 + ath9k_init_wow(hw);
1416 ath9k_reload_chainmask_settings(sc);
1418 SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
1419 @@ -1058,6 +1066,7 @@ static void ath9k_deinit_softc(struct at
1420 if (ATH_TXQ_SETUP(sc, i))
1421 ath_tx_cleanupq(sc, &sc->tx.txq[i]);
1423 + del_timer_sync(&sc->sleep_timer);
1424 ath9k_hw_deinit(sc->sc_ah);
1425 if (sc->dfs_detector != NULL)
1426 sc->dfs_detector->exit(sc->dfs_detector);
1427 --- a/drivers/net/wireless/ath/ath9k/main.c
1428 +++ b/drivers/net/wireless/ath/ath9k/main.c
1429 @@ -82,6 +82,22 @@ static bool ath9k_setpower(struct ath_so
1433 +void ath_ps_full_sleep(unsigned long data)
1435 + struct ath_softc *sc = (struct ath_softc *) data;
1436 + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1439 + spin_lock(&common->cc_lock);
1440 + ath_hw_cycle_counters_update(common);
1441 + spin_unlock(&common->cc_lock);
1443 + ath9k_hw_setrxabort(sc->sc_ah, 1);
1444 + ath9k_hw_stopdmarecv(sc->sc_ah, &reset);
1446 + ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
1449 void ath9k_ps_wakeup(struct ath_softc *sc)
1451 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1452 @@ -92,6 +108,7 @@ void ath9k_ps_wakeup(struct ath_softc *s
1453 if (++sc->ps_usecount != 1)
1456 + del_timer_sync(&sc->sleep_timer);
1457 power_mode = sc->sc_ah->power_mode;
1458 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
1460 @@ -117,17 +134,17 @@ void ath9k_ps_restore(struct ath_softc *
1461 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1462 enum ath9k_power_mode mode;
1463 unsigned long flags;
1466 spin_lock_irqsave(&sc->sc_pm_lock, flags);
1467 if (--sc->ps_usecount != 0)
1471 - ath9k_hw_setrxabort(sc->sc_ah, 1);
1472 - ath9k_hw_stopdmarecv(sc->sc_ah, &reset);
1473 - mode = ATH9K_PM_FULL_SLEEP;
1474 - } else if (sc->ps_enabled &&
1475 + mod_timer(&sc->sleep_timer, jiffies + HZ / 10);
1479 + if (sc->ps_enabled &&
1480 !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
1482 PS_WAIT_FOR_PSPOLL_DATA |
1483 @@ -163,13 +180,13 @@ static void __ath_cancel_work(struct ath
1487 -static void ath_cancel_work(struct ath_softc *sc)
1488 +void ath_cancel_work(struct ath_softc *sc)
1490 __ath_cancel_work(sc);
1491 cancel_work_sync(&sc->hw_reset_work);
1494 -static void ath_restart_work(struct ath_softc *sc)
1495 +void ath_restart_work(struct ath_softc *sc)
1497 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
1499 @@ -487,6 +504,8 @@ void ath9k_tasklet(unsigned long data)
1500 ath_tx_edma_tasklet(sc);
1504 + wake_up(&sc->tx_wait);
1507 ath9k_btcoex_handle_interrupt(sc, status);
1508 @@ -579,7 +598,8 @@ irqreturn_t ath_isr(int irq, void *dev)
1512 -#ifdef CONFIG_PM_SLEEP
1514 +#ifdef CONFIG_ATH9K_WOW
1515 if (status & ATH9K_INT_BMISS) {
1516 if (atomic_read(&sc->wow_sleep_proc_intr) == 0) {
1517 ath_dbg(common, ANY, "during WoW we got a BMISS\n");
1518 @@ -588,6 +608,8 @@ irqreturn_t ath_isr(int irq, void *dev)
1524 if (status & ATH9K_INT_SWBA)
1525 tasklet_schedule(&sc->bcon_tasklet);
1527 @@ -627,7 +649,7 @@ chip_reset:
1531 -static int ath_reset(struct ath_softc *sc)
1532 +int ath_reset(struct ath_softc *sc)
1536 @@ -1817,13 +1839,31 @@ static void ath9k_set_coverage_class(str
1537 mutex_unlock(&sc->mutex);
1540 +static bool ath9k_has_tx_pending(struct ath_softc *sc)
1544 + for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
1545 + if (!ATH_TXQ_SETUP(sc, i))
1548 + if (!sc->tx.txq[i].axq_depth)
1551 + npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
1559 static void ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
1561 struct ath_softc *sc = hw->priv;
1562 struct ath_hw *ah = sc->sc_ah;
1563 struct ath_common *common = ath9k_hw_common(ah);
1564 - int timeout = 200; /* ms */
1566 + int timeout = HZ / 5; /* 200 ms */
1569 mutex_lock(&sc->mutex);
1570 @@ -1841,25 +1881,9 @@ static void ath9k_flush(struct ieee80211
1574 - for (j = 0; j < timeout; j++) {
1575 - bool npend = false;
1578 - usleep_range(1000, 2000);
1580 - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
1581 - if (!ATH_TXQ_SETUP(sc, i))
1584 - npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
1593 + if (wait_event_timeout(sc->tx_wait, !ath9k_has_tx_pending(sc),
1598 ath9k_ps_wakeup(sc);
1599 @@ -2021,333 +2045,6 @@ static int ath9k_get_antenna(struct ieee
1603 -#ifdef CONFIG_PM_SLEEP
1605 -static void ath9k_wow_map_triggers(struct ath_softc *sc,
1606 - struct cfg80211_wowlan *wowlan,
1607 - u32 *wow_triggers)
1609 - if (wowlan->disconnect)
1610 - *wow_triggers |= AH_WOW_LINK_CHANGE |
1611 - AH_WOW_BEACON_MISS;
1612 - if (wowlan->magic_pkt)
1613 - *wow_triggers |= AH_WOW_MAGIC_PATTERN_EN;
1615 - if (wowlan->n_patterns)
1616 - *wow_triggers |= AH_WOW_USER_PATTERN_EN;
1618 - sc->wow_enabled = *wow_triggers;
1622 -static void ath9k_wow_add_disassoc_deauth_pattern(struct ath_softc *sc)
1624 - struct ath_hw *ah = sc->sc_ah;
1625 - struct ath_common *common = ath9k_hw_common(ah);
1626 - int pattern_count = 0;
1628 - u8 dis_deauth_pattern[MAX_PATTERN_SIZE];
1629 - u8 dis_deauth_mask[MAX_PATTERN_SIZE];
1631 - memset(dis_deauth_pattern, 0, MAX_PATTERN_SIZE);
1632 - memset(dis_deauth_mask, 0, MAX_PATTERN_SIZE);
1635 - * Create Dissassociate / Deauthenticate packet filter
1637 - * 2 bytes 2 byte 6 bytes 6 bytes 6 bytes
1638 - * +--------------+----------+---------+--------+--------+----
1639 - * + Frame Control+ Duration + DA + SA + BSSID +
1640 - * +--------------+----------+---------+--------+--------+----
1642 - * The above is the management frame format for disassociate/
1643 - * deauthenticate pattern, from this we need to match the first byte
1644 - * of 'Frame Control' and DA, SA, and BSSID fields
1645 - * (skipping 2nd byte of FC and Duration feild.
1647 - * Disassociate pattern
1648 - * --------------------
1649 - * Frame control = 00 00 1010
1650 - * DA, SA, BSSID = x:x:x:x:x:x
1651 - * Pattern will be A0000000 | x:x:x:x:x:x | x:x:x:x:x:x
1652 - * | x:x:x:x:x:x -- 22 bytes
1654 - * Deauthenticate pattern
1655 - * ----------------------
1656 - * Frame control = 00 00 1100
1657 - * DA, SA, BSSID = x:x:x:x:x:x
1658 - * Pattern will be C0000000 | x:x:x:x:x:x | x:x:x:x:x:x
1659 - * | x:x:x:x:x:x -- 22 bytes
1662 - /* Create Disassociate Pattern first */
1666 - /* Fill out the mask with all FF's */
1668 - for (i = 0; i < MAX_PATTERN_MASK_SIZE; i++)
1669 - dis_deauth_mask[i] = 0xff;
1671 - /* copy the first byte of frame control field */
1672 - dis_deauth_pattern[byte_cnt] = 0xa0;
1675 - /* skip 2nd byte of frame control and Duration field */
1679 - * need not match the destination mac address, it can be a broadcast
1680 - * mac address or an unicast to this station
1684 - /* copy the source mac address */
1685 - memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
1689 - /* copy the bssid, its same as the source mac address */
1691 - memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
1693 - /* Create Disassociate pattern mask */
1695 - dis_deauth_mask[0] = 0xfe;
1696 - dis_deauth_mask[1] = 0x03;
1697 - dis_deauth_mask[2] = 0xc0;
1699 - ath_dbg(common, WOW, "Adding disassoc/deauth patterns for WoW\n");
1701 - ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
1702 - pattern_count, byte_cnt);
1706 - * for de-authenticate pattern, only the first byte of the frame
1707 - * control field gets changed from 0xA0 to 0xC0
1709 - dis_deauth_pattern[0] = 0xC0;
1711 - ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
1712 - pattern_count, byte_cnt);
1716 -static void ath9k_wow_add_pattern(struct ath_softc *sc,
1717 - struct cfg80211_wowlan *wowlan)
1719 - struct ath_hw *ah = sc->sc_ah;
1720 - struct ath9k_wow_pattern *wow_pattern = NULL;
1721 - struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
1725 - if (!wowlan->n_patterns)
1729 - * Add the new user configured patterns
1731 - for (i = 0; i < wowlan->n_patterns; i++) {
1733 - wow_pattern = kzalloc(sizeof(*wow_pattern), GFP_KERNEL);
1739 - * TODO: convert the generic user space pattern to
1740 - * appropriate chip specific/802.11 pattern.
1743 - mask_len = DIV_ROUND_UP(wowlan->patterns[i].pattern_len, 8);
1744 - memset(wow_pattern->pattern_bytes, 0, MAX_PATTERN_SIZE);
1745 - memset(wow_pattern->mask_bytes, 0, MAX_PATTERN_SIZE);
1746 - memcpy(wow_pattern->pattern_bytes, patterns[i].pattern,
1747 - patterns[i].pattern_len);
1748 - memcpy(wow_pattern->mask_bytes, patterns[i].mask, mask_len);
1749 - wow_pattern->pattern_len = patterns[i].pattern_len;
1752 - * just need to take care of deauth and disssoc pattern,
1753 - * make sure we don't overwrite them.
1756 - ath9k_hw_wow_apply_pattern(ah, wow_pattern->pattern_bytes,
1757 - wow_pattern->mask_bytes,
1759 - wow_pattern->pattern_len);
1760 - kfree(wow_pattern);
1766 -static int ath9k_suspend(struct ieee80211_hw *hw,
1767 - struct cfg80211_wowlan *wowlan)
1769 - struct ath_softc *sc = hw->priv;
1770 - struct ath_hw *ah = sc->sc_ah;
1771 - struct ath_common *common = ath9k_hw_common(ah);
1772 - u32 wow_triggers_enabled = 0;
1775 - mutex_lock(&sc->mutex);
1777 - ath_cancel_work(sc);
1779 - del_timer_sync(&sc->rx_poll_timer);
1781 - if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
1782 - ath_dbg(common, ANY, "Device not present\n");
1787 - if (WARN_ON(!wowlan)) {
1788 - ath_dbg(common, WOW, "None of the WoW triggers enabled\n");
1793 - if (!device_can_wakeup(sc->dev)) {
1794 - ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");
1800 - * none of the sta vifs are associated
1801 - * and we are not currently handling multivif
1802 - * cases, for instance we have to seperately
1803 - * configure 'keep alive frame' for each
1807 - if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
1808 - ath_dbg(common, WOW, "None of the STA vifs are associated\n");
1813 - if (sc->nvifs > 1) {
1814 - ath_dbg(common, WOW, "WoW for multivif is not yet supported\n");
1819 - ath9k_wow_map_triggers(sc, wowlan, &wow_triggers_enabled);
1821 - ath_dbg(common, WOW, "WoW triggers enabled 0x%x\n",
1822 - wow_triggers_enabled);
1824 - ath9k_ps_wakeup(sc);
1826 - ath9k_stop_btcoex(sc);
1829 - * Enable wake up on recieving disassoc/deauth
1830 - * frame by default.
1832 - ath9k_wow_add_disassoc_deauth_pattern(sc);
1834 - if (wow_triggers_enabled & AH_WOW_USER_PATTERN_EN)
1835 - ath9k_wow_add_pattern(sc, wowlan);
1837 - spin_lock_bh(&sc->sc_pcu_lock);
1839 - * To avoid false wake, we enable beacon miss interrupt only
1840 - * when we go to sleep. We save the current interrupt mask
1841 - * so we can restore it after the system wakes up
1843 - sc->wow_intr_before_sleep = ah->imask;
1844 - ah->imask &= ~ATH9K_INT_GLOBAL;
1845 - ath9k_hw_disable_interrupts(ah);
1846 - ah->imask = ATH9K_INT_BMISS | ATH9K_INT_GLOBAL;
1847 - ath9k_hw_set_interrupts(ah);
1848 - ath9k_hw_enable_interrupts(ah);
1850 - spin_unlock_bh(&sc->sc_pcu_lock);
1853 - * we can now sync irq and kill any running tasklets, since we already
1854 - * disabled interrupts and not holding a spin lock
1856 - synchronize_irq(sc->irq);
1857 - tasklet_kill(&sc->intr_tq);
1859 - ath9k_hw_wow_enable(ah, wow_triggers_enabled);
1861 - ath9k_ps_restore(sc);
1862 - ath_dbg(common, ANY, "WoW enabled in ath9k\n");
1863 - atomic_inc(&sc->wow_sleep_proc_intr);
1866 - mutex_unlock(&sc->mutex);
1870 -static int ath9k_resume(struct ieee80211_hw *hw)
1872 - struct ath_softc *sc = hw->priv;
1873 - struct ath_hw *ah = sc->sc_ah;
1874 - struct ath_common *common = ath9k_hw_common(ah);
1877 - mutex_lock(&sc->mutex);
1879 - ath9k_ps_wakeup(sc);
1881 - spin_lock_bh(&sc->sc_pcu_lock);
1883 - ath9k_hw_disable_interrupts(ah);
1884 - ah->imask = sc->wow_intr_before_sleep;
1885 - ath9k_hw_set_interrupts(ah);
1886 - ath9k_hw_enable_interrupts(ah);
1888 - spin_unlock_bh(&sc->sc_pcu_lock);
1890 - wow_status = ath9k_hw_wow_wakeup(ah);
1892 - if (atomic_read(&sc->wow_got_bmiss_intr) == 0) {
1894 - * some devices may not pick beacon miss
1895 - * as the reason they woke up so we add
1896 - * that here for that shortcoming.
1898 - wow_status |= AH_WOW_BEACON_MISS;
1899 - atomic_dec(&sc->wow_got_bmiss_intr);
1900 - ath_dbg(common, ANY, "Beacon miss interrupt picked up during WoW sleep\n");
1903 - atomic_dec(&sc->wow_sleep_proc_intr);
1906 - ath_dbg(common, ANY, "Waking up due to WoW triggers %s with WoW status = %x\n",
1907 - ath9k_hw_wow_event_to_string(wow_status), wow_status);
1910 - ath_restart_work(sc);
1911 - ath9k_start_btcoex(sc);
1913 - ath9k_ps_restore(sc);
1914 - mutex_unlock(&sc->mutex);
1919 -static void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
1921 - struct ath_softc *sc = hw->priv;
1923 - mutex_lock(&sc->mutex);
1924 - device_init_wakeup(sc->dev, 1);
1925 - device_set_wakeup_enable(sc->dev, enabled);
1926 - mutex_unlock(&sc->mutex);
1930 static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
1932 struct ath_softc *sc = hw->priv;
1933 @@ -2373,134 +2070,6 @@ static void ath9k_channel_switch_beacon(
1937 -static void ath9k_tx99_stop(struct ath_softc *sc)
1939 - struct ath_hw *ah = sc->sc_ah;
1940 - struct ath_common *common = ath9k_hw_common(ah);
1942 - ath_drain_all_txq(sc);
1943 - ath_startrecv(sc);
1945 - ath9k_hw_set_interrupts(ah);
1946 - ath9k_hw_enable_interrupts(ah);
1948 - ieee80211_wake_queues(sc->hw);
1950 - kfree_skb(sc->tx99_skb);
1951 - sc->tx99_skb = NULL;
1952 - sc->tx99_state = false;
1954 - ath9k_hw_tx99_stop(sc->sc_ah);
1955 - ath_dbg(common, XMIT, "TX99 stopped\n");
1958 -static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
1960 - static u8 PN9Data[] = {0xff, 0x87, 0xb8, 0x59, 0xb7, 0xa1, 0xcc, 0x24,
1961 - 0x57, 0x5e, 0x4b, 0x9c, 0x0e, 0xe9, 0xea, 0x50,
1962 - 0x2a, 0xbe, 0xb4, 0x1b, 0xb6, 0xb0, 0x5d, 0xf1,
1963 - 0xe6, 0x9a, 0xe3, 0x45, 0xfd, 0x2c, 0x53, 0x18,
1964 - 0x0c, 0xca, 0xc9, 0xfb, 0x49, 0x37, 0xe5, 0xa8,
1965 - 0x51, 0x3b, 0x2f, 0x61, 0xaa, 0x72, 0x18, 0x84,
1966 - 0x02, 0x23, 0x23, 0xab, 0x63, 0x89, 0x51, 0xb3,
1967 - 0xe7, 0x8b, 0x72, 0x90, 0x4c, 0xe8, 0xfb, 0xc0};
1969 - struct ieee80211_hw *hw = sc->hw;
1970 - struct ieee80211_hdr *hdr;
1971 - struct ieee80211_tx_info *tx_info;
1972 - struct sk_buff *skb;
1974 - skb = alloc_skb(len, GFP_KERNEL);
1978 - skb_put(skb, len);
1980 - memset(skb->data, 0, len);
1982 - hdr = (struct ieee80211_hdr *)skb->data;
1983 - hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA);
1984 - hdr->duration_id = 0;
1986 - memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN);
1987 - memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
1988 - memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
1990 - hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
1992 - tx_info = IEEE80211_SKB_CB(skb);
1993 - memset(tx_info, 0, sizeof(*tx_info));
1994 - tx_info->band = hw->conf.chandef.chan->band;
1995 - tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
1996 - tx_info->control.vif = sc->tx99_vif;
1998 - memcpy(skb->data + sizeof(*hdr), PN9Data, sizeof(PN9Data));
2003 -void ath9k_tx99_deinit(struct ath_softc *sc)
2007 - ath9k_ps_wakeup(sc);
2008 - ath9k_tx99_stop(sc);
2009 - ath9k_ps_restore(sc);
2012 -int ath9k_tx99_init(struct ath_softc *sc)
2014 - struct ieee80211_hw *hw = sc->hw;
2015 - struct ath_hw *ah = sc->sc_ah;
2016 - struct ath_common *common = ath9k_hw_common(ah);
2017 - struct ath_tx_control txctl;
2020 - if (sc->sc_flags & SC_OP_INVALID) {
2022 - "driver is in invalid state unable to use TX99");
2026 - sc->tx99_skb = ath9k_build_tx99_skb(sc);
2027 - if (!sc->tx99_skb)
2030 - memset(&txctl, 0, sizeof(txctl));
2031 - txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
2035 - ath9k_ps_wakeup(sc);
2037 - ath9k_hw_disable_interrupts(ah);
2038 - atomic_set(&ah->intr_ref_cnt, -1);
2039 - ath_drain_all_txq(sc);
2042 - sc->tx99_state = true;
2044 - ieee80211_stop_queues(hw);
2046 - if (sc->tx99_power == MAX_RATE_POWER + 1)
2047 - sc->tx99_power = MAX_RATE_POWER;
2049 - ath9k_hw_tx99_set_txpower(ah, sc->tx99_power);
2050 - r = ath9k_tx99_send(sc, sc->tx99_skb, &txctl);
2052 - ath_dbg(common, XMIT, "Failed to xmit TX99 skb\n");
2056 - ath_dbg(common, XMIT, "TX99 xmit started using %d ( %ddBm)\n",
2058 - sc->tx99_power / 2);
2060 - /* We leave the harware awake as it will be chugging on */
2065 struct ieee80211_ops ath9k_ops = {
2067 .start = ath9k_start,
2068 @@ -2531,7 +2100,7 @@ struct ieee80211_ops ath9k_ops = {
2069 .set_antenna = ath9k_set_antenna,
2070 .get_antenna = ath9k_get_antenna,
2072 -#ifdef CONFIG_PM_SLEEP
2073 +#ifdef CONFIG_ATH9K_WOW
2074 .suspend = ath9k_suspend,
2075 .resume = ath9k_resume,
2076 .set_wakeup = ath9k_set_wakeup,
2077 --- a/drivers/net/wireless/ath/ath9k/wow.c
2078 +++ b/drivers/net/wireless/ath/ath9k/wow.c
2081 - * Copyright (c) 2012 Qualcomm Atheros, Inc.
2082 + * Copyright (c) 2013 Qualcomm Atheros, Inc.
2084 * Permission to use, copy, modify, and/or distribute this software for any
2085 * purpose with or without fee is hereby granted, provided that the above
2086 @@ -14,409 +14,348 @@
2087 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2090 -#include <linux/export.h>
2093 -#include "hw-ops.h"
2095 -const char *ath9k_hw_wow_event_to_string(u32 wow_event)
2096 +static const struct wiphy_wowlan_support ath9k_wowlan_support = {
2097 + .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
2098 + .n_patterns = MAX_NUM_USER_PATTERN,
2099 + .pattern_min_len = 1,
2100 + .pattern_max_len = MAX_PATTERN_SIZE,
2103 +static void ath9k_wow_map_triggers(struct ath_softc *sc,
2104 + struct cfg80211_wowlan *wowlan,
2105 + u32 *wow_triggers)
2107 - if (wow_event & AH_WOW_MAGIC_PATTERN_EN)
2108 - return "Magic pattern";
2109 - if (wow_event & AH_WOW_USER_PATTERN_EN)
2110 - return "User pattern";
2111 - if (wow_event & AH_WOW_LINK_CHANGE)
2112 - return "Link change";
2113 - if (wow_event & AH_WOW_BEACON_MISS)
2114 - return "Beacon miss";
2115 + if (wowlan->disconnect)
2116 + *wow_triggers |= AH_WOW_LINK_CHANGE |
2117 + AH_WOW_BEACON_MISS;
2118 + if (wowlan->magic_pkt)
2119 + *wow_triggers |= AH_WOW_MAGIC_PATTERN_EN;
2121 + if (wowlan->n_patterns)
2122 + *wow_triggers |= AH_WOW_USER_PATTERN_EN;
2124 + sc->wow_enabled = *wow_triggers;
2126 - return "unknown reason";
2128 -EXPORT_SYMBOL(ath9k_hw_wow_event_to_string);
2130 -static void ath9k_hw_set_powermode_wow_sleep(struct ath_hw *ah)
2131 +static void ath9k_wow_add_disassoc_deauth_pattern(struct ath_softc *sc)
2133 + struct ath_hw *ah = sc->sc_ah;
2134 struct ath_common *common = ath9k_hw_common(ah);
2135 + int pattern_count = 0;
2137 + u8 dis_deauth_pattern[MAX_PATTERN_SIZE];
2138 + u8 dis_deauth_mask[MAX_PATTERN_SIZE];
2140 - REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
2141 + memset(dis_deauth_pattern, 0, MAX_PATTERN_SIZE);
2142 + memset(dis_deauth_mask, 0, MAX_PATTERN_SIZE);
2144 - /* set rx disable bit */
2145 - REG_WRITE(ah, AR_CR, AR_CR_RXD);
2147 + * Create Dissassociate / Deauthenticate packet filter
2149 + * 2 bytes 2 byte 6 bytes 6 bytes 6 bytes
2150 + * +--------------+----------+---------+--------+--------+----
2151 + * + Frame Control+ Duration + DA + SA + BSSID +
2152 + * +--------------+----------+---------+--------+--------+----
2154 + * The above is the management frame format for disassociate/
2155 + * deauthenticate pattern, from this we need to match the first byte
2156 + * of 'Frame Control' and DA, SA, and BSSID fields
2157 + * (skipping 2nd byte of FC and Duration feild.
2159 + * Disassociate pattern
2160 + * --------------------
2161 + * Frame control = 00 00 1010
2162 + * DA, SA, BSSID = x:x:x:x:x:x
2163 + * Pattern will be A0000000 | x:x:x:x:x:x | x:x:x:x:x:x
2164 + * | x:x:x:x:x:x -- 22 bytes
2166 + * Deauthenticate pattern
2167 + * ----------------------
2168 + * Frame control = 00 00 1100
2169 + * DA, SA, BSSID = x:x:x:x:x:x
2170 + * Pattern will be C0000000 | x:x:x:x:x:x | x:x:x:x:x:x
2171 + * | x:x:x:x:x:x -- 22 bytes
2174 - if (!ath9k_hw_wait(ah, AR_CR, AR_CR_RXE, 0, AH_WAIT_TIMEOUT)) {
2175 - ath_err(common, "Failed to stop Rx DMA in 10ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
2176 - REG_READ(ah, AR_CR), REG_READ(ah, AR_DIAG_SW));
2179 + /* Create Disassociate Pattern first */
2181 - REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_ON_INT);
2185 -static void ath9k_wow_create_keep_alive_pattern(struct ath_hw *ah)
2187 - struct ath_common *common = ath9k_hw_common(ah);
2188 - u8 sta_mac_addr[ETH_ALEN], ap_mac_addr[ETH_ALEN];
2189 - u32 ctl[13] = {0};
2190 - u32 data_word[KAL_NUM_DATA_WORDS];
2192 - u32 wow_ka_data_word0;
2194 - memcpy(sta_mac_addr, common->macaddr, ETH_ALEN);
2195 - memcpy(ap_mac_addr, common->curbssid, ETH_ALEN);
2197 - /* set the transmit buffer */
2198 - ctl[0] = (KAL_FRAME_LEN | (MAX_RATE_POWER << 16));
2200 - ctl[3] = 0xb; /* OFDM_6M hardware value for this rate */
2202 - ctl[7] = (ah->txchainmask) << 2;
2203 - ctl[2] = 0xf << 16; /* tx_tries 0 */
2205 - for (i = 0; i < KAL_NUM_DESC_WORDS; i++)
2206 - REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
2208 - REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
2210 - data_word[0] = (KAL_FRAME_TYPE << 2) | (KAL_FRAME_SUB_TYPE << 4) |
2211 - (KAL_TO_DS << 8) | (KAL_DURATION_ID << 16);
2212 - data_word[1] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
2213 - (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
2214 - data_word[2] = (sta_mac_addr[1] << 24) | (sta_mac_addr[0] << 16) |
2215 - (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
2216 - data_word[3] = (sta_mac_addr[5] << 24) | (sta_mac_addr[4] << 16) |
2217 - (sta_mac_addr[3] << 8) | (sta_mac_addr[2]);
2218 - data_word[4] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
2219 - (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
2220 - data_word[5] = (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
2222 - if (AR_SREV_9462_20(ah)) {
2223 - /* AR9462 2.0 has an extra descriptor word (time based
2224 - * discard) compared to other chips */
2225 - REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + (12 * 4)), 0);
2226 - wow_ka_data_word0 = AR_WOW_TXBUF(13);
2228 - wow_ka_data_word0 = AR_WOW_TXBUF(12);
2230 + /* Fill out the mask with all FF's */
2232 - for (i = 0; i < KAL_NUM_DATA_WORDS; i++)
2233 - REG_WRITE(ah, (wow_ka_data_word0 + i*4), data_word[i]);
2234 + for (i = 0; i < MAX_PATTERN_MASK_SIZE; i++)
2235 + dis_deauth_mask[i] = 0xff;
2238 + /* copy the first byte of frame control field */
2239 + dis_deauth_pattern[byte_cnt] = 0xa0;
2242 -void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
2243 - u8 *user_mask, int pattern_count,
2247 - u32 pattern_val, mask_val;
2249 + /* skip 2nd byte of frame control and Duration field */
2252 - /* FIXME: should check count by querying the hardware capability */
2253 - if (pattern_count >= MAX_NUM_PATTERN)
2256 + * need not match the destination mac address, it can be a broadcast
2257 + * mac address or an unicast to this station
2261 - REG_SET_BIT(ah, AR_WOW_PATTERN, BIT(pattern_count));
2262 + /* copy the source mac address */
2263 + memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
2265 - /* set the registers for pattern */
2266 - for (i = 0; i < MAX_PATTERN_SIZE; i += 4) {
2267 - memcpy(&pattern_val, user_pattern, 4);
2268 - REG_WRITE(ah, (AR_WOW_TB_PATTERN(pattern_count) + i),
2270 - user_pattern += 4;
2274 - /* set the registers for mask */
2275 - for (i = 0; i < MAX_PATTERN_MASK_SIZE; i += 4) {
2276 - memcpy(&mask_val, user_mask, 4);
2277 - REG_WRITE(ah, (AR_WOW_TB_MASK(pattern_count) + i), mask_val);
2280 + /* copy the bssid, its same as the source mac address */
2282 - /* set the pattern length to be matched
2284 - * AR_WOW_LENGTH1_REG1
2285 - * bit 31:24 pattern 0 length
2286 - * bit 23:16 pattern 1 length
2287 - * bit 15:8 pattern 2 length
2288 - * bit 7:0 pattern 3 length
2290 - * AR_WOW_LENGTH1_REG2
2291 - * bit 31:24 pattern 4 length
2292 - * bit 23:16 pattern 5 length
2293 - * bit 15:8 pattern 6 length
2294 - * bit 7:0 pattern 7 length
2296 - * the below logic writes out the new
2297 - * pattern length for the corresponding
2298 - * pattern_count, while masking out the
2301 + memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
2303 - ah->wow_event_mask |= BIT(pattern_count + AR_WOW_PAT_FOUND_SHIFT);
2304 + /* Create Disassociate pattern mask */
2306 - if (pattern_count < 4) {
2307 - /* Pattern 0-3 uses AR_WOW_LENGTH1 register */
2308 - set = (pattern_len & AR_WOW_LENGTH_MAX) <<
2309 - AR_WOW_LEN1_SHIFT(pattern_count);
2310 - clr = AR_WOW_LENGTH1_MASK(pattern_count);
2311 - REG_RMW(ah, AR_WOW_LENGTH1, set, clr);
2313 - /* Pattern 4-7 uses AR_WOW_LENGTH2 register */
2314 - set = (pattern_len & AR_WOW_LENGTH_MAX) <<
2315 - AR_WOW_LEN2_SHIFT(pattern_count);
2316 - clr = AR_WOW_LENGTH2_MASK(pattern_count);
2317 - REG_RMW(ah, AR_WOW_LENGTH2, set, clr);
2319 + dis_deauth_mask[0] = 0xfe;
2320 + dis_deauth_mask[1] = 0x03;
2321 + dis_deauth_mask[2] = 0xc0;
2324 -EXPORT_SYMBOL(ath9k_hw_wow_apply_pattern);
2325 + ath_dbg(common, WOW, "Adding disassoc/deauth patterns for WoW\n");
2327 -u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
2329 - u32 wow_status = 0;
2330 - u32 val = 0, rval;
2331 + ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
2332 + pattern_count, byte_cnt);
2336 - * read the WoW status register to know
2337 - * the wakeup reason
2338 + * for de-authenticate pattern, only the first byte of the frame
2339 + * control field gets changed from 0xA0 to 0xC0
2341 - rval = REG_READ(ah, AR_WOW_PATTERN);
2342 - val = AR_WOW_STATUS(rval);
2343 + dis_deauth_pattern[0] = 0xC0;
2346 - * mask only the WoW events that we have enabled. Sometimes
2347 - * we have spurious WoW events from the AR_WOW_PATTERN
2348 - * register. This mask will clean it up.
2350 + ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
2351 + pattern_count, byte_cnt);
2353 - val &= ah->wow_event_mask;
2357 - if (val & AR_WOW_MAGIC_PAT_FOUND)
2358 - wow_status |= AH_WOW_MAGIC_PATTERN_EN;
2359 - if (AR_WOW_PATTERN_FOUND(val))
2360 - wow_status |= AH_WOW_USER_PATTERN_EN;
2361 - if (val & AR_WOW_KEEP_ALIVE_FAIL)
2362 - wow_status |= AH_WOW_LINK_CHANGE;
2363 - if (val & AR_WOW_BEACON_FAIL)
2364 - wow_status |= AH_WOW_BEACON_MISS;
2366 +static void ath9k_wow_add_pattern(struct ath_softc *sc,
2367 + struct cfg80211_wowlan *wowlan)
2369 + struct ath_hw *ah = sc->sc_ah;
2370 + struct ath9k_wow_pattern *wow_pattern = NULL;
2371 + struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
2375 + if (!wowlan->n_patterns)
2379 - * set and clear WOW_PME_CLEAR registers for the chip to
2380 - * generate next wow signal.
2381 - * disable D3 before accessing other registers ?
2382 + * Add the new user configured patterns
2384 + for (i = 0; i < wowlan->n_patterns; i++) {
2386 - /* do we need to check the bit value 0x01000000 (7-10) ?? */
2387 - REG_RMW(ah, AR_PCIE_PM_CTRL, AR_PMCTRL_WOW_PME_CLR,
2388 - AR_PMCTRL_PWR_STATE_D1D3);
2389 + wow_pattern = kzalloc(sizeof(*wow_pattern), GFP_KERNEL);
2392 - * clear all events
2394 - REG_WRITE(ah, AR_WOW_PATTERN,
2395 - AR_WOW_CLEAR_EVENTS(REG_READ(ah, AR_WOW_PATTERN)));
2400 - * restore the beacon threshold to init value
2402 - REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR);
2404 + * TODO: convert the generic user space pattern to
2405 + * appropriate chip specific/802.11 pattern.
2409 - * Restore the way the PCI-E reset, Power-On-Reset, external
2410 - * PCIE_POR_SHORT pins are tied to its original value.
2411 - * Previously just before WoW sleep, we untie the PCI-E
2412 - * reset to our Chip's Power On Reset so that any PCI-E
2413 - * reset from the bus will not reset our chip
2415 - if (ah->is_pciexpress)
2416 - ath9k_hw_configpcipowersave(ah, false);
2417 + mask_len = DIV_ROUND_UP(wowlan->patterns[i].pattern_len, 8);
2418 + memset(wow_pattern->pattern_bytes, 0, MAX_PATTERN_SIZE);
2419 + memset(wow_pattern->mask_bytes, 0, MAX_PATTERN_SIZE);
2420 + memcpy(wow_pattern->pattern_bytes, patterns[i].pattern,
2421 + patterns[i].pattern_len);
2422 + memcpy(wow_pattern->mask_bytes, patterns[i].mask, mask_len);
2423 + wow_pattern->pattern_len = patterns[i].pattern_len;
2426 + * just need to take care of deauth and disssoc pattern,
2427 + * make sure we don't overwrite them.
2430 + ath9k_hw_wow_apply_pattern(ah, wow_pattern->pattern_bytes,
2431 + wow_pattern->mask_bytes,
2433 + wow_pattern->pattern_len);
2434 + kfree(wow_pattern);
2436 - ah->wow_event_mask = 0;
2439 - return wow_status;
2441 -EXPORT_SYMBOL(ath9k_hw_wow_wakeup);
2443 -void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable)
2444 +int ath9k_suspend(struct ieee80211_hw *hw,
2445 + struct cfg80211_wowlan *wowlan)
2447 - u32 wow_event_mask;
2449 + struct ath_softc *sc = hw->priv;
2450 + struct ath_hw *ah = sc->sc_ah;
2451 + struct ath_common *common = ath9k_hw_common(ah);
2452 + u32 wow_triggers_enabled = 0;
2456 - * wow_event_mask is a mask to the AR_WOW_PATTERN register to
2457 - * indicate which WoW events we have enabled. The WoW events
2458 - * are from the 'pattern_enable' in this function and
2459 - * 'pattern_count' of ath9k_hw_wow_apply_pattern()
2461 - wow_event_mask = ah->wow_event_mask;
2462 + mutex_lock(&sc->mutex);
2465 - * Untie Power-on-Reset from the PCI-E-Reset. When we are in
2466 - * WOW sleep, we do want the Reset from the PCI-E to disturb
2469 - if (ah->is_pciexpress) {
2471 - * we need to untie the internal POR (power-on-reset)
2472 - * to the external PCI-E reset. We also need to tie
2473 - * the PCI-E Phy reset to the PCI-E reset.
2475 - set = AR_WA_RESET_EN | AR_WA_POR_SHORT;
2476 - clr = AR_WA_UNTIE_RESET_EN | AR_WA_D3_L1_DISABLE;
2477 - REG_RMW(ah, AR_WA, set, clr);
2478 + ath_cancel_work(sc);
2480 + del_timer_sync(&sc->rx_poll_timer);
2482 + if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
2483 + ath_dbg(common, ANY, "Device not present\n");
2489 - * set the power states appropriately and enable PME
2491 - set = AR_PMCTRL_HOST_PME_EN | AR_PMCTRL_PWR_PM_CTRL_ENA |
2492 - AR_PMCTRL_AUX_PWR_DET | AR_PMCTRL_WOW_PME_CLR;
2493 + if (WARN_ON(!wowlan)) {
2494 + ath_dbg(common, WOW, "None of the WoW triggers enabled\n");
2500 - * set and clear WOW_PME_CLEAR registers for the chip
2501 - * to generate next wow signal.
2503 - REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
2504 - clr = AR_PMCTRL_WOW_PME_CLR;
2505 - REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
2506 + if (!device_can_wakeup(sc->dev)) {
2507 + ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");
2516 - * - keep alive timeout
2517 - * - pattern matching
2518 + * none of the sta vifs are associated
2519 + * and we are not currently handling multivif
2520 + * cases, for instance we have to seperately
2521 + * configure 'keep alive frame' for each
2526 - * Program default values for pattern backoff, aifs/slot/KAL count,
2527 - * beacon miss timeout, KAL timeout, etc.
2529 - set = AR_WOW_BACK_OFF_SHIFT(AR_WOW_PAT_BACKOFF);
2530 - REG_SET_BIT(ah, AR_WOW_PATTERN, set);
2531 + if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
2532 + ath_dbg(common, WOW, "None of the STA vifs are associated\n");
2537 + if (sc->nvifs > 1) {
2538 + ath_dbg(common, WOW, "WoW for multivif is not yet supported\n");
2543 - set = AR_WOW_AIFS_CNT(AR_WOW_CNT_AIFS_CNT) |
2544 - AR_WOW_SLOT_CNT(AR_WOW_CNT_SLOT_CNT) |
2545 - AR_WOW_KEEP_ALIVE_CNT(AR_WOW_CNT_KA_CNT);
2546 - REG_SET_BIT(ah, AR_WOW_COUNT, set);
2548 - if (pattern_enable & AH_WOW_BEACON_MISS)
2549 - set = AR_WOW_BEACON_TIMO;
2550 - /* We are not using beacon miss, program a large value */
2552 - set = AR_WOW_BEACON_TIMO_MAX;
2553 + ath9k_wow_map_triggers(sc, wowlan, &wow_triggers_enabled);
2555 - REG_WRITE(ah, AR_WOW_BCN_TIMO, set);
2556 + ath_dbg(common, WOW, "WoW triggers enabled 0x%x\n",
2557 + wow_triggers_enabled);
2560 - * Keep alive timo in ms except AR9280
2562 - if (!pattern_enable)
2563 - set = AR_WOW_KEEP_ALIVE_NEVER;
2565 - set = KAL_TIMEOUT * 32;
2566 + ath9k_ps_wakeup(sc);
2568 - REG_WRITE(ah, AR_WOW_KEEP_ALIVE_TIMO, set);
2569 + ath9k_stop_btcoex(sc);
2572 - * Keep alive delay in us. based on 'power on clock',
2573 - * therefore in usec
2574 + * Enable wake up on recieving disassoc/deauth
2575 + * frame by default.
2577 - set = KAL_DELAY * 1000;
2578 - REG_WRITE(ah, AR_WOW_KEEP_ALIVE_DELAY, set);
2579 + ath9k_wow_add_disassoc_deauth_pattern(sc);
2582 - * Create keep alive pattern to respond to beacons
2584 - ath9k_wow_create_keep_alive_pattern(ah);
2585 + if (wow_triggers_enabled & AH_WOW_USER_PATTERN_EN)
2586 + ath9k_wow_add_pattern(sc, wowlan);
2588 + spin_lock_bh(&sc->sc_pcu_lock);
2590 - * Configure MAC WoW Registers
2591 + * To avoid false wake, we enable beacon miss interrupt only
2592 + * when we go to sleep. We save the current interrupt mask
2593 + * so we can restore it after the system wakes up
2596 - /* Send keep alive timeouts anyway */
2597 - clr = AR_WOW_KEEP_ALIVE_AUTO_DIS;
2599 - if (pattern_enable & AH_WOW_LINK_CHANGE)
2600 - wow_event_mask |= AR_WOW_KEEP_ALIVE_FAIL;
2602 - set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
2603 + sc->wow_intr_before_sleep = ah->imask;
2604 + ah->imask &= ~ATH9K_INT_GLOBAL;
2605 + ath9k_hw_disable_interrupts(ah);
2606 + ah->imask = ATH9K_INT_BMISS | ATH9K_INT_GLOBAL;
2607 + ath9k_hw_set_interrupts(ah);
2608 + ath9k_hw_enable_interrupts(ah);
2610 - set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
2611 - REG_RMW(ah, AR_WOW_KEEP_ALIVE, set, clr);
2612 + spin_unlock_bh(&sc->sc_pcu_lock);
2615 - * we are relying on a bmiss failure. ensure we have
2616 - * enough threshold to prevent false positives
2617 + * we can now sync irq and kill any running tasklets, since we already
2618 + * disabled interrupts and not holding a spin lock
2620 - REG_RMW_FIELD(ah, AR_RSSI_THR, AR_RSSI_THR_BM_THR,
2621 - AR_WOW_BMISSTHRESHOLD);
2622 + synchronize_irq(sc->irq);
2623 + tasklet_kill(&sc->intr_tq);
2625 + ath9k_hw_wow_enable(ah, wow_triggers_enabled);
2629 + ath9k_ps_restore(sc);
2630 + ath_dbg(common, ANY, "WoW enabled in ath9k\n");
2631 + atomic_inc(&sc->wow_sleep_proc_intr);
2633 - if (pattern_enable & AH_WOW_BEACON_MISS) {
2634 - set = AR_WOW_BEACON_FAIL_EN;
2635 - wow_event_mask |= AR_WOW_BEACON_FAIL;
2637 - clr = AR_WOW_BEACON_FAIL_EN;
2639 + mutex_unlock(&sc->mutex);
2643 +int ath9k_resume(struct ieee80211_hw *hw)
2645 + struct ath_softc *sc = hw->priv;
2646 + struct ath_hw *ah = sc->sc_ah;
2647 + struct ath_common *common = ath9k_hw_common(ah);
2650 + mutex_lock(&sc->mutex);
2652 + ath9k_ps_wakeup(sc);
2654 + spin_lock_bh(&sc->sc_pcu_lock);
2656 + ath9k_hw_disable_interrupts(ah);
2657 + ah->imask = sc->wow_intr_before_sleep;
2658 + ath9k_hw_set_interrupts(ah);
2659 + ath9k_hw_enable_interrupts(ah);
2661 + spin_unlock_bh(&sc->sc_pcu_lock);
2663 + wow_status = ath9k_hw_wow_wakeup(ah);
2665 + if (atomic_read(&sc->wow_got_bmiss_intr) == 0) {
2667 + * some devices may not pick beacon miss
2668 + * as the reason they woke up so we add
2669 + * that here for that shortcoming.
2671 + wow_status |= AH_WOW_BEACON_MISS;
2672 + atomic_dec(&sc->wow_got_bmiss_intr);
2673 + ath_dbg(common, ANY, "Beacon miss interrupt picked up during WoW sleep\n");
2676 - REG_RMW(ah, AR_WOW_BCN_EN, set, clr);
2677 + atomic_dec(&sc->wow_sleep_proc_intr);
2682 - * Enable the magic packet registers
2684 - if (pattern_enable & AH_WOW_MAGIC_PATTERN_EN) {
2685 - set = AR_WOW_MAGIC_EN;
2686 - wow_event_mask |= AR_WOW_MAGIC_PAT_FOUND;
2688 - clr = AR_WOW_MAGIC_EN;
2690 + ath_dbg(common, ANY, "Waking up due to WoW triggers %s with WoW status = %x\n",
2691 + ath9k_hw_wow_event_to_string(wow_status), wow_status);
2693 - set |= AR_WOW_MAC_INTR_EN;
2694 - REG_RMW(ah, AR_WOW_PATTERN, set, clr);
2696 - REG_WRITE(ah, AR_WOW_PATTERN_MATCH_LT_256B,
2697 - AR_WOW_PATTERN_SUPPORTED);
2698 + ath_restart_work(sc);
2699 + ath9k_start_btcoex(sc);
2702 - * Set the power states appropriately and enable PME
2705 - set = AR_PMCTRL_PWR_STATE_D1D3 | AR_PMCTRL_HOST_PME_EN |
2706 - AR_PMCTRL_PWR_PM_CTRL_ENA;
2707 + ath9k_ps_restore(sc);
2708 + mutex_unlock(&sc->mutex);
2710 - clr = AR_PCIE_PM_CTRL_ENA;
2711 - REG_RMW(ah, AR_PCIE_PM_CTRL, set, clr);
2716 - * this is needed to prevent the chip waking up
2717 - * the host within 3-4 seconds with certain
2718 - * platform/BIOS. The fix is to enable
2719 - * D1 & D3 to match original definition and
2720 - * also match the OTP value. Anyway this
2721 - * is more related to SW WOW.
2723 - clr = AR_PMCTRL_PWR_STATE_D1D3;
2724 - REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
2725 +void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
2727 + struct ath_softc *sc = hw->priv;
2729 - set = AR_PMCTRL_PWR_STATE_D1D3_REAL;
2730 - REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
2731 + mutex_lock(&sc->mutex);
2732 + device_init_wakeup(sc->dev, 1);
2733 + device_set_wakeup_enable(sc->dev, enabled);
2734 + mutex_unlock(&sc->mutex);
2737 - REG_CLR_BIT(ah, AR_STA_ID1, AR_STA_ID1_PRESERVE_SEQNUM);
2738 +void ath9k_init_wow(struct ieee80211_hw *hw)
2740 + struct ath_softc *sc = hw->priv;
2742 - /* to bring down WOW power low margin */
2744 - REG_SET_BIT(ah, AR_PCIE_PHY_REG3, set);
2747 - REG_CLR_BIT(ah, AR_PCU_MISC_MODE3, clr);
2748 + if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
2749 + (sc->driver_data & ATH9K_PCI_WOW) &&
2750 + device_can_wakeup(sc->dev))
2751 + hw->wiphy->wowlan = &ath9k_wowlan_support;
2753 - ath9k_hw_set_powermode_wow_sleep(ah);
2754 - ah->wow_event_mask = wow_event_mask;
2755 + atomic_set(&sc->wow_sleep_proc_intr, -1);
2756 + atomic_set(&sc->wow_got_bmiss_intr, -1);
2758 -EXPORT_SYMBOL(ath9k_hw_wow_enable);
2759 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2760 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
2761 @@ -1276,6 +1276,10 @@ static void ath_tx_fill_desc(struct ath_
2762 if (!rts_thresh || (len > rts_thresh))
2767 + len = fi->framelen;
2769 ath_buf_set_rate(sc, bf, &info, len, rts);
2772 @@ -1786,6 +1790,9 @@ bool ath_drain_all_txq(struct ath_softc
2773 if (!ATH_TXQ_SETUP(sc, i))
2776 + if (!sc->tx.txq[i].axq_depth)
2779 if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum))
2782 @@ -2749,6 +2756,8 @@ void ath_tx_node_cleanup(struct ath_soft
2786 +#ifdef CONFIG_ATH9K_TX99
2788 int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb,
2789 struct ath_tx_control *txctl)
2791 @@ -2791,3 +2800,5 @@ int ath9k_tx99_send(struct ath_softc *sc
2796 +#endif /* CONFIG_ATH9K_TX99 */
2797 --- a/drivers/net/wireless/ath/regd.c
2798 +++ b/drivers/net/wireless/ath/regd.c
2799 @@ -37,17 +37,17 @@ static int __ath_regd_init(struct ath_re
2801 /* We enable active scan on these a case by case basis by regulatory domain */
2802 #define ATH9K_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
2803 - NL80211_RRF_PASSIVE_SCAN)
2804 + NL80211_RRF_NO_IR)
2805 #define ATH9K_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\
2806 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
2807 + NL80211_RRF_NO_IR | NL80211_RRF_NO_OFDM)
2809 /* We allow IBSS on these on a case by case basis by regulatory domain */
2810 #define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
2811 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
2812 + NL80211_RRF_NO_IR)
2813 #define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
2814 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
2815 + NL80211_RRF_NO_IR)
2816 #define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\
2817 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
2818 + NL80211_RRF_NO_IR)
2820 #define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
2821 ATH9K_2GHZ_CH12_13, \
2822 @@ -224,17 +224,16 @@ ath_reg_apply_beaconing_flags(struct wip
2823 * regulatory_hint().
2825 if (!(reg_rule->flags &
2826 - NL80211_RRF_NO_IBSS))
2827 + NL80211_RRF_NO_IR))
2829 - ~IEEE80211_CHAN_NO_IBSS;
2830 + ~IEEE80211_CHAN_NO_IR;
2831 if (!(reg_rule->flags &
2832 - NL80211_RRF_PASSIVE_SCAN))
2833 + NL80211_RRF_NO_IR))
2835 - ~IEEE80211_CHAN_PASSIVE_SCAN;
2836 + ~IEEE80211_CHAN_NO_IR;
2838 if (ch->beacon_found)
2839 - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
2840 - IEEE80211_CHAN_PASSIVE_SCAN);
2841 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
2845 @@ -260,11 +259,11 @@ ath_reg_apply_active_scan_flags(struct w
2847 if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
2848 ch = &sband->channels[11]; /* CH 12 */
2849 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
2850 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
2851 + if (ch->flags & IEEE80211_CHAN_NO_IR)
2852 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
2853 ch = &sband->channels[12]; /* CH 13 */
2854 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
2855 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
2856 + if (ch->flags & IEEE80211_CHAN_NO_IR)
2857 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
2861 @@ -278,17 +277,17 @@ ath_reg_apply_active_scan_flags(struct w
2862 ch = &sband->channels[11]; /* CH 12 */
2863 reg_rule = freq_reg_info(wiphy, ch->center_freq);
2864 if (!IS_ERR(reg_rule)) {
2865 - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
2866 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
2867 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
2868 + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
2869 + if (ch->flags & IEEE80211_CHAN_NO_IR)
2870 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
2873 ch = &sband->channels[12]; /* CH 13 */
2874 reg_rule = freq_reg_info(wiphy, ch->center_freq);
2875 if (!IS_ERR(reg_rule)) {
2876 - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
2877 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
2878 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
2879 + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
2880 + if (ch->flags & IEEE80211_CHAN_NO_IR)
2881 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
2885 @@ -320,8 +319,8 @@ static void ath_reg_apply_radar_flags(st
2887 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
2888 ch->flags |= IEEE80211_CHAN_RADAR |
2889 - IEEE80211_CHAN_NO_IBSS |
2890 - IEEE80211_CHAN_PASSIVE_SCAN;
2891 + IEEE80211_CHAN_NO_IR |
2892 + IEEE80211_CHAN_NO_IR;
2896 --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
2897 +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
2898 @@ -812,7 +812,7 @@ static s32 brcmf_p2p_run_escan(struct br
2899 struct ieee80211_channel *chan = request->channels[i];
2901 if (chan->flags & (IEEE80211_CHAN_RADAR |
2902 - IEEE80211_CHAN_PASSIVE_SCAN))
2903 + IEEE80211_CHAN_NO_IR))
2906 chanspecs[i] = channel_to_chanspec(&p2p->cfg->d11inf,
2907 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
2908 +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
2909 @@ -202,9 +202,9 @@ static struct ieee80211_supported_band _
2911 /* This is to override regulatory domains defined in cfg80211 module (reg.c)
2912 * By default world regulatory domain defined in reg.c puts the flags
2913 - * NL80211_RRF_PASSIVE_SCAN and NL80211_RRF_NO_IBSS for 5GHz channels (for
2914 - * 36..48 and 149..165). With respect to these flags, wpa_supplicant doesn't
2915 - * start p2p operations on 5GHz channels. All the changes in world regulatory
2916 + * NL80211_RRF_NO_IR for 5GHz channels (for * 36..48 and 149..165).
2917 + * With respect to these flags, wpa_supplicant doesn't * start p2p
2918 + * operations on 5GHz channels. All the changes in world regulatory
2919 * domain are to be done here.
2921 static const struct ieee80211_regdomain brcmf_regdom = {
2922 @@ -5197,10 +5197,10 @@ static s32 brcmf_construct_reginfo(struc
2923 if (channel & WL_CHAN_RADAR)
2924 band_chan_arr[index].flags |=
2925 (IEEE80211_CHAN_RADAR |
2926 - IEEE80211_CHAN_NO_IBSS);
2927 + IEEE80211_CHAN_NO_IR);
2928 if (channel & WL_CHAN_PASSIVE)
2929 band_chan_arr[index].flags |=
2930 - IEEE80211_CHAN_PASSIVE_SCAN;
2931 + IEEE80211_CHAN_NO_IR;
2935 --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
2936 +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
2939 #define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0)
2940 #define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \
2941 - NL80211_RRF_PASSIVE_SCAN | \
2942 - NL80211_RRF_NO_IBSS)
2943 + NL80211_RRF_NO_IR)
2945 #define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \
2946 - NL80211_RRF_PASSIVE_SCAN | \
2947 - NL80211_RRF_NO_IBSS)
2948 + NL80211_RRF_NO_IR)
2949 #define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \
2950 - NL80211_RRF_PASSIVE_SCAN | \
2951 + NL80211_RRF_NO_IR | \
2953 - NL80211_RRF_NO_IBSS)
2954 + NL80211_RRF_NO_IR)
2955 #define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \
2956 - NL80211_RRF_PASSIVE_SCAN | \
2957 + NL80211_RRF_NO_IR | \
2959 - NL80211_RRF_NO_IBSS)
2960 + NL80211_RRF_NO_IR)
2961 #define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \
2962 - NL80211_RRF_PASSIVE_SCAN | \
2963 - NL80211_RRF_NO_IBSS)
2964 + NL80211_RRF_NO_IR)
2966 static const struct ieee80211_regdomain brcms_regdom_x2 = {
2968 @@ -395,7 +392,7 @@ brcms_c_channel_set_chanspec(struct brcm
2969 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
2971 brcms_b_set_chanspec(wlc->hw, chanspec,
2972 - !!(ch->flags & IEEE80211_CHAN_PASSIVE_SCAN),
2973 + !!(ch->flags & IEEE80211_CHAN_NO_IR),
2977 @@ -657,8 +654,8 @@ static void brcms_reg_apply_radar_flags(
2979 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
2980 ch->flags |= IEEE80211_CHAN_RADAR |
2981 - IEEE80211_CHAN_NO_IBSS |
2982 - IEEE80211_CHAN_PASSIVE_SCAN;
2983 + IEEE80211_CHAN_NO_IR |
2984 + IEEE80211_CHAN_NO_IR;
2988 @@ -688,14 +685,13 @@ brcms_reg_apply_beaconing_flags(struct w
2992 - if (!(rule->flags & NL80211_RRF_NO_IBSS))
2993 - ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
2994 - if (!(rule->flags & NL80211_RRF_PASSIVE_SCAN))
2995 + if (!(rule->flags & NL80211_RRF_NO_IR))
2996 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
2997 + if (!(rule->flags & NL80211_RRF_NO_IR))
2999 - ~IEEE80211_CHAN_PASSIVE_SCAN;
3000 + ~IEEE80211_CHAN_NO_IR;
3001 } else if (ch->beacon_found) {
3002 - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
3003 - IEEE80211_CHAN_PASSIVE_SCAN);
3004 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3008 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
3009 +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
3010 @@ -125,13 +125,13 @@ static struct ieee80211_channel brcms_2g
3011 CHAN2GHZ(10, 2457, IEEE80211_CHAN_NO_HT40PLUS),
3012 CHAN2GHZ(11, 2462, IEEE80211_CHAN_NO_HT40PLUS),
3014 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
3015 + IEEE80211_CHAN_NO_IR |
3016 IEEE80211_CHAN_NO_HT40PLUS),
3018 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
3019 + IEEE80211_CHAN_NO_IR |
3020 IEEE80211_CHAN_NO_HT40PLUS),
3022 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
3023 + IEEE80211_CHAN_NO_IR |
3024 IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS |
3025 IEEE80211_CHAN_NO_OFDM)
3027 @@ -144,51 +144,51 @@ static struct ieee80211_channel brcms_5g
3028 CHAN5GHZ(48, IEEE80211_CHAN_NO_HT40PLUS),
3031 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3032 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3033 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3034 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3036 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3037 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3038 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3039 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3041 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3042 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3043 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3044 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3046 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3047 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3048 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3049 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3052 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3053 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3054 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3055 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3057 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3058 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3059 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3060 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3062 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3063 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3064 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3065 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3067 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3068 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3069 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3070 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3072 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3073 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3074 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3075 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3077 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3078 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3079 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3080 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3082 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3083 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3084 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3085 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3087 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3088 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3089 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3090 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3092 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3093 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
3094 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3095 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
3097 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3098 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
3099 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3100 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
3102 - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
3103 - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS |
3104 + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
3105 + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS |
3106 IEEE80211_CHAN_NO_HT40MINUS),
3108 CHAN5GHZ(149, IEEE80211_CHAN_NO_HT40MINUS),
3109 --- a/drivers/net/wireless/cw1200/scan.c
3110 +++ b/drivers/net/wireless/cw1200/scan.c
3111 @@ -197,9 +197,9 @@ void cw1200_scan_work(struct work_struct
3112 if ((*it)->band != first->band)
3114 if (((*it)->flags ^ first->flags) &
3115 - IEEE80211_CHAN_PASSIVE_SCAN)
3116 + IEEE80211_CHAN_NO_IR)
3118 - if (!(first->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
3119 + if (!(first->flags & IEEE80211_CHAN_NO_IR) &&
3120 (*it)->max_power != first->max_power)
3123 @@ -210,7 +210,7 @@ void cw1200_scan_work(struct work_struct
3125 scan.max_tx_rate = WSM_TRANSMIT_RATE_1;
3127 - (first->flags & IEEE80211_CHAN_PASSIVE_SCAN) ? 0 : 2;
3128 + (first->flags & IEEE80211_CHAN_NO_IR) ? 0 : 2;
3129 scan.num_ssids = priv->scan.n_ssids;
3130 scan.ssids = &priv->scan.ssids[0];
3131 scan.num_channels = it - priv->scan.curr;
3132 @@ -233,7 +233,7 @@ void cw1200_scan_work(struct work_struct
3134 for (i = 0; i < scan.num_channels; ++i) {
3135 scan.ch[i].number = priv->scan.curr[i]->hw_value;
3136 - if (priv->scan.curr[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN) {
3137 + if (priv->scan.curr[i]->flags & IEEE80211_CHAN_NO_IR) {
3138 scan.ch[i].min_chan_time = 50;
3139 scan.ch[i].max_chan_time = 100;
3141 @@ -241,7 +241,7 @@ void cw1200_scan_work(struct work_struct
3142 scan.ch[i].max_chan_time = 25;
3145 - if (!(first->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
3146 + if (!(first->flags & IEEE80211_CHAN_NO_IR) &&
3147 priv->scan.output_power != first->max_power) {
3148 priv->scan.output_power = first->max_power;
3149 wsm_set_output_power(priv,
3150 --- a/drivers/net/wireless/ipw2x00/ipw2100.c
3151 +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
3152 @@ -1934,10 +1934,10 @@ static int ipw2100_wdev_init(struct net_
3153 bg_band->channels[i].max_power = geo->bg[i].max_power;
3154 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
3155 bg_band->channels[i].flags |=
3156 - IEEE80211_CHAN_PASSIVE_SCAN;
3157 + IEEE80211_CHAN_NO_IR;
3158 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
3159 bg_band->channels[i].flags |=
3160 - IEEE80211_CHAN_NO_IBSS;
3161 + IEEE80211_CHAN_NO_IR;
3162 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
3163 bg_band->channels[i].flags |=
3164 IEEE80211_CHAN_RADAR;
3165 --- a/drivers/net/wireless/ipw2x00/ipw2200.c
3166 +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
3167 @@ -11472,10 +11472,10 @@ static int ipw_wdev_init(struct net_devi
3168 bg_band->channels[i].max_power = geo->bg[i].max_power;
3169 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
3170 bg_band->channels[i].flags |=
3171 - IEEE80211_CHAN_PASSIVE_SCAN;
3172 + IEEE80211_CHAN_NO_IR;
3173 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
3174 bg_band->channels[i].flags |=
3175 - IEEE80211_CHAN_NO_IBSS;
3176 + IEEE80211_CHAN_NO_IR;
3177 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
3178 bg_band->channels[i].flags |=
3179 IEEE80211_CHAN_RADAR;
3180 @@ -11511,10 +11511,10 @@ static int ipw_wdev_init(struct net_devi
3181 a_band->channels[i].max_power = geo->a[i].max_power;
3182 if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY)
3183 a_band->channels[i].flags |=
3184 - IEEE80211_CHAN_PASSIVE_SCAN;
3185 + IEEE80211_CHAN_NO_IR;
3186 if (geo->a[i].flags & LIBIPW_CH_NO_IBSS)
3187 a_band->channels[i].flags |=
3188 - IEEE80211_CHAN_NO_IBSS;
3189 + IEEE80211_CHAN_NO_IR;
3190 if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT)
3191 a_band->channels[i].flags |=
3192 IEEE80211_CHAN_RADAR;
3193 --- a/drivers/net/wireless/iwlegacy/3945-mac.c
3194 +++ b/drivers/net/wireless/iwlegacy/3945-mac.c
3195 @@ -1595,7 +1595,7 @@ il3945_get_channels_for_scan(struct il_p
3196 * and use long active_dwell time.
3198 if (!is_active || il_is_channel_passive(ch_info) ||
3199 - (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)) {
3200 + (chan->flags & IEEE80211_CHAN_NO_IR)) {
3201 scan_ch->type = 0; /* passive */
3202 if (IL_UCODE_API(il->ucode_ver) == 1)
3203 scan_ch->active_dwell =
3204 --- a/drivers/net/wireless/iwlegacy/4965-mac.c
3205 +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
3206 @@ -805,7 +805,7 @@ il4965_get_channels_for_scan(struct il_p
3209 if (!is_active || il_is_channel_passive(ch_info) ||
3210 - (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN))
3211 + (chan->flags & IEEE80211_CHAN_NO_IR))
3212 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
3214 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
3215 --- a/drivers/net/wireless/iwlegacy/common.c
3216 +++ b/drivers/net/wireless/iwlegacy/common.c
3217 @@ -3447,10 +3447,10 @@ il_init_geos(struct il_priv *il)
3219 if (il_is_channel_valid(ch)) {
3220 if (!(ch->flags & EEPROM_CHANNEL_IBSS))
3221 - geo_ch->flags |= IEEE80211_CHAN_NO_IBSS;
3222 + geo_ch->flags |= IEEE80211_CHAN_NO_IR;
3224 if (!(ch->flags & EEPROM_CHANNEL_ACTIVE))
3225 - geo_ch->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
3226 + geo_ch->flags |= IEEE80211_CHAN_NO_IR;
3228 if (ch->flags & EEPROM_CHANNEL_RADAR)
3229 geo_ch->flags |= IEEE80211_CHAN_RADAR;
3230 --- a/drivers/net/wireless/iwlegacy/debug.c
3231 +++ b/drivers/net/wireless/iwlegacy/debug.c
3232 @@ -567,12 +567,12 @@ il_dbgfs_channels_read(struct file *file
3233 flags & IEEE80211_CHAN_RADAR ?
3234 " (IEEE 802.11h required)" : "",
3236 - flags & IEEE80211_CHAN_NO_IBSS) ||
3237 + flags & IEEE80211_CHAN_NO_IR) ||
3239 flags & IEEE80211_CHAN_RADAR)) ? "" :
3242 - flags & IEEE80211_CHAN_PASSIVE_SCAN ?
3243 + flags & IEEE80211_CHAN_NO_IR ?
3244 "passive only" : "active/passive");
3246 supp_band = il_get_hw_mode(il, IEEE80211_BAND_5GHZ);
3247 @@ -594,12 +594,12 @@ il_dbgfs_channels_read(struct file *file
3248 flags & IEEE80211_CHAN_RADAR ?
3249 " (IEEE 802.11h required)" : "",
3251 - flags & IEEE80211_CHAN_NO_IBSS) ||
3252 + flags & IEEE80211_CHAN_NO_IR) ||
3254 flags & IEEE80211_CHAN_RADAR)) ? "" :
3257 - flags & IEEE80211_CHAN_PASSIVE_SCAN ?
3258 + flags & IEEE80211_CHAN_NO_IR ?
3259 "passive only" : "active/passive");
3261 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
3262 --- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
3263 +++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
3264 @@ -352,12 +352,12 @@ static ssize_t iwl_dbgfs_channels_read(s
3265 channels[i].max_power,
3266 channels[i].flags & IEEE80211_CHAN_RADAR ?
3267 " (IEEE 802.11h required)" : "",
3268 - ((channels[i].flags & IEEE80211_CHAN_NO_IBSS)
3269 + ((channels[i].flags & IEEE80211_CHAN_NO_IR)
3270 || (channels[i].flags &
3271 IEEE80211_CHAN_RADAR)) ? "" :
3274 - IEEE80211_CHAN_PASSIVE_SCAN ?
3275 + IEEE80211_CHAN_NO_IR ?
3276 "passive only" : "active/passive");
3278 supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ);
3279 @@ -375,12 +375,12 @@ static ssize_t iwl_dbgfs_channels_read(s
3280 channels[i].max_power,
3281 channels[i].flags & IEEE80211_CHAN_RADAR ?
3282 " (IEEE 802.11h required)" : "",
3283 - ((channels[i].flags & IEEE80211_CHAN_NO_IBSS)
3284 + ((channels[i].flags & IEEE80211_CHAN_NO_IR)
3285 || (channels[i].flags &
3286 IEEE80211_CHAN_RADAR)) ? "" :
3289 - IEEE80211_CHAN_PASSIVE_SCAN ?
3290 + IEEE80211_CHAN_NO_IR ?
3291 "passive only" : "active/passive");
3293 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
3294 --- a/drivers/net/wireless/iwlwifi/dvm/scan.c
3295 +++ b/drivers/net/wireless/iwlwifi/dvm/scan.c
3296 @@ -544,7 +544,7 @@ static int iwl_get_channels_for_scan(str
3297 channel = chan->hw_value;
3298 scan_ch->channel = cpu_to_le16(channel);
3300 - if (!is_active || (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN))
3301 + if (!is_active || (chan->flags & IEEE80211_CHAN_NO_IR))
3302 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
3304 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
3305 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
3306 +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
3307 @@ -614,10 +614,10 @@ static int iwl_init_channel_map(struct d
3308 channel->flags = IEEE80211_CHAN_NO_HT40;
3310 if (!(eeprom_ch->flags & EEPROM_CHANNEL_IBSS))
3311 - channel->flags |= IEEE80211_CHAN_NO_IBSS;
3312 + channel->flags |= IEEE80211_CHAN_NO_IR;
3314 if (!(eeprom_ch->flags & EEPROM_CHANNEL_ACTIVE))
3315 - channel->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
3316 + channel->flags |= IEEE80211_CHAN_NO_IR;
3318 if (eeprom_ch->flags & EEPROM_CHANNEL_RADAR)
3319 channel->flags |= IEEE80211_CHAN_RADAR;
3320 --- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
3321 +++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
3322 @@ -223,10 +223,10 @@ static int iwl_init_channel_map(struct d
3323 channel->flags |= IEEE80211_CHAN_NO_160MHZ;
3325 if (!(ch_flags & NVM_CHANNEL_IBSS))
3326 - channel->flags |= IEEE80211_CHAN_NO_IBSS;
3327 + channel->flags |= IEEE80211_CHAN_NO_IR;
3329 if (!(ch_flags & NVM_CHANNEL_ACTIVE))
3330 - channel->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
3331 + channel->flags |= IEEE80211_CHAN_NO_IR;
3333 if (ch_flags & NVM_CHANNEL_RADAR)
3334 channel->flags |= IEEE80211_CHAN_RADAR;
3335 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c
3336 +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
3337 @@ -192,7 +192,7 @@ static void iwl_mvm_scan_fill_channels(s
3338 for (i = 0; i < cmd->channel_count; i++) {
3339 chan->channel = cpu_to_le16(req->channels[i]->hw_value);
3340 chan->type = cpu_to_le32(type);
3341 - if (req->channels[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3342 + if (req->channels[i]->flags & IEEE80211_CHAN_NO_IR)
3343 chan->type &= cpu_to_le32(~SCAN_CHANNEL_TYPE_ACTIVE);
3344 chan->active_dwell = cpu_to_le16(active_dwell);
3345 chan->passive_dwell = cpu_to_le16(passive_dwell);
3346 @@ -642,7 +642,7 @@ static void iwl_build_channel_cfg(struct
3347 channels->iter_count[index] = cpu_to_le16(1);
3348 channels->iter_interval[index] = 0;
3350 - if (!(s_band->channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN))
3351 + if (!(s_band->channels[i].flags & IEEE80211_CHAN_NO_IR))
3352 channels->type[index] |=
3353 cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE);
3355 --- a/drivers/net/wireless/mac80211_hwsim.c
3356 +++ b/drivers/net/wireless/mac80211_hwsim.c
3357 @@ -159,7 +159,7 @@ static const struct ieee80211_regdomain
3359 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0),
3360 REG_RULE(5725-10, 5850+10, 40, 0, 30,
3361 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
3362 + NL80211_RRF_NO_IR),
3366 @@ -1485,7 +1485,7 @@ static void hw_scan_work(struct work_str
3367 req->channels[hwsim->scan_chan_idx]->center_freq);
3369 hwsim->tmp_chan = req->channels[hwsim->scan_chan_idx];
3370 - if (hwsim->tmp_chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
3371 + if (hwsim->tmp_chan->flags & IEEE80211_CHAN_NO_IR ||
3375 --- a/drivers/net/wireless/mwifiex/cfg80211.c
3376 +++ b/drivers/net/wireless/mwifiex/cfg80211.c
3377 @@ -50,24 +50,24 @@ static const struct ieee80211_regdomain
3378 REG_RULE(2412-10, 2462+10, 40, 3, 20, 0),
3379 /* Channel 12 - 13 */
3380 REG_RULE(2467-10, 2472+10, 20, 3, 20,
3381 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
3382 + NL80211_RRF_NO_IR),
3384 REG_RULE(2484-10, 2484+10, 20, 3, 20,
3385 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS |
3386 + NL80211_RRF_NO_IR |
3387 NL80211_RRF_NO_OFDM),
3388 /* Channel 36 - 48 */
3389 REG_RULE(5180-10, 5240+10, 40, 3, 20,
3390 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
3391 + NL80211_RRF_NO_IR),
3392 /* Channel 149 - 165 */
3393 REG_RULE(5745-10, 5825+10, 40, 3, 20,
3394 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
3395 + NL80211_RRF_NO_IR),
3396 /* Channel 52 - 64 */
3397 REG_RULE(5260-10, 5320+10, 40, 3, 30,
3398 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS |
3399 + NL80211_RRF_NO_IR |
3401 /* Channel 100 - 140 */
3402 REG_RULE(5500-10, 5700+10, 40, 3, 30,
3403 - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS |
3404 + NL80211_RRF_NO_IR |
3408 @@ -1968,7 +1968,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiph
3409 user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
3410 user_scan_cfg->chan_list[i].radio_type = chan->band;
3412 - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3413 + if (chan->flags & IEEE80211_CHAN_NO_IR)
3414 user_scan_cfg->chan_list[i].scan_type =
3415 MWIFIEX_SCAN_TYPE_PASSIVE;
3417 --- a/drivers/net/wireless/mwifiex/scan.c
3418 +++ b/drivers/net/wireless/mwifiex/scan.c
3419 @@ -515,14 +515,14 @@ mwifiex_scan_create_channel_list(struct
3420 scan_chan_list[chan_idx].max_scan_time =
3421 cpu_to_le16((u16) user_scan_in->
3422 chan_list[0].scan_time);
3423 - else if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3424 + else if (ch->flags & IEEE80211_CHAN_NO_IR)
3425 scan_chan_list[chan_idx].max_scan_time =
3426 cpu_to_le16(adapter->passive_scan_time);
3428 scan_chan_list[chan_idx].max_scan_time =
3429 cpu_to_le16(adapter->active_scan_time);
3431 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3432 + if (ch->flags & IEEE80211_CHAN_NO_IR)
3433 scan_chan_list[chan_idx].chan_scan_mode_bitmap
3434 |= MWIFIEX_PASSIVE_SCAN;
3436 --- a/drivers/net/wireless/rt2x00/rt2x00lib.h
3437 +++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
3438 @@ -146,7 +146,7 @@ void rt2x00queue_remove_l2pad(struct sk_
3439 * @local: frame is not from mac80211
3441 int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
3443 + struct ieee80211_sta *sta, bool local);
3446 * rt2x00queue_update_beacon - Send new beacon from mac80211
3447 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c
3448 +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
3449 @@ -90,7 +90,7 @@ static int rt2x00mac_tx_rts_cts(struct r
3450 frag_skb->data, data_length, tx_info,
3451 (struct ieee80211_rts *)(skb->data));
3453 - retval = rt2x00queue_write_tx_frame(queue, skb, true);
3454 + retval = rt2x00queue_write_tx_frame(queue, skb, NULL, true);
3456 dev_kfree_skb_any(skb);
3457 rt2x00_warn(rt2x00dev, "Failed to send RTS/CTS frame\n");
3458 @@ -151,7 +151,7 @@ void rt2x00mac_tx(struct ieee80211_hw *h
3462 - if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
3463 + if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
3467 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
3468 +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
3469 @@ -635,7 +635,7 @@ static void rt2x00queue_bar_check(struct
3472 int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
3474 + struct ieee80211_sta *sta, bool local)
3476 struct ieee80211_tx_info *tx_info;
3477 struct queue_entry *entry;
3478 @@ -649,7 +649,7 @@ int rt2x00queue_write_tx_frame(struct da
3479 * after that we are free to use the skb->cb array
3480 * for our information.
3482 - rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, NULL);
3483 + rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, sta);
3486 * All information is retrieved from the skb->cb array,
3487 --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
3488 +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
3489 @@ -416,7 +416,7 @@ static int rtl8187_init_urbs(struct ieee
3490 struct rtl8187_rx_info *info;
3493 - while (skb_queue_len(&priv->rx_queue) < 16) {
3494 + while (skb_queue_len(&priv->rx_queue) < 32) {
3495 skb = __dev_alloc_skb(RTL8187_MAX_RX, GFP_KERNEL);
3498 --- a/drivers/net/wireless/rtlwifi/base.c
3499 +++ b/drivers/net/wireless/rtlwifi/base.c
3500 @@ -1078,8 +1078,8 @@ u8 rtl_is_special_data(struct ieee80211_
3502 ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len +
3503 SNAP_SIZE + PROTOC_TYPE_SIZE);
3504 - ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE);
3505 - /* ether_type = ntohs(ether_type); */
3506 + ether_type = be16_to_cpu(*(__be16 *)((u8 *)skb->data + mac_hdr_len +
3509 if (ETH_P_IP == ether_type) {
3510 if (IPPROTO_UDP == ip->protocol) {
3511 --- a/drivers/net/wireless/rtlwifi/regd.c
3512 +++ b/drivers/net/wireless/rtlwifi/regd.c
3513 @@ -59,30 +59,27 @@ static struct country_code_to_enum_rd al
3515 #define RTL819x_2GHZ_CH12_13 \
3516 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
3517 - NL80211_RRF_PASSIVE_SCAN)
3518 + NL80211_RRF_NO_IR)
3520 #define RTL819x_2GHZ_CH14 \
3521 REG_RULE(2484-10, 2484+10, 40, 0, 20, \
3522 - NL80211_RRF_PASSIVE_SCAN | \
3523 + NL80211_RRF_NO_IR | \
3524 NL80211_RRF_NO_OFDM)
3526 /* 5G chan 36 - chan 64*/
3527 #define RTL819x_5GHZ_5150_5350 \
3528 REG_RULE(5150-10, 5350+10, 40, 0, 30, \
3529 - NL80211_RRF_PASSIVE_SCAN | \
3530 - NL80211_RRF_NO_IBSS)
3531 + NL80211_RRF_NO_IR)
3533 /* 5G chan 100 - chan 165*/
3534 #define RTL819x_5GHZ_5470_5850 \
3535 REG_RULE(5470-10, 5850+10, 40, 0, 30, \
3536 - NL80211_RRF_PASSIVE_SCAN | \
3537 - NL80211_RRF_NO_IBSS)
3538 + NL80211_RRF_NO_IR)
3540 /* 5G chan 149 - chan 165*/
3541 #define RTL819x_5GHZ_5725_5850 \
3542 REG_RULE(5725-10, 5850+10, 40, 0, 30, \
3543 - NL80211_RRF_PASSIVE_SCAN | \
3544 - NL80211_RRF_NO_IBSS)
3545 + NL80211_RRF_NO_IR)
3547 #define RTL819x_5GHZ_ALL \
3548 (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850)
3549 @@ -185,16 +182,15 @@ static void _rtl_reg_apply_beaconing_fla
3553 - if (!(reg_rule->flags & NL80211_RRF_NO_IBSS))
3554 - ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
3555 + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
3556 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3558 - flags & NL80211_RRF_PASSIVE_SCAN))
3559 + flags & NL80211_RRF_NO_IR))
3561 - ~IEEE80211_CHAN_PASSIVE_SCAN;
3562 + ~IEEE80211_CHAN_NO_IR;
3564 if (ch->beacon_found)
3565 - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
3566 - IEEE80211_CHAN_PASSIVE_SCAN);
3567 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3571 @@ -219,11 +215,11 @@ static void _rtl_reg_apply_active_scan_f
3573 if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
3574 ch = &sband->channels[11]; /* CH 12 */
3575 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3576 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
3577 + if (ch->flags & IEEE80211_CHAN_NO_IR)
3578 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3579 ch = &sband->channels[12]; /* CH 13 */
3580 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3581 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
3582 + if (ch->flags & IEEE80211_CHAN_NO_IR)
3583 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3587 @@ -237,17 +233,17 @@ static void _rtl_reg_apply_active_scan_f
3588 ch = &sband->channels[11]; /* CH 12 */
3589 reg_rule = freq_reg_info(wiphy, ch->center_freq);
3590 if (!IS_ERR(reg_rule)) {
3591 - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
3592 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3593 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
3594 + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
3595 + if (ch->flags & IEEE80211_CHAN_NO_IR)
3596 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3599 ch = &sband->channels[12]; /* CH 13 */
3600 reg_rule = freq_reg_info(wiphy, ch->center_freq);
3601 if (!IS_ERR(reg_rule)) {
3602 - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
3603 - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
3604 - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
3605 + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
3606 + if (ch->flags & IEEE80211_CHAN_NO_IR)
3607 + ch->flags &= ~IEEE80211_CHAN_NO_IR;
3611 @@ -284,8 +280,8 @@ static void _rtl_reg_apply_radar_flags(s
3613 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
3614 ch->flags |= IEEE80211_CHAN_RADAR |
3615 - IEEE80211_CHAN_NO_IBSS |
3616 - IEEE80211_CHAN_PASSIVE_SCAN;
3617 + IEEE80211_CHAN_NO_IR |
3618 + IEEE80211_CHAN_NO_IR;
3622 --- a/drivers/net/wireless/ti/wl12xx/scan.c
3623 +++ b/drivers/net/wireless/ti/wl12xx/scan.c
3624 @@ -47,7 +47,7 @@ static int wl1271_get_scan_channels(stru
3625 * In active scans, we only scan channels not
3626 * marked as passive.
3628 - (passive || !(flags & IEEE80211_CHAN_PASSIVE_SCAN))) {
3629 + (passive || !(flags & IEEE80211_CHAN_NO_IR))) {
3630 wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
3631 req->channels[i]->band,
3632 req->channels[i]->center_freq);
3633 --- a/drivers/net/wireless/ti/wlcore/cmd.c
3634 +++ b/drivers/net/wireless/ti/wlcore/cmd.c
3635 @@ -1688,7 +1688,7 @@ int wlcore_cmd_regdomain_config_locked(s
3637 if (channel->flags & (IEEE80211_CHAN_DISABLED |
3638 IEEE80211_CHAN_RADAR |
3639 - IEEE80211_CHAN_PASSIVE_SCAN))
3640 + IEEE80211_CHAN_NO_IR))
3643 ch_bit_idx = wlcore_get_reg_conf_ch_idx(b, ch);
3644 --- a/drivers/net/wireless/ti/wlcore/main.c
3645 +++ b/drivers/net/wireless/ti/wlcore/main.c
3646 @@ -91,8 +91,7 @@ static void wl1271_reg_notify(struct wip
3649 if (ch->flags & IEEE80211_CHAN_RADAR)
3650 - ch->flags |= IEEE80211_CHAN_NO_IBSS |
3651 - IEEE80211_CHAN_PASSIVE_SCAN;
3652 + ch->flags |= IEEE80211_CHAN_NO_IR;
3656 --- a/drivers/net/wireless/ti/wlcore/scan.c
3657 +++ b/drivers/net/wireless/ti/wlcore/scan.c
3658 @@ -189,14 +189,14 @@ wlcore_scan_get_channels(struct wl1271 *
3659 flags = req_channels[i]->flags;
3662 - flags |= IEEE80211_CHAN_PASSIVE_SCAN;
3663 + flags |= IEEE80211_CHAN_NO_IR;
3665 if ((req_channels[i]->band == band) &&
3666 !(flags & IEEE80211_CHAN_DISABLED) &&
3667 (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
3668 /* if radar is set, we ignore the passive flag */
3670 - !!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) {
3671 + !!(flags & IEEE80211_CHAN_NO_IR) == passive)) {
3674 if (flags & IEEE80211_CHAN_RADAR) {
3675 @@ -221,7 +221,7 @@ wlcore_scan_get_channels(struct wl1271 *
3676 (band == IEEE80211_BAND_2GHZ) &&
3677 (channels[j].channel >= 12) &&
3678 (channels[j].channel <= 14) &&
3679 - (flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
3680 + (flags & IEEE80211_CHAN_NO_IR) &&
3682 /* pactive channels treated as DFS */
3683 channels[j].flags = SCAN_CHANNEL_FLAGS_DFS;
3684 @@ -244,7 +244,7 @@ wlcore_scan_get_channels(struct wl1271 *
3685 max_dwell_time_active,
3686 flags & IEEE80211_CHAN_RADAR ?
3688 - flags & IEEE80211_CHAN_PASSIVE_SCAN ?
3689 + flags & IEEE80211_CHAN_NO_IR ?
3693 --- a/include/net/cfg80211.h
3694 +++ b/include/net/cfg80211.h
3695 @@ -91,9 +91,8 @@ enum ieee80211_band {
3696 * Channel flags set by the regulatory control code.
3698 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
3699 - * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted
3700 - * on this channel.
3701 - * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
3702 + * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
3703 + * sending probe requests or beaconing.
3704 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
3705 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
3707 @@ -113,8 +112,8 @@ enum ieee80211_band {
3709 enum ieee80211_channel_flags {
3710 IEEE80211_CHAN_DISABLED = 1<<0,
3711 - IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
3712 - IEEE80211_CHAN_NO_IBSS = 1<<2,
3713 + IEEE80211_CHAN_NO_IR = 1<<1,
3714 + /* hole at 1<<2 */
3715 IEEE80211_CHAN_RADAR = 1<<3,
3716 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
3717 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
3718 @@ -4149,6 +4148,7 @@ void cfg80211_radar_event(struct wiphy *
3720 * cfg80211_cac_event - Channel availability check (CAC) event
3721 * @netdev: network device
3722 + * @chandef: chandef for the current channel
3723 * @event: type of event
3724 * @gfp: context flags
3726 @@ -4157,6 +4157,7 @@ void cfg80211_radar_event(struct wiphy *
3727 * also by full-MAC drivers.
3729 void cfg80211_cac_event(struct net_device *netdev,
3730 + const struct cfg80211_chan_def *chandef,
3731 enum nl80211_radar_event event, gfp_t gfp);
3734 @@ -4282,7 +4283,8 @@ bool cfg80211_reg_can_beacon(struct wiph
3735 * @dev: the device which switched channels
3736 * @chandef: the new channel definition
3738 - * Acquires wdev_lock, so must only be called from sleepable driver context!
3739 + * Caller must acquire wdev_lock, therefore must only be called from sleepable
3742 void cfg80211_ch_switch_notify(struct net_device *dev,
3743 struct cfg80211_chan_def *chandef);
3744 --- a/include/uapi/linux/nl80211.h
3745 +++ b/include/uapi/linux/nl80211.h
3746 @@ -1508,6 +1508,12 @@ enum nl80211_commands {
3747 * to react to radar events, e.g. initiate a channel switch or leave the
3750 + * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
3751 + * 5 MHz channel bandwidth.
3753 + * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
3754 + * 10 MHz channel bandwidth.
3756 * @NL80211_ATTR_MAX: highest attribute number currently defined
3757 * @__NL80211_ATTR_AFTER_LAST: internal use
3759 @@ -1824,6 +1830,9 @@ enum nl80211_attrs {
3761 NL80211_ATTR_HANDLE_DFS,
3763 + NL80211_ATTR_SUPPORT_5_MHZ,
3764 + NL80211_ATTR_SUPPORT_10_MHZ,
3766 /* add attributes here, update the policy in nl80211.c */
3768 __NL80211_ATTR_AFTER_LAST,
3769 @@ -2224,10 +2233,9 @@ enum nl80211_band_attr {
3770 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
3771 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
3772 * regulatory domain.
3773 - * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
3774 - * permitted on this channel in current regulatory domain.
3775 - * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
3776 - * on this channel in current regulatory domain.
3777 + * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
3778 + * are permitted on this channel, this includes sending probe
3779 + * requests, or modes of operation that require beaconing.
3780 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
3781 * on this channel in current regulatory domain.
3782 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
3783 @@ -2254,8 +2262,8 @@ enum nl80211_frequency_attr {
3784 __NL80211_FREQUENCY_ATTR_INVALID,
3785 NL80211_FREQUENCY_ATTR_FREQ,
3786 NL80211_FREQUENCY_ATTR_DISABLED,
3787 - NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
3788 - NL80211_FREQUENCY_ATTR_NO_IBSS,
3789 + NL80211_FREQUENCY_ATTR_NO_IR,
3790 + __NL80211_FREQUENCY_ATTR_NO_IBSS,
3791 NL80211_FREQUENCY_ATTR_RADAR,
3792 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
3793 NL80211_FREQUENCY_ATTR_DFS_STATE,
3794 @@ -2271,6 +2279,9 @@ enum nl80211_frequency_attr {
3797 #define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
3798 +#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
3799 +#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
3800 +#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
3803 * enum nl80211_bitrate_attr - bitrate attributes
3804 @@ -2413,8 +2424,9 @@ enum nl80211_sched_scan_match_attr {
3805 * @NL80211_RRF_DFS: DFS support is required to be used
3806 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
3807 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
3808 - * @NL80211_RRF_PASSIVE_SCAN: passive scan is required
3809 - * @NL80211_RRF_NO_IBSS: no IBSS is allowed
3810 + * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
3811 + * this includes probe requests or modes of operation that require
3814 enum nl80211_reg_rule_flags {
3815 NL80211_RRF_NO_OFDM = 1<<0,
3816 @@ -2424,10 +2436,17 @@ enum nl80211_reg_rule_flags {
3817 NL80211_RRF_DFS = 1<<4,
3818 NL80211_RRF_PTP_ONLY = 1<<5,
3819 NL80211_RRF_PTMP_ONLY = 1<<6,
3820 - NL80211_RRF_PASSIVE_SCAN = 1<<7,
3821 - NL80211_RRF_NO_IBSS = 1<<8,
3822 + NL80211_RRF_NO_IR = 1<<7,
3823 + __NL80211_RRF_NO_IBSS = 1<<8,
3826 +#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
3827 +#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
3828 +#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
3830 +/* For backport compatibility with older userspace */
3831 +#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
3834 * enum nl80211_dfs_regions - regulatory DFS regions
3836 --- a/net/mac80211/cfg.c
3837 +++ b/net/mac80211/cfg.c
3838 @@ -846,7 +846,7 @@ static int ieee80211_set_probe_resp(stru
3839 if (!resp || !resp_len)
3842 - old = rtnl_dereference(sdata->u.ap.probe_resp);
3843 + old = sdata_dereference(sdata->u.ap.probe_resp, sdata);
3845 new = kzalloc(sizeof(struct probe_resp) + resp_len, GFP_KERNEL);
3847 @@ -870,7 +870,8 @@ int ieee80211_assign_beacon(struct ieee8
3849 u32 changed = BSS_CHANGED_BEACON;
3851 - old = rtnl_dereference(sdata->u.ap.beacon);
3852 + old = sdata_dereference(sdata->u.ap.beacon, sdata);
3855 /* Need to have a beacon head if we don't have one yet */
3856 if (!params->head && !old)
3857 @@ -947,7 +948,7 @@ static int ieee80211_start_ap(struct wip
3861 - old = rtnl_dereference(sdata->u.ap.beacon);
3862 + old = sdata_dereference(sdata->u.ap.beacon, sdata);
3866 @@ -1001,7 +1002,8 @@ static int ieee80211_start_ap(struct wip
3868 err = drv_start_ap(sdata->local, sdata);
3870 - old = rtnl_dereference(sdata->u.ap.beacon);
3871 + old = sdata_dereference(sdata->u.ap.beacon, sdata);
3874 kfree_rcu(old, rcu_head);
3875 RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
3876 @@ -1032,7 +1034,7 @@ static int ieee80211_change_beacon(struc
3877 if (sdata->vif.csa_active)
3880 - old = rtnl_dereference(sdata->u.ap.beacon);
3881 + old = sdata_dereference(sdata->u.ap.beacon, sdata);
3885 @@ -1050,15 +1052,18 @@ static int ieee80211_stop_ap(struct wiph
3886 struct ieee80211_local *local = sdata->local;
3887 struct beacon_data *old_beacon;
3888 struct probe_resp *old_probe_resp;
3889 + struct cfg80211_chan_def chandef;
3891 - old_beacon = rtnl_dereference(sdata->u.ap.beacon);
3892 + old_beacon = sdata_dereference(sdata->u.ap.beacon, sdata);
3895 - old_probe_resp = rtnl_dereference(sdata->u.ap.probe_resp);
3896 + old_probe_resp = sdata_dereference(sdata->u.ap.probe_resp, sdata);
3898 /* abort any running channel switch */
3899 sdata->vif.csa_active = false;
3900 - cancel_work_sync(&sdata->csa_finalize_work);
3901 + kfree(sdata->u.ap.next_beacon);
3902 + sdata->u.ap.next_beacon = NULL;
3904 cancel_work_sync(&sdata->u.ap.request_smps_work);
3906 /* turn off carrier for this interface and dependent VLANs */
3907 @@ -1091,8 +1096,10 @@ static int ieee80211_stop_ap(struct wiph
3908 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
3910 if (sdata->wdev.cac_started) {
3911 + chandef = sdata->vif.bss_conf.chandef;
3912 cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
3913 - cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED,
3914 + cfg80211_cac_event(sdata->dev, &chandef,
3915 + NL80211_RADAR_CAC_ABORTED,
3919 @@ -1368,7 +1375,7 @@ static int sta_apply_parameters(struct i
3921 ieee80211_mps_set_sta_local_pm(sta,
3923 - ieee80211_bss_info_change_notify(sdata, changed);
3924 + ieee80211_mbss_info_change_notify(sdata, changed);
3928 @@ -1953,7 +1960,7 @@ static int ieee80211_change_bss(struct w
3929 enum ieee80211_band band;
3932 - if (!rtnl_dereference(sdata->u.ap.beacon))
3933 + if (!sdata_dereference(sdata->u.ap.beacon, sdata))
3936 band = ieee80211_get_sdata_band(sdata);
3937 @@ -2964,27 +2971,33 @@ void ieee80211_csa_finalize_work(struct
3938 struct ieee80211_local *local = sdata->local;
3939 int err, changed = 0;
3941 + sdata_lock(sdata);
3942 + /* AP might have been stopped while waiting for the lock. */
3943 + if (!sdata->vif.csa_active)
3946 if (!ieee80211_sdata_running(sdata))
3950 sdata->radar_required = sdata->csa_radar_required;
3951 - err = ieee80211_vif_change_channel(sdata, &local->csa_chandef,
3953 + err = ieee80211_vif_change_channel(sdata, &changed);
3954 if (WARN_ON(err < 0))
3958 if (!local->use_chanctx) {
3959 - local->_oper_chandef = local->csa_chandef;
3960 + local->_oper_chandef = sdata->csa_chandef;
3961 ieee80211_hw_config(local, 0);
3964 ieee80211_bss_info_change_notify(sdata, changed);
3966 + sdata->vif.csa_active = false;
3967 switch (sdata->vif.type) {
3968 case NL80211_IFTYPE_AP:
3969 err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon);
3975 kfree(sdata->u.ap.next_beacon);
3976 sdata->u.ap.next_beacon = NULL;
3977 @@ -2998,20 +3011,22 @@ void ieee80211_csa_finalize_work(struct
3978 case NL80211_IFTYPE_MESH_POINT:
3979 err = ieee80211_mesh_finish_csa(sdata);
3990 - sdata->vif.csa_active = false;
3992 ieee80211_wake_queues_by_reason(&sdata->local->hw,
3993 IEEE80211_MAX_QUEUE_MAP,
3994 IEEE80211_QUEUE_STOP_REASON_CSA);
3996 - cfg80211_ch_switch_notify(sdata->dev, &local->csa_chandef);
3997 + cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
4000 + sdata_unlock(sdata);
4003 static int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
4004 @@ -3024,6 +3039,8 @@ static int ieee80211_channel_switch(stru
4005 struct ieee80211_if_mesh __maybe_unused *ifmsh;
4006 int err, num_chanctx;
4008 + lockdep_assert_held(&sdata->wdev.mtx);
4010 if (!list_empty(&local->roc_list) || local->scanning)
4013 @@ -3120,9 +3137,17 @@ static int ieee80211_channel_switch(stru
4014 params->chandef.chan->band)
4017 + ifmsh->chsw_init = true;
4018 + if (!ifmsh->pre_value)
4019 + ifmsh->pre_value = 1;
4021 + ifmsh->pre_value++;
4023 err = ieee80211_mesh_csa_beacon(sdata, params, true);
4026 + ifmsh->chsw_init = false;
4032 @@ -3136,7 +3161,7 @@ static int ieee80211_channel_switch(stru
4033 IEEE80211_MAX_QUEUE_MAP,
4034 IEEE80211_QUEUE_STOP_REASON_CSA);
4036 - local->csa_chandef = params->chandef;
4037 + sdata->csa_chandef = params->chandef;
4038 sdata->vif.csa_active = true;
4040 ieee80211_bss_info_change_notify(sdata, err);
4041 --- a/net/mac80211/iface.c
4042 +++ b/net/mac80211/iface.c
4043 @@ -749,6 +749,7 @@ static void ieee80211_do_stop(struct iee
4044 u32 hw_reconf_flags = 0;
4047 + struct cfg80211_chan_def chandef;
4049 clear_bit(SDATA_STATE_RUNNING, &sdata->state);
4051 @@ -828,11 +829,13 @@ static void ieee80211_do_stop(struct iee
4052 cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
4054 if (sdata->wdev.cac_started) {
4055 + chandef = sdata->vif.bss_conf.chandef;
4056 WARN_ON(local->suspended);
4057 mutex_lock(&local->iflist_mtx);
4058 ieee80211_vif_release_channel(sdata);
4059 mutex_unlock(&local->iflist_mtx);
4060 - cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED,
4061 + cfg80211_cac_event(sdata->dev, &chandef,
4062 + NL80211_RADAR_CAC_ABORTED,
4066 @@ -1340,7 +1343,6 @@ static void ieee80211_setup_sdata(struct
4067 sdata->vif.bss_conf.bssid = NULL;
4069 case NL80211_IFTYPE_AP_VLAN:
4071 case NL80211_IFTYPE_P2P_DEVICE:
4072 sdata->vif.bss_conf.bssid = sdata->vif.addr;
4074 --- a/net/mac80211/mlme.c
4075 +++ b/net/mac80211/mlme.c
4076 @@ -886,8 +886,7 @@ static void ieee80211_chswitch_work(stru
4077 if (!ifmgd->associated)
4080 - ret = ieee80211_vif_change_channel(sdata, &local->csa_chandef,
4082 + ret = ieee80211_vif_change_channel(sdata, &changed);
4085 "vif channel switch failed, disconnecting\n");
4086 @@ -897,7 +896,7 @@ static void ieee80211_chswitch_work(stru
4089 if (!local->use_chanctx) {
4090 - local->_oper_chandef = local->csa_chandef;
4091 + local->_oper_chandef = sdata->csa_chandef;
4092 /* Call "hw_config" only if doing sw channel switch.
4093 * Otherwise update the channel directly
4095 @@ -908,7 +907,7 @@ static void ieee80211_chswitch_work(stru
4098 /* XXX: shouldn't really modify cfg80211-owned data! */
4099 - ifmgd->associated->channel = local->csa_chandef.chan;
4100 + ifmgd->associated->channel = sdata->csa_chandef.chan;
4102 /* XXX: wait for a beacon first? */
4103 ieee80211_wake_queues_by_reason(&local->hw,
4104 @@ -1035,7 +1034,7 @@ ieee80211_sta_process_chanswitch(struct
4106 mutex_unlock(&local->chanctx_mtx);
4108 - local->csa_chandef = csa_ie.chandef;
4109 + sdata->csa_chandef = csa_ie.chandef;
4112 ieee80211_stop_queues_by_reason(&local->hw,
4113 @@ -1398,10 +1397,12 @@ void ieee80211_dfs_cac_timer_work(struct
4114 struct ieee80211_sub_if_data *sdata =
4115 container_of(delayed_work, struct ieee80211_sub_if_data,
4116 dfs_cac_timer_work);
4117 + struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chandef;
4119 ieee80211_vif_release_channel(sdata);
4121 - cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
4122 + cfg80211_cac_event(sdata->dev, &chandef,
4123 + NL80211_RADAR_CAC_FINISHED,
4128 --- a/net/mac80211/rx.c
4129 +++ b/net/mac80211/rx.c
4130 @@ -729,9 +729,7 @@ static void ieee80211_release_reorder_fr
4131 lockdep_assert_held(&tid_agg_rx->reorder_lock);
4133 while (ieee80211_sn_less(tid_agg_rx->head_seq_num, head_seq_num)) {
4134 - index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
4135 - tid_agg_rx->ssn) %
4136 - tid_agg_rx->buf_size;
4137 + index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
4138 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
4141 @@ -757,8 +755,7 @@ static void ieee80211_sta_reorder_releas
4142 lockdep_assert_held(&tid_agg_rx->reorder_lock);
4144 /* release the buffer until next missing frame */
4145 - index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
4146 - tid_agg_rx->ssn) % tid_agg_rx->buf_size;
4147 + index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
4148 if (!tid_agg_rx->reorder_buf[index] &&
4149 tid_agg_rx->stored_mpdu_num) {
4151 @@ -793,15 +790,11 @@ static void ieee80211_sta_reorder_releas
4152 } else while (tid_agg_rx->reorder_buf[index]) {
4153 ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
4155 - index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
4156 - tid_agg_rx->ssn) %
4157 - tid_agg_rx->buf_size;
4158 + index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
4161 if (tid_agg_rx->stored_mpdu_num) {
4162 - j = index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
4163 - tid_agg_rx->ssn) %
4164 - tid_agg_rx->buf_size;
4165 + j = index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
4167 for (; j != (index - 1) % tid_agg_rx->buf_size;
4168 j = (j + 1) % tid_agg_rx->buf_size) {
4169 @@ -861,8 +854,7 @@ static bool ieee80211_sta_manage_reorder
4171 /* Now the new frame is always in the range of the reordering buffer */
4173 - index = ieee80211_sn_sub(mpdu_seq_num,
4174 - tid_agg_rx->ssn) % tid_agg_rx->buf_size;
4175 + index = mpdu_seq_num % tid_agg_rx->buf_size;
4177 /* check if we already stored this frame */
4178 if (tid_agg_rx->reorder_buf[index]) {
4179 @@ -911,7 +903,8 @@ static void ieee80211_rx_reorder_ampdu(s
4183 - if (!ieee80211_is_data_qos(hdr->frame_control))
4184 + if (!ieee80211_is_data_qos(hdr->frame_control) ||
4185 + is_multicast_ether_addr(hdr->addr1))
4189 --- a/net/mac80211/scan.c
4190 +++ b/net/mac80211/scan.c
4191 @@ -526,7 +526,7 @@ static int __ieee80211_start_scan(struct
4192 ieee80211_hw_config(local, 0);
4194 if ((req->channels[0]->flags &
4195 - IEEE80211_CHAN_PASSIVE_SCAN) ||
4196 + IEEE80211_CHAN_NO_IR) ||
4197 !local->scan_req->n_ssids) {
4198 next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
4200 @@ -572,7 +572,7 @@ ieee80211_scan_get_channel_time(struct i
4201 * TODO: channel switching also consumes quite some time,
4202 * add that delay as well to get a better estimation
4204 - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
4205 + if (chan->flags & IEEE80211_CHAN_NO_IR)
4206 return IEEE80211_PASSIVE_CHANNEL_TIME;
4207 return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME;
4209 @@ -696,7 +696,7 @@ static void ieee80211_scan_state_set_cha
4211 * In any case, it is not necessary for a passive scan.
4213 - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
4214 + if (chan->flags & IEEE80211_CHAN_NO_IR ||
4215 !local->scan_req->n_ssids) {
4216 *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
4217 local->next_scan_state = SCAN_DECISION;
4218 @@ -881,7 +881,7 @@ int ieee80211_request_ibss_scan(struct i
4219 struct ieee80211_channel *tmp_ch =
4220 &local->hw.wiphy->bands[band]->channels[i];
4222 - if (tmp_ch->flags & (IEEE80211_CHAN_NO_IBSS |
4223 + if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR |
4224 IEEE80211_CHAN_DISABLED))
4227 @@ -895,7 +895,7 @@ int ieee80211_request_ibss_scan(struct i
4229 local->int_scan_req->n_channels = n_ch;
4231 - if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IBSS |
4232 + if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IR |
4233 IEEE80211_CHAN_DISABLED)))
4236 --- a/net/mac80211/tx.c
4237 +++ b/net/mac80211/tx.c
4238 @@ -1728,8 +1728,7 @@ netdev_tx_t ieee80211_monitor_start_xmit
4239 * radar detection by itself. We can do that later by adding a
4240 * monitor flag interfaces used for AP support.
4242 - if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR |
4243 - IEEE80211_CHAN_PASSIVE_SCAN)))
4244 + if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)))
4247 ieee80211_xmit(sdata, skb, chan->band);
4248 --- a/net/mac80211/util.c
4249 +++ b/net/mac80211/util.c
4250 @@ -2259,14 +2259,17 @@ u64 ieee80211_calculate_rx_timestamp(str
4251 void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
4253 struct ieee80211_sub_if_data *sdata;
4254 + struct cfg80211_chan_def chandef;
4256 mutex_lock(&local->iflist_mtx);
4257 list_for_each_entry(sdata, &local->interfaces, list) {
4258 cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
4260 if (sdata->wdev.cac_started) {
4261 + chandef = sdata->vif.bss_conf.chandef;
4262 ieee80211_vif_release_channel(sdata);
4263 cfg80211_cac_event(sdata->dev,
4265 NL80211_RADAR_CAC_ABORTED,
4268 @@ -2459,14 +2462,9 @@ int ieee80211_send_action_csa(struct iee
4269 WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00;
4270 put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos); /* Reason Cd */
4272 - if (!ifmsh->pre_value)
4273 - ifmsh->pre_value = 1;
4275 - ifmsh->pre_value++;
4276 pre_value = cpu_to_le16(ifmsh->pre_value);
4277 memcpy(pos, &pre_value, 2); /* Precedence Value */
4279 - ifmsh->chsw_init = true;
4282 ieee80211_tx_skb(sdata, skb);
4283 --- a/net/wireless/chan.c
4284 +++ b/net/wireless/chan.c
4285 @@ -277,6 +277,32 @@ void cfg80211_set_dfs_state(struct wiphy
4289 +static u32 cfg80211_get_start_freq(u32 center_freq,
4294 + if (bandwidth <= 20)
4295 + start_freq = center_freq;
4297 + start_freq = center_freq - bandwidth/2 + 10;
4299 + return start_freq;
4302 +static u32 cfg80211_get_end_freq(u32 center_freq,
4307 + if (bandwidth <= 20)
4308 + end_freq = center_freq;
4310 + end_freq = center_freq + bandwidth/2 - 10;
4315 static int cfg80211_get_chans_dfs_required(struct wiphy *wiphy,
4318 @@ -284,13 +310,8 @@ static int cfg80211_get_chans_dfs_requir
4319 struct ieee80211_channel *c;
4320 u32 freq, start_freq, end_freq;
4322 - if (bandwidth <= 20) {
4323 - start_freq = center_freq;
4324 - end_freq = center_freq;
4326 - start_freq = center_freq - bandwidth/2 + 10;
4327 - end_freq = center_freq + bandwidth/2 - 10;
4329 + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
4330 + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
4332 for (freq = start_freq; freq <= end_freq; freq += 20) {
4333 c = ieee80211_get_channel(wiphy, freq);
4334 @@ -330,33 +351,159 @@ int cfg80211_chandef_dfs_required(struct
4336 EXPORT_SYMBOL(cfg80211_chandef_dfs_required);
4338 -static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
4339 - u32 center_freq, u32 bandwidth,
4340 - u32 prohibited_flags)
4341 +static int cfg80211_get_chans_dfs_usable(struct wiphy *wiphy,
4345 struct ieee80211_channel *c;
4346 u32 freq, start_freq, end_freq;
4349 - if (bandwidth <= 20) {
4350 - start_freq = center_freq;
4351 - end_freq = center_freq;
4353 - start_freq = center_freq - bandwidth/2 + 10;
4354 - end_freq = center_freq + bandwidth/2 - 10;
4355 + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
4356 + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
4359 + * Check entire range of channels for the bandwidth.
4360 + * Check all channels are DFS channels (DFS_USABLE or
4361 + * DFS_AVAILABLE). Return number of usable channels
4362 + * (require CAC). Allow DFS and non-DFS channel mix.
4364 + for (freq = start_freq; freq <= end_freq; freq += 20) {
4365 + c = ieee80211_get_channel(wiphy, freq);
4369 + if (c->flags & IEEE80211_CHAN_DISABLED)
4372 + if (c->flags & IEEE80211_CHAN_RADAR) {
4373 + if (c->dfs_state == NL80211_DFS_UNAVAILABLE)
4376 + if (c->dfs_state == NL80211_DFS_USABLE)
4384 +bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
4385 + const struct cfg80211_chan_def *chandef)
4390 + if (WARN_ON(!cfg80211_chandef_valid(chandef)))
4393 + width = cfg80211_chandef_get_width(chandef);
4397 + r1 = cfg80211_get_chans_dfs_usable(wiphy, chandef->center_freq1,
4403 + switch (chandef->width) {
4404 + case NL80211_CHAN_WIDTH_80P80:
4405 + WARN_ON(!chandef->center_freq2);
4406 + r2 = cfg80211_get_chans_dfs_usable(wiphy,
4407 + chandef->center_freq2,
4413 + WARN_ON(chandef->center_freq2);
4417 + return (r1 + r2 > 0);
4421 +static bool cfg80211_get_chans_dfs_available(struct wiphy *wiphy,
4425 + struct ieee80211_channel *c;
4426 + u32 freq, start_freq, end_freq;
4428 + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
4429 + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
4432 + * Check entire range of channels for the bandwidth.
4433 + * If any channel in between is disabled or has not
4434 + * had gone through CAC return false
4436 for (freq = start_freq; freq <= end_freq; freq += 20) {
4437 c = ieee80211_get_channel(wiphy, freq);
4441 - /* check for radar flags */
4442 - if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
4443 + if (c->flags & IEEE80211_CHAN_DISABLED)
4446 + if ((c->flags & IEEE80211_CHAN_RADAR) &&
4447 (c->dfs_state != NL80211_DFS_AVAILABLE))
4454 +static bool cfg80211_chandef_dfs_available(struct wiphy *wiphy,
4455 + const struct cfg80211_chan_def *chandef)
4460 + if (WARN_ON(!cfg80211_chandef_valid(chandef)))
4463 - /* check for the other flags */
4464 - if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
4465 + width = cfg80211_chandef_get_width(chandef);
4469 + r = cfg80211_get_chans_dfs_available(wiphy, chandef->center_freq1,
4472 + /* If any of channels unavailable for cf1 just return */
4476 + switch (chandef->width) {
4477 + case NL80211_CHAN_WIDTH_80P80:
4478 + WARN_ON(!chandef->center_freq2);
4479 + r = cfg80211_get_chans_dfs_available(wiphy,
4480 + chandef->center_freq2,
4483 + WARN_ON(chandef->center_freq2);
4491 +static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
4492 + u32 center_freq, u32 bandwidth,
4493 + u32 prohibited_flags)
4495 + struct ieee80211_channel *c;
4496 + u32 freq, start_freq, end_freq;
4498 + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
4499 + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
4501 + for (freq = start_freq; freq <= end_freq; freq += 20) {
4502 + c = ieee80211_get_channel(wiphy, freq);
4503 + if (!c || c->flags & prohibited_flags)
4507 @@ -462,14 +609,19 @@ bool cfg80211_reg_can_beacon(struct wiph
4508 struct cfg80211_chan_def *chandef)
4511 + u32 prohibited_flags = IEEE80211_CHAN_DISABLED |
4512 + IEEE80211_CHAN_NO_IR |
4513 + IEEE80211_CHAN_RADAR;
4515 trace_cfg80211_reg_can_beacon(wiphy, chandef);
4517 - res = cfg80211_chandef_usable(wiphy, chandef,
4518 - IEEE80211_CHAN_DISABLED |
4519 - IEEE80211_CHAN_PASSIVE_SCAN |
4520 - IEEE80211_CHAN_NO_IBSS |
4521 - IEEE80211_CHAN_RADAR);
4522 + if (cfg80211_chandef_dfs_required(wiphy, chandef) > 0 &&
4523 + cfg80211_chandef_dfs_available(wiphy, chandef)) {
4524 + /* We can skip IEEE80211_CHAN_NO_IR if chandef dfs available */
4525 + prohibited_flags = IEEE80211_CHAN_DISABLED;
4528 + res = cfg80211_chandef_usable(wiphy, chandef, prohibited_flags);
4530 trace_cfg80211_return_bool(res);
4532 --- a/net/wireless/core.h
4533 +++ b/net/wireless/core.h
4534 @@ -382,6 +382,19 @@ int cfg80211_can_use_iftype_chan(struct
4535 enum cfg80211_chan_mode chanmode,
4539 + * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
4540 + * @wiphy: the wiphy to validate against
4541 + * @chandef: the channel definition to check
4543 + * Checks if chandef is usable and we can/need start CAC on such channel.
4545 + * Return: Return true if all channels available and at least
4546 + * one channel require CAC (NL80211_DFS_USABLE)
4548 +bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
4549 + const struct cfg80211_chan_def *chandef);
4551 void cfg80211_set_dfs_state(struct wiphy *wiphy,
4552 const struct cfg80211_chan_def *chandef,
4553 enum nl80211_dfs_state dfs_state);
4554 --- a/net/wireless/genregdb.awk
4555 +++ b/net/wireless/genregdb.awk
4556 @@ -107,10 +107,13 @@ active && /^[ \t]*\(/ {
4557 } else if (flagarray[arg] == "PTMP-ONLY") {
4558 flags = flags "\n\t\t\tNL80211_RRF_PTMP_ONLY | "
4559 } else if (flagarray[arg] == "PASSIVE-SCAN") {
4560 - flags = flags "\n\t\t\tNL80211_RRF_PASSIVE_SCAN | "
4561 + flags = flags "\n\t\t\tNL80211_RRF_NO_IR | "
4562 } else if (flagarray[arg] == "NO-IBSS") {
4563 - flags = flags "\n\t\t\tNL80211_RRF_NO_IBSS | "
4564 + flags = flags "\n\t\t\tNL80211_RRF_NO_IR | "
4565 + } else if (flagarray[arg] == "NO-IR") {
4566 + flags = flags "\n\t\t\tNL80211_RRF_NO_IR | "
4571 printf "\t\tREG_RULE(%d, %d, %d, %d, %d, %s),\n", start, end, bw, gain, power, flags
4572 --- a/net/wireless/ibss.c
4573 +++ b/net/wireless/ibss.c
4574 @@ -274,7 +274,7 @@ int cfg80211_ibss_wext_join(struct cfg80
4576 for (i = 0; i < sband->n_channels; i++) {
4577 chan = &sband->channels[i];
4578 - if (chan->flags & IEEE80211_CHAN_NO_IBSS)
4579 + if (chan->flags & IEEE80211_CHAN_NO_IR)
4581 if (chan->flags & IEEE80211_CHAN_DISABLED)
4583 @@ -345,7 +345,7 @@ int cfg80211_ibss_wext_siwfreq(struct ne
4584 chan = ieee80211_get_channel(wdev->wiphy, freq);
4587 - if (chan->flags & IEEE80211_CHAN_NO_IBSS ||
4588 + if (chan->flags & IEEE80211_CHAN_NO_IR ||
4589 chan->flags & IEEE80211_CHAN_DISABLED)
4592 --- a/net/wireless/mesh.c
4593 +++ b/net/wireless/mesh.c
4594 @@ -141,8 +141,7 @@ int __cfg80211_join_mesh(struct cfg80211
4596 for (i = 0; i < sband->n_channels; i++) {
4597 chan = &sband->channels[i];
4598 - if (chan->flags & (IEEE80211_CHAN_NO_IBSS |
4599 - IEEE80211_CHAN_PASSIVE_SCAN |
4600 + if (chan->flags & (IEEE80211_CHAN_NO_IR |
4601 IEEE80211_CHAN_DISABLED |
4602 IEEE80211_CHAN_RADAR))
4604 --- a/net/wireless/mlme.c
4605 +++ b/net/wireless/mlme.c
4606 @@ -763,12 +763,12 @@ void cfg80211_radar_event(struct wiphy *
4607 EXPORT_SYMBOL(cfg80211_radar_event);
4609 void cfg80211_cac_event(struct net_device *netdev,
4610 + const struct cfg80211_chan_def *chandef,
4611 enum nl80211_radar_event event, gfp_t gfp)
4613 struct wireless_dev *wdev = netdev->ieee80211_ptr;
4614 struct wiphy *wiphy = wdev->wiphy;
4615 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
4616 - struct cfg80211_chan_def chandef;
4617 unsigned long timeout;
4619 trace_cfg80211_cac_event(netdev, event);
4620 @@ -779,14 +779,12 @@ void cfg80211_cac_event(struct net_devic
4621 if (WARN_ON(!wdev->channel))
4624 - cfg80211_chandef_create(&chandef, wdev->channel, NL80211_CHAN_NO_HT);
4627 case NL80211_RADAR_CAC_FINISHED:
4628 timeout = wdev->cac_start_time +
4629 msecs_to_jiffies(IEEE80211_DFS_MIN_CAC_TIME_MS);
4630 WARN_ON(!time_after_eq(jiffies, timeout));
4631 - cfg80211_set_dfs_state(wiphy, &chandef, NL80211_DFS_AVAILABLE);
4632 + cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE);
4634 case NL80211_RADAR_CAC_ABORTED:
4636 @@ -796,6 +794,6 @@ void cfg80211_cac_event(struct net_devic
4638 wdev->cac_started = false;
4640 - nl80211_radar_notify(rdev, &chandef, event, netdev, gfp);
4641 + nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
4643 EXPORT_SYMBOL(cfg80211_cac_event);
4644 --- a/net/wireless/nl80211.c
4645 +++ b/net/wireless/nl80211.c
4646 @@ -545,12 +545,12 @@ static int nl80211_msg_put_channel(struc
4647 if ((chan->flags & IEEE80211_CHAN_DISABLED) &&
4648 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_DISABLED))
4649 goto nla_put_failure;
4650 - if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
4651 - nla_put_flag(msg, NL80211_FREQUENCY_ATTR_PASSIVE_SCAN))
4652 - goto nla_put_failure;
4653 - if ((chan->flags & IEEE80211_CHAN_NO_IBSS) &&
4654 - nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IBSS))
4655 - goto nla_put_failure;
4656 + if (chan->flags & IEEE80211_CHAN_NO_IR) {
4657 + if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IR))
4658 + goto nla_put_failure;
4659 + if (nla_put_flag(msg, __NL80211_FREQUENCY_ATTR_NO_IBSS))
4660 + goto nla_put_failure;
4662 if (chan->flags & IEEE80211_CHAN_RADAR) {
4663 if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR))
4664 goto nla_put_failure;
4665 @@ -1229,7 +1229,8 @@ static int nl80211_send_wiphy(struct cfg
4666 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
4667 goto nla_put_failure;
4668 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
4669 - nla_put_flag(msg, WIPHY_FLAG_SUPPORTS_5_10_MHZ))
4670 + (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) ||
4671 + nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ)))
4672 goto nla_put_failure;
4674 state->split_start++;
4675 @@ -2170,7 +2171,7 @@ static inline u64 wdev_id(struct wireles
4678 static int nl80211_send_chandef(struct sk_buff *msg,
4679 - struct cfg80211_chan_def *chandef)
4680 + const struct cfg80211_chan_def *chandef)
4682 WARN_ON(!cfg80211_chandef_valid(chandef));
4684 @@ -3219,6 +3220,7 @@ static int nl80211_start_ap(struct sk_bu
4685 return PTR_ERR(params.acl);
4689 err = rdev_start_ap(rdev, dev, ¶ms);
4691 wdev->preset_chandef = params.chandef;
4692 @@ -3227,6 +3229,7 @@ static int nl80211_start_ap(struct sk_bu
4693 wdev->ssid_len = params.ssid_len;
4694 memcpy(wdev->ssid, params.ssid, wdev->ssid_len);
4696 + wdev_unlock(wdev);
4700 @@ -3255,7 +3258,11 @@ static int nl80211_set_beacon(struct sk_
4704 - return rdev_change_beacon(rdev, dev, ¶ms);
4706 + err = rdev_change_beacon(rdev, dev, ¶ms);
4707 + wdev_unlock(wdev);
4712 static int nl80211_stop_ap(struct sk_buff *skb, struct genl_info *info)
4713 @@ -4461,7 +4468,9 @@ static int nl80211_set_bss(struct sk_buf
4715 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4716 struct net_device *dev = info->user_ptr[1];
4717 + struct wireless_dev *wdev = dev->ieee80211_ptr;
4718 struct bss_parameters params;
4721 memset(¶ms, 0, sizeof(params));
4722 /* default to not changing parameters */
4723 @@ -4527,7 +4536,11 @@ static int nl80211_set_bss(struct sk_buf
4724 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO)
4727 - return rdev_change_bss(rdev, dev, ¶ms);
4729 + err = rdev_change_bss(rdev, dev, ¶ms);
4730 + wdev_unlock(wdev);
4735 static const struct nla_policy reg_rule_policy[NL80211_REG_RULE_ATTR_MAX + 1] = {
4736 @@ -5653,7 +5666,7 @@ static int nl80211_start_radar_detection
4740 - if (chandef.chan->dfs_state != NL80211_DFS_USABLE)
4741 + if (!cfg80211_chandef_dfs_usable(wdev->wiphy, &chandef))
4744 if (!rdev->ops->start_radar_detection)
4745 @@ -5793,7 +5806,11 @@ skip_beacons:
4746 if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
4747 params.block_tx = true;
4749 - return rdev_channel_switch(rdev, dev, ¶ms);
4751 + err = rdev_channel_switch(rdev, dev, ¶ms);
4752 + wdev_unlock(wdev);
4757 static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
4758 @@ -10809,21 +10826,18 @@ void cfg80211_ch_switch_notify(struct ne
4759 struct wiphy *wiphy = wdev->wiphy;
4760 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
4762 - trace_cfg80211_ch_switch_notify(dev, chandef);
4763 + ASSERT_WDEV_LOCK(wdev);
4766 + trace_cfg80211_ch_switch_notify(dev, chandef);
4768 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
4769 wdev->iftype != NL80211_IFTYPE_P2P_GO &&
4770 wdev->iftype != NL80211_IFTYPE_ADHOC &&
4771 wdev->iftype != NL80211_IFTYPE_MESH_POINT))
4775 wdev->channel = chandef->chan;
4776 nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL);
4778 - wdev_unlock(wdev);
4781 EXPORT_SYMBOL(cfg80211_ch_switch_notify);
4783 @@ -10882,7 +10896,7 @@ EXPORT_SYMBOL(cfg80211_cqm_txe_notify);
4786 nl80211_radar_notify(struct cfg80211_registered_device *rdev,
4787 - struct cfg80211_chan_def *chandef,
4788 + const struct cfg80211_chan_def *chandef,
4789 enum nl80211_radar_event event,
4790 struct net_device *netdev, gfp_t gfp)
4792 --- a/net/wireless/nl80211.h
4793 +++ b/net/wireless/nl80211.h
4794 @@ -70,7 +70,7 @@ int nl80211_send_mgmt(struct cfg80211_re
4797 nl80211_radar_notify(struct cfg80211_registered_device *rdev,
4798 - struct cfg80211_chan_def *chandef,
4799 + const struct cfg80211_chan_def *chandef,
4800 enum nl80211_radar_event event,
4801 struct net_device *netdev, gfp_t gfp);
4803 --- a/net/wireless/reg.c
4804 +++ b/net/wireless/reg.c
4805 @@ -163,35 +163,29 @@ static const struct ieee80211_regdomain
4806 REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
4807 /* IEEE 802.11b/g, channels 12..13. */
4808 REG_RULE(2467-10, 2472+10, 40, 6, 20,
4809 - NL80211_RRF_PASSIVE_SCAN |
4810 - NL80211_RRF_NO_IBSS),
4811 + NL80211_RRF_NO_IR),
4812 /* IEEE 802.11 channel 14 - Only JP enables
4813 * this and for 802.11b only */
4814 REG_RULE(2484-10, 2484+10, 20, 6, 20,
4815 - NL80211_RRF_PASSIVE_SCAN |
4816 - NL80211_RRF_NO_IBSS |
4817 + NL80211_RRF_NO_IR |
4818 NL80211_RRF_NO_OFDM),
4819 /* IEEE 802.11a, channel 36..48 */
4820 REG_RULE(5180-10, 5240+10, 160, 6, 20,
4821 - NL80211_RRF_PASSIVE_SCAN |
4822 - NL80211_RRF_NO_IBSS),
4823 + NL80211_RRF_NO_IR),
4825 /* IEEE 802.11a, channel 52..64 - DFS required */
4826 REG_RULE(5260-10, 5320+10, 160, 6, 20,
4827 - NL80211_RRF_PASSIVE_SCAN |
4828 - NL80211_RRF_NO_IBSS |
4829 + NL80211_RRF_NO_IR |
4832 /* IEEE 802.11a, channel 100..144 - DFS required */
4833 REG_RULE(5500-10, 5720+10, 160, 6, 20,
4834 - NL80211_RRF_PASSIVE_SCAN |
4835 - NL80211_RRF_NO_IBSS |
4836 + NL80211_RRF_NO_IR |
4839 /* IEEE 802.11a, channel 149..165 */
4840 REG_RULE(5745-10, 5825+10, 80, 6, 20,
4841 - NL80211_RRF_PASSIVE_SCAN |
4842 - NL80211_RRF_NO_IBSS),
4843 + NL80211_RRF_NO_IR),
4845 /* IEEE 802.11ad (60gHz), channels 1..3 */
4846 REG_RULE(56160+2160*1-1080, 56160+2160*3+1080, 2160, 0, 0, 0),
4847 @@ -698,10 +692,8 @@ regdom_intersect(const struct ieee80211_
4848 static u32 map_regdom_flags(u32 rd_flags)
4850 u32 channel_flags = 0;
4851 - if (rd_flags & NL80211_RRF_PASSIVE_SCAN)
4852 - channel_flags |= IEEE80211_CHAN_PASSIVE_SCAN;
4853 - if (rd_flags & NL80211_RRF_NO_IBSS)
4854 - channel_flags |= IEEE80211_CHAN_NO_IBSS;
4855 + if (rd_flags & NL80211_RRF_NO_IR_ALL)
4856 + channel_flags |= IEEE80211_CHAN_NO_IR;
4857 if (rd_flags & NL80211_RRF_DFS)
4858 channel_flags |= IEEE80211_CHAN_RADAR;
4859 if (rd_flags & NL80211_RRF_NO_OFDM)
4860 @@ -1066,13 +1058,8 @@ static void handle_reg_beacon(struct wip
4861 chan_before.center_freq = chan->center_freq;
4862 chan_before.flags = chan->flags;
4864 - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) {
4865 - chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
4866 - channel_changed = true;
4869 - if (chan->flags & IEEE80211_CHAN_NO_IBSS) {
4870 - chan->flags &= ~IEEE80211_CHAN_NO_IBSS;
4871 + if (chan->flags & IEEE80211_CHAN_NO_IR) {
4872 + chan->flags &= ~IEEE80211_CHAN_NO_IR;
4873 channel_changed = true;
4877 +++ b/drivers/net/wireless/ath/ath9k/ar9003_wow.c
4880 + * Copyright (c) 2012 Qualcomm Atheros, Inc.
4882 + * Permission to use, copy, modify, and/or distribute this software for any
4883 + * purpose with or without fee is hereby granted, provided that the above
4884 + * copyright notice and this permission notice appear in all copies.
4886 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
4887 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
4888 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
4889 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
4890 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
4891 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
4892 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4895 +#include <linux/export.h>
4898 +#include "hw-ops.h"
4900 +const char *ath9k_hw_wow_event_to_string(u32 wow_event)
4902 + if (wow_event & AH_WOW_MAGIC_PATTERN_EN)
4903 + return "Magic pattern";
4904 + if (wow_event & AH_WOW_USER_PATTERN_EN)
4905 + return "User pattern";
4906 + if (wow_event & AH_WOW_LINK_CHANGE)
4907 + return "Link change";
4908 + if (wow_event & AH_WOW_BEACON_MISS)
4909 + return "Beacon miss";
4911 + return "unknown reason";
4913 +EXPORT_SYMBOL(ath9k_hw_wow_event_to_string);
4915 +static void ath9k_hw_set_powermode_wow_sleep(struct ath_hw *ah)
4917 + struct ath_common *common = ath9k_hw_common(ah);
4919 + REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
4921 + /* set rx disable bit */
4922 + REG_WRITE(ah, AR_CR, AR_CR_RXD);
4924 + if (!ath9k_hw_wait(ah, AR_CR, AR_CR_RXE, 0, AH_WAIT_TIMEOUT)) {
4925 + ath_err(common, "Failed to stop Rx DMA in 10ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
4926 + REG_READ(ah, AR_CR), REG_READ(ah, AR_DIAG_SW));
4930 + REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_ON_INT);
4933 +static void ath9k_wow_create_keep_alive_pattern(struct ath_hw *ah)
4935 + struct ath_common *common = ath9k_hw_common(ah);
4936 + u8 sta_mac_addr[ETH_ALEN], ap_mac_addr[ETH_ALEN];
4937 + u32 ctl[13] = {0};
4938 + u32 data_word[KAL_NUM_DATA_WORDS];
4940 + u32 wow_ka_data_word0;
4942 + memcpy(sta_mac_addr, common->macaddr, ETH_ALEN);
4943 + memcpy(ap_mac_addr, common->curbssid, ETH_ALEN);
4945 + /* set the transmit buffer */
4946 + ctl[0] = (KAL_FRAME_LEN | (MAX_RATE_POWER << 16));
4948 + ctl[3] = 0xb; /* OFDM_6M hardware value for this rate */
4950 + ctl[7] = (ah->txchainmask) << 2;
4951 + ctl[2] = 0xf << 16; /* tx_tries 0 */
4953 + for (i = 0; i < KAL_NUM_DESC_WORDS; i++)
4954 + REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
4956 + REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
4958 + data_word[0] = (KAL_FRAME_TYPE << 2) | (KAL_FRAME_SUB_TYPE << 4) |
4959 + (KAL_TO_DS << 8) | (KAL_DURATION_ID << 16);
4960 + data_word[1] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
4961 + (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
4962 + data_word[2] = (sta_mac_addr[1] << 24) | (sta_mac_addr[0] << 16) |
4963 + (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
4964 + data_word[3] = (sta_mac_addr[5] << 24) | (sta_mac_addr[4] << 16) |
4965 + (sta_mac_addr[3] << 8) | (sta_mac_addr[2]);
4966 + data_word[4] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
4967 + (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
4968 + data_word[5] = (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
4970 + if (AR_SREV_9462_20(ah)) {
4971 + /* AR9462 2.0 has an extra descriptor word (time based
4972 + * discard) compared to other chips */
4973 + REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + (12 * 4)), 0);
4974 + wow_ka_data_word0 = AR_WOW_TXBUF(13);
4976 + wow_ka_data_word0 = AR_WOW_TXBUF(12);
4979 + for (i = 0; i < KAL_NUM_DATA_WORDS; i++)
4980 + REG_WRITE(ah, (wow_ka_data_word0 + i*4), data_word[i]);
4984 +void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
4985 + u8 *user_mask, int pattern_count,
4989 + u32 pattern_val, mask_val;
4992 + /* FIXME: should check count by querying the hardware capability */
4993 + if (pattern_count >= MAX_NUM_PATTERN)
4996 + REG_SET_BIT(ah, AR_WOW_PATTERN, BIT(pattern_count));
4998 + /* set the registers for pattern */
4999 + for (i = 0; i < MAX_PATTERN_SIZE; i += 4) {
5000 + memcpy(&pattern_val, user_pattern, 4);
5001 + REG_WRITE(ah, (AR_WOW_TB_PATTERN(pattern_count) + i),
5003 + user_pattern += 4;
5006 + /* set the registers for mask */
5007 + for (i = 0; i < MAX_PATTERN_MASK_SIZE; i += 4) {
5008 + memcpy(&mask_val, user_mask, 4);
5009 + REG_WRITE(ah, (AR_WOW_TB_MASK(pattern_count) + i), mask_val);
5013 + /* set the pattern length to be matched
5015 + * AR_WOW_LENGTH1_REG1
5016 + * bit 31:24 pattern 0 length
5017 + * bit 23:16 pattern 1 length
5018 + * bit 15:8 pattern 2 length
5019 + * bit 7:0 pattern 3 length
5021 + * AR_WOW_LENGTH1_REG2
5022 + * bit 31:24 pattern 4 length
5023 + * bit 23:16 pattern 5 length
5024 + * bit 15:8 pattern 6 length
5025 + * bit 7:0 pattern 7 length
5027 + * the below logic writes out the new
5028 + * pattern length for the corresponding
5029 + * pattern_count, while masking out the
5033 + ah->wow_event_mask |= BIT(pattern_count + AR_WOW_PAT_FOUND_SHIFT);
5035 + if (pattern_count < 4) {
5036 + /* Pattern 0-3 uses AR_WOW_LENGTH1 register */
5037 + set = (pattern_len & AR_WOW_LENGTH_MAX) <<
5038 + AR_WOW_LEN1_SHIFT(pattern_count);
5039 + clr = AR_WOW_LENGTH1_MASK(pattern_count);
5040 + REG_RMW(ah, AR_WOW_LENGTH1, set, clr);
5042 + /* Pattern 4-7 uses AR_WOW_LENGTH2 register */
5043 + set = (pattern_len & AR_WOW_LENGTH_MAX) <<
5044 + AR_WOW_LEN2_SHIFT(pattern_count);
5045 + clr = AR_WOW_LENGTH2_MASK(pattern_count);
5046 + REG_RMW(ah, AR_WOW_LENGTH2, set, clr);
5050 +EXPORT_SYMBOL(ath9k_hw_wow_apply_pattern);
5052 +u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
5054 + u32 wow_status = 0;
5055 + u32 val = 0, rval;
5058 + * read the WoW status register to know
5059 + * the wakeup reason
5061 + rval = REG_READ(ah, AR_WOW_PATTERN);
5062 + val = AR_WOW_STATUS(rval);
5065 + * mask only the WoW events that we have enabled. Sometimes
5066 + * we have spurious WoW events from the AR_WOW_PATTERN
5067 + * register. This mask will clean it up.
5070 + val &= ah->wow_event_mask;
5073 + if (val & AR_WOW_MAGIC_PAT_FOUND)
5074 + wow_status |= AH_WOW_MAGIC_PATTERN_EN;
5075 + if (AR_WOW_PATTERN_FOUND(val))
5076 + wow_status |= AH_WOW_USER_PATTERN_EN;
5077 + if (val & AR_WOW_KEEP_ALIVE_FAIL)
5078 + wow_status |= AH_WOW_LINK_CHANGE;
5079 + if (val & AR_WOW_BEACON_FAIL)
5080 + wow_status |= AH_WOW_BEACON_MISS;
5084 + * set and clear WOW_PME_CLEAR registers for the chip to
5085 + * generate next wow signal.
5086 + * disable D3 before accessing other registers ?
5089 + /* do we need to check the bit value 0x01000000 (7-10) ?? */
5090 + REG_RMW(ah, AR_PCIE_PM_CTRL, AR_PMCTRL_WOW_PME_CLR,
5091 + AR_PMCTRL_PWR_STATE_D1D3);
5094 + * clear all events
5096 + REG_WRITE(ah, AR_WOW_PATTERN,
5097 + AR_WOW_CLEAR_EVENTS(REG_READ(ah, AR_WOW_PATTERN)));
5100 + * restore the beacon threshold to init value
5102 + REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR);
5105 + * Restore the way the PCI-E reset, Power-On-Reset, external
5106 + * PCIE_POR_SHORT pins are tied to its original value.
5107 + * Previously just before WoW sleep, we untie the PCI-E
5108 + * reset to our Chip's Power On Reset so that any PCI-E
5109 + * reset from the bus will not reset our chip
5111 + if (ah->is_pciexpress)
5112 + ath9k_hw_configpcipowersave(ah, false);
5114 + ah->wow_event_mask = 0;
5116 + return wow_status;
5118 +EXPORT_SYMBOL(ath9k_hw_wow_wakeup);
5120 +void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable)
5122 + u32 wow_event_mask;
5126 + * wow_event_mask is a mask to the AR_WOW_PATTERN register to
5127 + * indicate which WoW events we have enabled. The WoW events
5128 + * are from the 'pattern_enable' in this function and
5129 + * 'pattern_count' of ath9k_hw_wow_apply_pattern()
5131 + wow_event_mask = ah->wow_event_mask;
5134 + * Untie Power-on-Reset from the PCI-E-Reset. When we are in
5135 + * WOW sleep, we do want the Reset from the PCI-E to disturb
5138 + if (ah->is_pciexpress) {
5140 + * we need to untie the internal POR (power-on-reset)
5141 + * to the external PCI-E reset. We also need to tie
5142 + * the PCI-E Phy reset to the PCI-E reset.
5144 + set = AR_WA_RESET_EN | AR_WA_POR_SHORT;
5145 + clr = AR_WA_UNTIE_RESET_EN | AR_WA_D3_L1_DISABLE;
5146 + REG_RMW(ah, AR_WA, set, clr);
5150 + * set the power states appropriately and enable PME
5152 + set = AR_PMCTRL_HOST_PME_EN | AR_PMCTRL_PWR_PM_CTRL_ENA |
5153 + AR_PMCTRL_AUX_PWR_DET | AR_PMCTRL_WOW_PME_CLR;
5156 + * set and clear WOW_PME_CLEAR registers for the chip
5157 + * to generate next wow signal.
5159 + REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
5160 + clr = AR_PMCTRL_WOW_PME_CLR;
5161 + REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
5167 + * - keep alive timeout
5168 + * - pattern matching
5172 + * Program default values for pattern backoff, aifs/slot/KAL count,
5173 + * beacon miss timeout, KAL timeout, etc.
5175 + set = AR_WOW_BACK_OFF_SHIFT(AR_WOW_PAT_BACKOFF);
5176 + REG_SET_BIT(ah, AR_WOW_PATTERN, set);
5178 + set = AR_WOW_AIFS_CNT(AR_WOW_CNT_AIFS_CNT) |
5179 + AR_WOW_SLOT_CNT(AR_WOW_CNT_SLOT_CNT) |
5180 + AR_WOW_KEEP_ALIVE_CNT(AR_WOW_CNT_KA_CNT);
5181 + REG_SET_BIT(ah, AR_WOW_COUNT, set);
5183 + if (pattern_enable & AH_WOW_BEACON_MISS)
5184 + set = AR_WOW_BEACON_TIMO;
5185 + /* We are not using beacon miss, program a large value */
5187 + set = AR_WOW_BEACON_TIMO_MAX;
5189 + REG_WRITE(ah, AR_WOW_BCN_TIMO, set);
5192 + * Keep alive timo in ms except AR9280
5194 + if (!pattern_enable)
5195 + set = AR_WOW_KEEP_ALIVE_NEVER;
5197 + set = KAL_TIMEOUT * 32;
5199 + REG_WRITE(ah, AR_WOW_KEEP_ALIVE_TIMO, set);
5202 + * Keep alive delay in us. based on 'power on clock',
5203 + * therefore in usec
5205 + set = KAL_DELAY * 1000;
5206 + REG_WRITE(ah, AR_WOW_KEEP_ALIVE_DELAY, set);
5209 + * Create keep alive pattern to respond to beacons
5211 + ath9k_wow_create_keep_alive_pattern(ah);
5214 + * Configure MAC WoW Registers
5217 + /* Send keep alive timeouts anyway */
5218 + clr = AR_WOW_KEEP_ALIVE_AUTO_DIS;
5220 + if (pattern_enable & AH_WOW_LINK_CHANGE)
5221 + wow_event_mask |= AR_WOW_KEEP_ALIVE_FAIL;
5223 + set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
5225 + set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
5226 + REG_RMW(ah, AR_WOW_KEEP_ALIVE, set, clr);
5229 + * we are relying on a bmiss failure. ensure we have
5230 + * enough threshold to prevent false positives
5232 + REG_RMW_FIELD(ah, AR_RSSI_THR, AR_RSSI_THR_BM_THR,
5233 + AR_WOW_BMISSTHRESHOLD);
5238 + if (pattern_enable & AH_WOW_BEACON_MISS) {
5239 + set = AR_WOW_BEACON_FAIL_EN;
5240 + wow_event_mask |= AR_WOW_BEACON_FAIL;
5242 + clr = AR_WOW_BEACON_FAIL_EN;
5245 + REG_RMW(ah, AR_WOW_BCN_EN, set, clr);
5250 + * Enable the magic packet registers
5252 + if (pattern_enable & AH_WOW_MAGIC_PATTERN_EN) {
5253 + set = AR_WOW_MAGIC_EN;
5254 + wow_event_mask |= AR_WOW_MAGIC_PAT_FOUND;
5256 + clr = AR_WOW_MAGIC_EN;
5258 + set |= AR_WOW_MAC_INTR_EN;
5259 + REG_RMW(ah, AR_WOW_PATTERN, set, clr);
5261 + REG_WRITE(ah, AR_WOW_PATTERN_MATCH_LT_256B,
5262 + AR_WOW_PATTERN_SUPPORTED);
5265 + * Set the power states appropriately and enable PME
5268 + set = AR_PMCTRL_PWR_STATE_D1D3 | AR_PMCTRL_HOST_PME_EN |
5269 + AR_PMCTRL_PWR_PM_CTRL_ENA;
5271 + clr = AR_PCIE_PM_CTRL_ENA;
5272 + REG_RMW(ah, AR_PCIE_PM_CTRL, set, clr);
5275 + * this is needed to prevent the chip waking up
5276 + * the host within 3-4 seconds with certain
5277 + * platform/BIOS. The fix is to enable
5278 + * D1 & D3 to match original definition and
5279 + * also match the OTP value. Anyway this
5280 + * is more related to SW WOW.
5282 + clr = AR_PMCTRL_PWR_STATE_D1D3;
5283 + REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
5285 + set = AR_PMCTRL_PWR_STATE_D1D3_REAL;
5286 + REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
5288 + REG_CLR_BIT(ah, AR_STA_ID1, AR_STA_ID1_PRESERVE_SEQNUM);
5290 + /* to bring down WOW power low margin */
5292 + REG_SET_BIT(ah, AR_PCIE_PHY_REG3, set);
5295 + REG_CLR_BIT(ah, AR_PCU_MISC_MODE3, clr);
5297 + ath9k_hw_set_powermode_wow_sleep(ah);
5298 + ah->wow_event_mask = wow_event_mask;
5300 +EXPORT_SYMBOL(ath9k_hw_wow_enable);
5302 +++ b/drivers/net/wireless/ath/ath9k/tx99.c
5305 + * Copyright (c) 2013 Qualcomm Atheros, Inc.
5307 + * Permission to use, copy, modify, and/or distribute this software for any
5308 + * purpose with or without fee is hereby granted, provided that the above
5309 + * copyright notice and this permission notice appear in all copies.
5311 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
5312 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
5313 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
5314 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
5315 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
5316 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
5317 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5322 +static void ath9k_tx99_stop(struct ath_softc *sc)
5324 + struct ath_hw *ah = sc->sc_ah;
5325 + struct ath_common *common = ath9k_hw_common(ah);
5327 + ath_drain_all_txq(sc);
5328 + ath_startrecv(sc);
5330 + ath9k_hw_set_interrupts(ah);
5331 + ath9k_hw_enable_interrupts(ah);
5333 + ieee80211_wake_queues(sc->hw);
5335 + kfree_skb(sc->tx99_skb);
5336 + sc->tx99_skb = NULL;
5337 + sc->tx99_state = false;
5339 + ath9k_hw_tx99_stop(sc->sc_ah);
5340 + ath_dbg(common, XMIT, "TX99 stopped\n");
5343 +static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
5345 + static u8 PN9Data[] = {0xff, 0x87, 0xb8, 0x59, 0xb7, 0xa1, 0xcc, 0x24,
5346 + 0x57, 0x5e, 0x4b, 0x9c, 0x0e, 0xe9, 0xea, 0x50,
5347 + 0x2a, 0xbe, 0xb4, 0x1b, 0xb6, 0xb0, 0x5d, 0xf1,
5348 + 0xe6, 0x9a, 0xe3, 0x45, 0xfd, 0x2c, 0x53, 0x18,
5349 + 0x0c, 0xca, 0xc9, 0xfb, 0x49, 0x37, 0xe5, 0xa8,
5350 + 0x51, 0x3b, 0x2f, 0x61, 0xaa, 0x72, 0x18, 0x84,
5351 + 0x02, 0x23, 0x23, 0xab, 0x63, 0x89, 0x51, 0xb3,
5352 + 0xe7, 0x8b, 0x72, 0x90, 0x4c, 0xe8, 0xfb, 0xc0};
5354 + struct ieee80211_hw *hw = sc->hw;
5355 + struct ieee80211_hdr *hdr;
5356 + struct ieee80211_tx_info *tx_info;
5357 + struct sk_buff *skb;
5359 + skb = alloc_skb(len, GFP_KERNEL);
5363 + skb_put(skb, len);
5365 + memset(skb->data, 0, len);
5367 + hdr = (struct ieee80211_hdr *)skb->data;
5368 + hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA);
5369 + hdr->duration_id = 0;
5371 + memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN);
5372 + memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
5373 + memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
5375 + hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
5377 + tx_info = IEEE80211_SKB_CB(skb);
5378 + memset(tx_info, 0, sizeof(*tx_info));
5379 + tx_info->band = hw->conf.chandef.chan->band;
5380 + tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
5381 + tx_info->control.vif = sc->tx99_vif;
5383 + memcpy(skb->data + sizeof(*hdr), PN9Data, sizeof(PN9Data));
5388 +static void ath9k_tx99_deinit(struct ath_softc *sc)
5392 + ath9k_ps_wakeup(sc);
5393 + ath9k_tx99_stop(sc);
5394 + ath9k_ps_restore(sc);
5397 +static int ath9k_tx99_init(struct ath_softc *sc)
5399 + struct ieee80211_hw *hw = sc->hw;
5400 + struct ath_hw *ah = sc->sc_ah;
5401 + struct ath_common *common = ath9k_hw_common(ah);
5402 + struct ath_tx_control txctl;
5405 + if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
5407 + "driver is in invalid state unable to use TX99");
5411 + sc->tx99_skb = ath9k_build_tx99_skb(sc);
5412 + if (!sc->tx99_skb)
5415 + memset(&txctl, 0, sizeof(txctl));
5416 + txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
5420 + ath9k_ps_wakeup(sc);
5422 + ath9k_hw_disable_interrupts(ah);
5423 + atomic_set(&ah->intr_ref_cnt, -1);
5424 + ath_drain_all_txq(sc);
5427 + sc->tx99_state = true;
5429 + ieee80211_stop_queues(hw);
5431 + if (sc->tx99_power == MAX_RATE_POWER + 1)
5432 + sc->tx99_power = MAX_RATE_POWER;
5434 + ath9k_hw_tx99_set_txpower(ah, sc->tx99_power);
5435 + r = ath9k_tx99_send(sc, sc->tx99_skb, &txctl);
5437 + ath_dbg(common, XMIT, "Failed to xmit TX99 skb\n");
5441 + ath_dbg(common, XMIT, "TX99 xmit started using %d ( %ddBm)\n",
5443 + sc->tx99_power / 2);
5445 + /* We leave the harware awake as it will be chugging on */
5450 +static ssize_t read_file_tx99(struct file *file, char __user *user_buf,
5451 + size_t count, loff_t *ppos)
5453 + struct ath_softc *sc = file->private_data;
5457 + len = sprintf(buf, "%d\n", sc->tx99_state);
5458 + return simple_read_from_buffer(user_buf, count, ppos, buf, len);
5461 +static ssize_t write_file_tx99(struct file *file, const char __user *user_buf,
5462 + size_t count, loff_t *ppos)
5464 + struct ath_softc *sc = file->private_data;
5465 + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
5471 + if (sc->nvifs > 1)
5472 + return -EOPNOTSUPP;
5474 + len = min(count, sizeof(buf) - 1);
5475 + if (copy_from_user(buf, user_buf, len))
5478 + if (strtobool(buf, &start))
5481 + if (start == sc->tx99_state) {
5484 + ath_dbg(common, XMIT, "Resetting TX99\n");
5485 + ath9k_tx99_deinit(sc);
5489 + ath9k_tx99_deinit(sc);
5493 + r = ath9k_tx99_init(sc);
5500 +static const struct file_operations fops_tx99 = {
5501 + .read = read_file_tx99,
5502 + .write = write_file_tx99,
5503 + .open = simple_open,
5504 + .owner = THIS_MODULE,
5505 + .llseek = default_llseek,
5508 +static ssize_t read_file_tx99_power(struct file *file,
5509 + char __user *user_buf,
5510 + size_t count, loff_t *ppos)
5512 + struct ath_softc *sc = file->private_data;
5516 + len = sprintf(buf, "%d (%d dBm)\n",
5518 + sc->tx99_power / 2);
5520 + return simple_read_from_buffer(user_buf, count, ppos, buf, len);
5523 +static ssize_t write_file_tx99_power(struct file *file,
5524 + const char __user *user_buf,
5525 + size_t count, loff_t *ppos)
5527 + struct ath_softc *sc = file->private_data;
5531 + r = kstrtou8_from_user(user_buf, count, 0, &tx_power);
5535 + if (tx_power > MAX_RATE_POWER)
5538 + sc->tx99_power = tx_power;
5540 + ath9k_ps_wakeup(sc);
5541 + ath9k_hw_tx99_set_txpower(sc->sc_ah, sc->tx99_power);
5542 + ath9k_ps_restore(sc);
5547 +static const struct file_operations fops_tx99_power = {
5548 + .read = read_file_tx99_power,
5549 + .write = write_file_tx99_power,
5550 + .open = simple_open,
5551 + .owner = THIS_MODULE,
5552 + .llseek = default_llseek,
5555 +void ath9k_tx99_init_debug(struct ath_softc *sc)
5557 + if (!AR_SREV_9300_20_OR_LATER(sc->sc_ah))
5560 + debugfs_create_file("tx99", S_IRUSR | S_IWUSR,
5561 + sc->debug.debugfs_phy, sc,
5563 + debugfs_create_file("tx99_power", S_IRUSR | S_IWUSR,
5564 + sc->debug.debugfs_phy, sc,
5565 + &fops_tx99_power);
5567 --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
5568 +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
5569 @@ -44,14 +44,20 @@ static ssize_t read_file_dfs(struct file
5573 - if (sc->dfs_detector)
5574 - dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
5576 len += scnprintf(buf + len, size - len, "DFS support for "
5577 "macVersion = 0x%x, macRev = 0x%x: %s\n",
5578 hw_ver->macVersion, hw_ver->macRev,
5579 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ?
5580 "enabled" : "disabled");
5582 + if (!sc->dfs_detector) {
5583 + len += scnprintf(buf + len, size - len,
5584 + "DFS detector not enabled\n");
5588 + dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
5590 len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
5591 ATH9K_DFS_STAT("pulse events reported ", pulses_total);
5592 ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs);
5593 @@ -76,6 +82,7 @@ static ssize_t read_file_dfs(struct file
5594 ATH9K_DFS_POOL_STAT("Seqs. alloc error ", pseq_alloc_error);
5595 ATH9K_DFS_POOL_STAT("Seqs. in use ", pseq_used);
5601 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
5602 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
5603 @@ -641,11 +641,12 @@ static void ar9003_hw_override_ini(struc
5605 ah->enabled_cals &= ~TX_IQ_CAL;
5607 - if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE)
5608 - ah->enabled_cals |= TX_CL_CAL;
5610 - ah->enabled_cals &= ~TX_CL_CAL;
5613 + if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE)
5614 + ah->enabled_cals |= TX_CL_CAL;
5616 + ah->enabled_cals &= ~TX_CL_CAL;
5619 static void ar9003_hw_prog_ini(struct ath_hw *ah,
5620 @@ -701,6 +702,54 @@ static int ar9550_hw_get_modes_txgain_in
5624 +static void ar9003_doubler_fix(struct ath_hw *ah)
5626 + if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9550(ah)) {
5627 + REG_RMW(ah, AR_PHY_65NM_CH0_RXTX2,
5628 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
5629 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0);
5630 + REG_RMW(ah, AR_PHY_65NM_CH1_RXTX2,
5631 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
5632 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0);
5633 + REG_RMW(ah, AR_PHY_65NM_CH2_RXTX2,
5634 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
5635 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0);
5639 + REG_CLR_BIT(ah, AR_PHY_65NM_CH0_RXTX2,
5640 + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK);
5641 + REG_CLR_BIT(ah, AR_PHY_65NM_CH1_RXTX2,
5642 + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK);
5643 + REG_CLR_BIT(ah, AR_PHY_65NM_CH2_RXTX2,
5644 + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK);
5648 + REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX2,
5649 + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1);
5650 + REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX2,
5651 + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1);
5652 + REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX2,
5653 + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1);
5657 + REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_SYNTH12,
5658 + AR_PHY_65NM_CH0_SYNTH12_VREFMUL3, 0xf);
5660 + REG_RMW(ah, AR_PHY_65NM_CH0_RXTX2, 0,
5661 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
5662 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S);
5663 + REG_RMW(ah, AR_PHY_65NM_CH1_RXTX2, 0,
5664 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
5665 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S);
5666 + REG_RMW(ah, AR_PHY_65NM_CH2_RXTX2, 0,
5667 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
5668 + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S);
5672 static int ar9003_hw_process_ini(struct ath_hw *ah,
5673 struct ath9k_channel *chan)
5675 @@ -726,6 +775,8 @@ static int ar9003_hw_process_ini(struct
5679 + ar9003_doubler_fix(ah);
5684 @@ -1281,6 +1332,7 @@ static void ar9003_hw_ani_cache_ini_regs
5685 static void ar9003_hw_set_radar_params(struct ath_hw *ah,
5686 struct ath_hw_radar_conf *conf)
5688 + unsigned int regWrites = 0;
5689 u32 radar_0 = 0, radar_1 = 0;
5692 @@ -1307,6 +1359,11 @@ static void ar9003_hw_set_radar_params(s
5693 REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
5695 REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
5697 + if (AR_SREV_9300(ah) || AR_SREV_9340(ah) || AR_SREV_9580(ah)) {
5698 + REG_WRITE_ARRAY(&ah->ini_dfs,
5699 + IS_CHAN_HT40(ah->curchan) ? 2 : 1, regWrites);
5703 static void ar9003_hw_set_radar_conf(struct ath_hw *ah)
5704 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
5705 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
5706 @@ -341,14 +341,15 @@
5707 #define AR_PHY_CCA_MAX_GOOD_VAL_9300_2GHZ -95
5708 #define AR_PHY_CCA_MAX_GOOD_VAL_9300_5GHZ -100
5710 +#define AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_2GHZ -95
5711 +#define AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_5GHZ -100
5713 #define AR_PHY_CCA_NOM_VAL_9462_2GHZ -127
5714 #define AR_PHY_CCA_MIN_GOOD_VAL_9462_2GHZ -127
5715 #define AR_PHY_CCA_MAX_GOOD_VAL_9462_2GHZ -60
5716 -#define AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_2GHZ -95
5717 #define AR_PHY_CCA_NOM_VAL_9462_5GHZ -127
5718 #define AR_PHY_CCA_MIN_GOOD_VAL_9462_5GHZ -127
5719 #define AR_PHY_CCA_MAX_GOOD_VAL_9462_5GHZ -60
5720 -#define AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_5GHZ -100
5722 #define AR_PHY_CCA_NOM_VAL_9330_2GHZ -118
5724 @@ -656,13 +657,24 @@
5725 #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00000001 : 0x00000002)
5726 #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0 : 1)
5727 #define AR_PHY_65NM_CH0_SYNTH7 0x16098
5728 +#define AR_PHY_65NM_CH0_SYNTH12 0x160ac
5729 #define AR_PHY_65NM_CH0_BIAS1 0x160c0
5730 #define AR_PHY_65NM_CH0_BIAS2 0x160c4
5731 #define AR_PHY_65NM_CH0_BIAS4 0x160cc
5732 +#define AR_PHY_65NM_CH0_RXTX2 0x16104
5733 +#define AR_PHY_65NM_CH1_RXTX2 0x16504
5734 +#define AR_PHY_65NM_CH2_RXTX2 0x16904
5735 #define AR_PHY_65NM_CH0_RXTX4 0x1610c
5736 #define AR_PHY_65NM_CH1_RXTX4 0x1650c
5737 #define AR_PHY_65NM_CH2_RXTX4 0x1690c
5739 +#define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3 0x00780000
5740 +#define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3_S 19
5741 +#define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK 0x00000004
5742 +#define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S 2
5743 +#define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK 0x00000008
5744 +#define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S 3
5746 #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \
5747 (((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x1628c : 0x16280)))
5748 #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300)
5749 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
5750 +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
5751 @@ -181,6 +181,7 @@ static void rt2x00lib_autowakeup(struct
5752 static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac,
5753 struct ieee80211_vif *vif)
5755 + struct ieee80211_tx_control control = {};
5756 struct rt2x00_dev *rt2x00dev = data;
5757 struct sk_buff *skb;
5759 @@ -195,7 +196,7 @@ static void rt2x00lib_bc_buffer_iter(voi
5761 skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
5763 - rt2x00mac_tx(rt2x00dev->hw, NULL, skb);
5764 + rt2x00mac_tx(rt2x00dev->hw, &control, skb);
5765 skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
5768 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
5769 +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
5770 @@ -898,7 +898,7 @@ static void ar9003_hw_tx_iq_cal_reload(s
5772 static void ar9003_hw_manual_peak_cal(struct ath_hw *ah, u8 chain, bool is_2g)
5774 - int offset[8], total = 0, test;
5775 + int offset[8] = {0}, total = 0, test;
5778 REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_GAINSTAGES(chain),
5779 @@ -923,12 +923,18 @@ static void ar9003_hw_manual_peak_cal(st
5780 AR_PHY_65NM_RXRF_AGC_AGC_ON_OVR, 0x1);
5781 REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
5782 AR_PHY_65NM_RXRF_AGC_AGC_CAL_OVR, 0x1);
5784 - REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
5785 - AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, 0x0);
5788 + if (AR_SREV_9330_11(ah)) {
5789 REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
5790 - AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR, 0x0);
5791 + AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0);
5794 + REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
5795 + AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, 0x0);
5797 + REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
5798 + AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR, 0x0);
5801 for (i = 6; i > 0; i--) {
5802 offset[i] = BIT(i - 1);
5803 @@ -964,9 +970,9 @@ static void ar9003_hw_manual_peak_cal(st
5804 AR_PHY_65NM_RXRF_AGC_AGC_CAL_OVR, 0);
5807 -static void ar9003_hw_do_manual_peak_cal(struct ath_hw *ah,
5808 - struct ath9k_channel *chan,
5810 +static void ar9003_hw_do_pcoem_manual_peak_cal(struct ath_hw *ah,
5811 + struct ath9k_channel *chan,
5814 struct ath9k_hw_cal_data *caldata = ah->caldata;
5816 @@ -1040,14 +1046,14 @@ static void ar9003_hw_cl_cal_post_proc(s
5820 -static bool ar9003_hw_init_cal(struct ath_hw *ah,
5821 - struct ath9k_channel *chan)
5822 +static bool ar9003_hw_init_cal_pcoem(struct ath_hw *ah,
5823 + struct ath9k_channel *chan)
5825 struct ath_common *common = ath9k_hw_common(ah);
5826 struct ath9k_hw_cal_data *caldata = ah->caldata;
5827 bool txiqcal_done = false;
5828 bool is_reusable = true, status = true;
5829 - bool run_rtt_cal = false, run_agc_cal, sep_iq_cal = false;
5830 + bool run_rtt_cal = false, run_agc_cal;
5831 bool rtt = !!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT);
5833 u32 agc_ctrl = 0, agc_supp_cals = AR_PHY_AGC_CONTROL_OFFSET_CAL |
5834 @@ -1119,22 +1125,12 @@ static bool ar9003_hw_init_cal(struct at
5835 REG_CLR_BIT(ah, AR_PHY_TX_IQCAL_CONTROL_0,
5836 AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL);
5837 txiqcal_done = run_agc_cal = true;
5838 - } else if (caldata && !test_bit(TXIQCAL_DONE, &caldata->cal_flags)) {
5839 - run_agc_cal = true;
5840 - sep_iq_cal = true;
5844 if (ath9k_hw_mci_is_enabled(ah) && IS_CHAN_2GHZ(chan) && run_agc_cal)
5845 ar9003_mci_init_cal_req(ah, &is_reusable);
5848 - txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
5849 - REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
5851 - REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
5854 if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE) {
5855 rx_delay = REG_READ(ah, AR_PHY_RX_DELAY);
5856 /* Disable BB_active */
5857 @@ -1155,7 +1151,7 @@ skip_tx_iqcal:
5858 AR_PHY_AGC_CONTROL_CAL,
5859 0, AH_WAIT_TIMEOUT);
5861 - ar9003_hw_do_manual_peak_cal(ah, chan, run_rtt_cal);
5862 + ar9003_hw_do_pcoem_manual_peak_cal(ah, chan, run_rtt_cal);
5865 if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE) {
5866 @@ -1228,13 +1224,112 @@ skip_tx_iqcal:
5870 +static bool ar9003_hw_init_cal_soc(struct ath_hw *ah,
5871 + struct ath9k_channel *chan)
5873 + struct ath_common *common = ath9k_hw_common(ah);
5874 + struct ath9k_hw_cal_data *caldata = ah->caldata;
5875 + bool txiqcal_done = false;
5876 + bool is_reusable = true, status = true;
5877 + bool run_agc_cal = false, sep_iq_cal = false;
5879 + /* Use chip chainmask only for calibration */
5880 + ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
5882 + if (ah->enabled_cals & TX_CL_CAL) {
5883 + REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE);
5884 + run_agc_cal = true;
5887 + if (IS_CHAN_HALF_RATE(chan) || IS_CHAN_QUARTER_RATE(chan))
5888 + goto skip_tx_iqcal;
5890 + /* Do Tx IQ Calibration */
5891 + REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
5892 + AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT,
5896 + * For AR9485 or later chips, TxIQ cal runs as part of
5897 + * AGC calibration. Specifically, AR9550 in SoC chips.
5899 + if (ah->enabled_cals & TX_IQ_ON_AGC_CAL) {
5900 + txiqcal_done = true;
5901 + run_agc_cal = true;
5903 + sep_iq_cal = true;
5904 + run_agc_cal = true;
5908 + * In the SoC family, this will run for AR9300, AR9331 and AR9340.
5911 + txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
5912 + REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
5914 + REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
5918 + if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) {
5919 + if (AR_SREV_9330_11(ah))
5920 + ar9003_hw_manual_peak_cal(ah, 0, IS_CHAN_2GHZ(chan));
5922 + /* Calibrate the AGC */
5923 + REG_WRITE(ah, AR_PHY_AGC_CONTROL,
5924 + REG_READ(ah, AR_PHY_AGC_CONTROL) |
5925 + AR_PHY_AGC_CONTROL_CAL);
5927 + /* Poll for offset calibration complete */
5928 + status = ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
5929 + AR_PHY_AGC_CONTROL_CAL,
5930 + 0, AH_WAIT_TIMEOUT);
5934 + ath_dbg(common, CALIBRATE,
5935 + "offset calibration failed to complete in %d ms; noisy environment?\n",
5936 + AH_WAIT_TIMEOUT / 1000);
5941 + ar9003_hw_tx_iq_cal_post_proc(ah, is_reusable);
5943 + /* Revert chainmask to runtime parameters */
5944 + ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
5946 + /* Initialize list pointers */
5947 + ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
5949 + INIT_CAL(&ah->iq_caldata);
5950 + INSERT_CAL(ah, &ah->iq_caldata);
5951 + ath_dbg(common, CALIBRATE, "enabling IQ Calibration\n");
5953 + /* Initialize current pointer to first element in list */
5954 + ah->cal_list_curr = ah->cal_list;
5956 + if (ah->cal_list_curr)
5957 + ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
5960 + caldata->CalValid = 0;
5965 void ar9003_hw_attach_calib_ops(struct ath_hw *ah)
5967 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
5968 struct ath_hw_ops *ops = ath9k_hw_ops(ah);
5970 + if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah))
5971 + priv_ops->init_cal = ar9003_hw_init_cal_pcoem;
5973 + priv_ops->init_cal = ar9003_hw_init_cal_soc;
5975 priv_ops->init_cal_settings = ar9003_hw_init_cal_settings;
5976 - priv_ops->init_cal = ar9003_hw_init_cal;
5977 priv_ops->setup_calibration = ar9003_hw_setup_calibration;
5979 ops->calibrate = ar9003_hw_calibrate;
5980 --- a/drivers/net/wireless/ath/ath9k/common.c
5981 +++ b/drivers/net/wireless/ath/ath9k/common.c
5982 @@ -98,10 +98,8 @@ struct ath9k_channel *ath9k_cmn_get_chan
5984 struct ieee80211_channel *curchan = chandef->chan;
5985 struct ath9k_channel *channel;
5988 - chan_idx = curchan->hw_value;
5989 - channel = &ah->channels[chan_idx];
5990 + channel = &ah->channels[curchan->hw_value];
5991 ath9k_cmn_update_ichannel(channel, chandef);
5994 --- a/net/mac80211/rc80211_minstrel_ht.c
5995 +++ b/net/mac80211/rc80211_minstrel_ht.c
5996 @@ -226,7 +226,7 @@ minstrel_ht_calc_tp(struct minstrel_ht_s
5997 nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
5999 nsecs += minstrel_mcs_groups[group].duration[rate];
6000 - tp = 1000000 * ((mr->probability * 1000) / nsecs);
6001 + tp = 1000000 * ((prob * 1000) / nsecs);
6003 mr->cur_tp = MINSTREL_TRUNC(tp);
6005 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
6006 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
6007 @@ -3965,7 +3965,7 @@ static void ar9003_hw_apply_tuning_caps(
6008 struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
6009 u8 tuning_caps_param = eep->baseEepHeader.params_for_tuning_caps[0];
6011 - if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah))
6012 + if (AR_SREV_9340(ah))
6015 if (eep->baseEepHeader.featureEnable & 0x40) {
6016 @@ -3984,18 +3984,20 @@ static void ar9003_hw_quick_drop_apply(s
6018 s32 t[3], f[3] = {5180, 5500, 5785};
6020 - if (!(pBase->miscConfiguration & BIT(1)))
6021 + if (!(pBase->miscConfiguration & BIT(4)))
6025 - quick_drop = eep->modalHeader2G.quick_drop;
6027 - t[0] = eep->base_ext1.quick_drop_low;
6028 - t[1] = eep->modalHeader5G.quick_drop;
6029 - t[2] = eep->base_ext1.quick_drop_high;
6030 - quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
6031 + if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9340(ah)) {
6032 + if (freq < 4000) {
6033 + quick_drop = eep->modalHeader2G.quick_drop;
6035 + t[0] = eep->base_ext1.quick_drop_low;
6036 + t[1] = eep->modalHeader5G.quick_drop;
6037 + t[2] = eep->base_ext1.quick_drop_high;
6038 + quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
6040 + REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
6042 - REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
6045 static void ar9003_hw_txend_to_xpa_off_apply(struct ath_hw *ah, bool is2ghz)
6046 @@ -4035,7 +4037,7 @@ static void ar9003_hw_xlna_bias_strength
6047 struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
6050 - if (!(eep->baseEepHeader.featureEnable & 0x40))
6051 + if (!(eep->baseEepHeader.miscConfiguration & 0x40))
6054 if (!AR_SREV_9300(ah))
6055 @@ -4120,7 +4122,7 @@ static void ath9k_hw_ar9300_set_board_va
6056 ar9003_hw_xlna_bias_strength_apply(ah, is2ghz);
6057 ar9003_hw_atten_apply(ah, chan);
6058 ar9003_hw_quick_drop_apply(ah, chan->channel);
6059 - if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah) && !AR_SREV_9550(ah))
6060 + if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah))
6061 ar9003_hw_internal_regulator_apply(ah);
6062 ar9003_hw_apply_tuning_caps(ah);
6063 ar9003_hw_txend_to_xpa_off_apply(ah, is2ghz);
6064 --- a/net/mac80211/ieee80211_i.h
6065 +++ b/net/mac80211/ieee80211_i.h
6066 @@ -735,6 +735,7 @@ struct ieee80211_sub_if_data {
6067 int csa_counter_offset_beacon;
6068 int csa_counter_offset_presp;
6069 bool csa_radar_required;
6070 + struct cfg80211_chan_def csa_chandef;
6072 /* used to reconfigure hardware SM PS */
6073 struct work_struct recalc_smps;
6074 @@ -811,6 +812,9 @@ static inline void sdata_unlock(struct i
6075 __release(&sdata->wdev.mtx);
6078 +#define sdata_dereference(p, sdata) \
6079 + rcu_dereference_protected(p, lockdep_is_held(&sdata->wdev.mtx))
6082 sdata_assert_lock(struct ieee80211_sub_if_data *sdata)
6084 @@ -1098,7 +1102,6 @@ struct ieee80211_local {
6085 enum mac80211_scan_state next_scan_state;
6086 struct delayed_work scan_work;
6087 struct ieee80211_sub_if_data __rcu *scan_sdata;
6088 - struct cfg80211_chan_def csa_chandef;
6089 /* For backward compatibility only -- do not use */
6090 struct cfg80211_chan_def _oper_chandef;
6092 @@ -1236,6 +1239,7 @@ struct ieee80211_csa_ie {
6099 /* Parsed Information Elements */
6100 @@ -1738,7 +1742,6 @@ ieee80211_vif_change_bandwidth(struct ie
6101 /* NOTE: only use ieee80211_vif_change_channel() for channel switch */
6103 ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
6104 - const struct cfg80211_chan_def *chandef,
6106 void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
6107 void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
6108 --- a/net/mac80211/chan.c
6109 +++ b/net/mac80211/chan.c
6110 @@ -411,12 +411,12 @@ int ieee80211_vif_use_channel(struct iee
6113 int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
6114 - const struct cfg80211_chan_def *chandef,
6117 struct ieee80211_local *local = sdata->local;
6118 struct ieee80211_chanctx_conf *conf;
6119 struct ieee80211_chanctx *ctx;
6120 + const struct cfg80211_chan_def *chandef = &sdata->csa_chandef;
6122 u32 chanctx_changed = 0;
6124 --- a/net/mac80211/ibss.c
6125 +++ b/net/mac80211/ibss.c
6126 @@ -550,12 +550,12 @@ int ieee80211_ibss_finish_csa(struct iee
6128 /* XXX: should not really modify cfg80211 data */
6130 - cbss->channel = sdata->local->csa_chandef.chan;
6131 + cbss->channel = sdata->csa_chandef.chan;
6132 cfg80211_put_bss(sdata->local->hw.wiphy, cbss);
6136 - ifibss->chandef = sdata->local->csa_chandef;
6137 + ifibss->chandef = sdata->csa_chandef;
6139 /* generate the beacon */
6140 err = ieee80211_ibss_csa_beacon(sdata, NULL);
6141 @@ -922,7 +922,7 @@ ieee80211_ibss_process_chanswitch(struct
6142 IEEE80211_MAX_QUEUE_MAP,
6143 IEEE80211_QUEUE_STOP_REASON_CSA);
6145 - sdata->local->csa_chandef = params.chandef;
6146 + sdata->csa_chandef = params.chandef;
6147 sdata->vif.csa_active = true;
6149 ieee80211_bss_info_change_notify(sdata, err);
6150 --- a/net/mac80211/mesh.c
6151 +++ b/net/mac80211/mesh.c
6152 @@ -943,14 +943,19 @@ ieee80211_mesh_process_chnswitch(struct
6153 params.chandef.chan->center_freq);
6155 params.block_tx = csa_ie.mode & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT;
6158 ifmsh->chsw_ttl = csa_ie.ttl - 1;
6160 - ifmsh->chsw_ttl = 0;
6161 + if (ifmsh->pre_value >= csa_ie.pre_value)
6163 + ifmsh->pre_value = csa_ie.pre_value;
6166 - if (ifmsh->chsw_ttl > 0)
6167 + if (ifmsh->chsw_ttl < ifmsh->mshcfg.dot11MeshTTL) {
6168 if (ieee80211_mesh_csa_beacon(sdata, ¶ms, false) < 0)
6174 sdata->csa_radar_required = params.radar_required;
6176 @@ -959,7 +964,7 @@ ieee80211_mesh_process_chnswitch(struct
6177 IEEE80211_MAX_QUEUE_MAP,
6178 IEEE80211_QUEUE_STOP_REASON_CSA);
6180 - sdata->local->csa_chandef = params.chandef;
6181 + sdata->csa_chandef = params.chandef;
6182 sdata->vif.csa_active = true;
6184 ieee80211_bss_info_change_notify(sdata, err);
6185 @@ -1163,7 +1168,6 @@ static int mesh_fwd_csa_frame(struct iee
6186 offset_ttl = (len < 42) ? 7 : 10;
6187 *(pos + offset_ttl) -= 1;
6188 *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR;
6189 - sdata->u.mesh.chsw_ttl = *(pos + offset_ttl);
6191 memcpy(mgmt_fwd, mgmt, len);
6192 eth_broadcast_addr(mgmt_fwd->da);
6193 @@ -1182,7 +1186,7 @@ static void mesh_rx_csa_frame(struct iee
6195 bool fwd_csa = true;
6200 if (mgmt->u.action.u.measurement.action_code !=
6201 WLAN_ACTION_SPCT_CHL_SWITCH)
6202 @@ -1193,8 +1197,8 @@ static void mesh_rx_csa_frame(struct iee
6203 u.action.u.chan_switch.variable);
6204 ieee802_11_parse_elems(pos, len - baselen, false, &elems);
6206 - ttl = elems.mesh_chansw_params_ie->mesh_ttl;
6208 + ifmsh->chsw_ttl = elems.mesh_chansw_params_ie->mesh_ttl;
6209 + if (!--ifmsh->chsw_ttl)
6212 pre_value = le16_to_cpu(elems.mesh_chansw_params_ie->mesh_pre_value);
6213 --- a/net/mac80211/spectmgmt.c
6214 +++ b/net/mac80211/spectmgmt.c
6215 @@ -78,6 +78,8 @@ int ieee80211_parse_ch_switch_ie(struct
6216 if (elems->mesh_chansw_params_ie) {
6217 csa_ie->ttl = elems->mesh_chansw_params_ie->mesh_ttl;
6218 csa_ie->mode = elems->mesh_chansw_params_ie->mesh_flags;
6219 + csa_ie->pre_value = le16_to_cpu(
6220 + elems->mesh_chansw_params_ie->mesh_pre_value);
6223 new_freq = ieee80211_channel_to_frequency(new_chan_no, new_band);
6224 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
6225 +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
6226 @@ -1109,7 +1109,9 @@ void ath6kl_cfg80211_ch_switch_notify(st
6227 (mode == WMI_11G_HT20) ?
6228 NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);
6230 + mutex_lock(vif->wdev->mtx);
6231 cfg80211_ch_switch_notify(vif->ndev, &chandef);
6232 + mutex_unlock(vif->wdev->mtx);
6235 static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
6236 --- a/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
6237 +++ b/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
6242 +#define ar9462_2p1_mac_postamble ar9462_2p0_mac_postamble
6244 +#define ar9462_2p1_baseband_core ar9462_2p0_baseband_core
6246 +#define ar9462_2p1_radio_core ar9462_2p0_radio_core
6248 +#define ar9462_2p1_radio_postamble ar9462_2p0_radio_postamble
6250 +#define ar9462_2p1_soc_postamble ar9462_2p0_soc_postamble
6252 +#define ar9462_2p1_radio_postamble_sys2ant ar9462_2p0_radio_postamble_sys2ant
6254 +#define ar9462_2p1_common_rx_gain ar9462_2p0_common_rx_gain
6256 +#define ar9462_2p1_common_mixed_rx_gain ar9462_2p0_common_mixed_rx_gain
6258 +#define ar9462_2p1_common_5g_xlna_only_rxgain ar9462_2p0_common_5g_xlna_only_rxgain
6260 +#define ar9462_2p1_baseband_core_mix_rxgain ar9462_2p0_baseband_core_mix_rxgain
6262 +#define ar9462_2p1_baseband_postamble_mix_rxgain ar9462_2p0_baseband_postamble_mix_rxgain
6264 +#define ar9462_2p1_baseband_postamble_5g_xlna ar9462_2p0_baseband_postamble_5g_xlna
6266 +#define ar9462_2p1_common_wo_xlna_rx_gain ar9462_2p0_common_wo_xlna_rx_gain
6268 +#define ar9462_2p1_modes_low_ob_db_tx_gain ar9462_2p0_modes_low_ob_db_tx_gain
6270 +#define ar9462_2p1_modes_high_ob_db_tx_gain ar9462_2p0_modes_high_ob_db_tx_gain
6272 +#define ar9462_2p1_modes_mix_ob_db_tx_gain ar9462_2p0_modes_mix_ob_db_tx_gain
6274 +#define ar9462_2p1_modes_fast_clock ar9462_2p0_modes_fast_clock
6276 +#define ar9462_2p1_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
6278 +#define ar9462_2p1_pciephy_clkreq_disable_L1 ar9462_2p0_pciephy_clkreq_disable_L1
6280 static const u32 ar9462_2p1_mac_core[][2] = {
6282 {0x00000008, 0x00000000},
6283 @@ -183,168 +221,6 @@ static const u32 ar9462_2p1_mac_core[][2
6284 {0x000083d0, 0x000301ff},
6287 -static const u32 ar9462_2p1_mac_postamble[][5] = {
6288 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
6289 - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
6290 - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
6291 - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
6292 - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
6293 - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
6294 - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
6295 - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
6296 - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
6299 -static const u32 ar9462_2p1_baseband_core[][2] = {
6300 - /* Addr allmodes */
6301 - {0x00009800, 0xafe68e30},
6302 - {0x00009804, 0xfd14e000},
6303 - {0x00009808, 0x9c0a9f6b},
6304 - {0x0000980c, 0x04900000},
6305 - {0x00009814, 0x9280c00a},
6306 - {0x00009818, 0x00000000},
6307 - {0x0000981c, 0x00020028},
6308 - {0x00009834, 0x6400a290},
6309 - {0x00009838, 0x0108ecff},
6310 - {0x0000983c, 0x0d000600},
6311 - {0x00009880, 0x201fff00},
6312 - {0x00009884, 0x00001042},
6313 - {0x000098a4, 0x00200400},
6314 - {0x000098b0, 0x32440bbe},
6315 - {0x000098d0, 0x004b6a8e},
6316 - {0x000098d4, 0x00000820},
6317 - {0x000098dc, 0x00000000},
6318 - {0x000098e4, 0x01ffffff},
6319 - {0x000098e8, 0x01ffffff},
6320 - {0x000098ec, 0x01ffffff},
6321 - {0x000098f0, 0x00000000},
6322 - {0x000098f4, 0x00000000},
6323 - {0x00009bf0, 0x80000000},
6324 - {0x00009c04, 0xff55ff55},
6325 - {0x00009c08, 0x0320ff55},
6326 - {0x00009c0c, 0x00000000},
6327 - {0x00009c10, 0x00000000},
6328 - {0x00009c14, 0x00046384},
6329 - {0x00009c18, 0x05b6b440},
6330 - {0x00009c1c, 0x00b6b440},
6331 - {0x00009d00, 0xc080a333},
6332 - {0x00009d04, 0x40206c10},
6333 - {0x00009d08, 0x009c4060},
6334 - {0x00009d0c, 0x9883800a},
6335 - {0x00009d10, 0x01834061},
6336 - {0x00009d14, 0x00c0040b},
6337 - {0x00009d18, 0x00000000},
6338 - {0x00009e08, 0x0038230c},
6339 - {0x00009e24, 0x990bb515},
6340 - {0x00009e28, 0x0c6f0000},
6341 - {0x00009e30, 0x06336f77},
6342 - {0x00009e34, 0x6af6532f},
6343 - {0x00009e38, 0x0cc80c00},
6344 - {0x00009e40, 0x15262820},
6345 - {0x00009e4c, 0x00001004},
6346 - {0x00009e50, 0x00ff03f1},
6347 - {0x00009e54, 0xe4c555c2},
6348 - {0x00009e58, 0xfd857722},
6349 - {0x00009e5c, 0xe9198724},
6350 - {0x00009fc0, 0x803e4788},
6351 - {0x00009fc4, 0x0001efb5},
6352 - {0x00009fcc, 0x40000014},
6353 - {0x00009fd0, 0x0a193b93},
6354 - {0x0000a20c, 0x00000000},
6355 - {0x0000a220, 0x00000000},
6356 - {0x0000a224, 0x00000000},
6357 - {0x0000a228, 0x10002310},
6358 - {0x0000a23c, 0x00000000},
6359 - {0x0000a244, 0x0c000000},
6360 - {0x0000a2a0, 0x00000001},
6361 - {0x0000a2c0, 0x00000001},
6362 - {0x0000a2c8, 0x00000000},
6363 - {0x0000a2cc, 0x18c43433},
6364 - {0x0000a2d4, 0x00000000},
6365 - {0x0000a2ec, 0x00000000},
6366 - {0x0000a2f0, 0x00000000},
6367 - {0x0000a2f4, 0x00000000},
6368 - {0x0000a2f8, 0x00000000},
6369 - {0x0000a344, 0x00000000},
6370 - {0x0000a34c, 0x00000000},
6371 - {0x0000a350, 0x0000a000},
6372 - {0x0000a364, 0x00000000},
6373 - {0x0000a370, 0x00000000},
6374 - {0x0000a390, 0x00000001},
6375 - {0x0000a394, 0x00000444},
6376 - {0x0000a398, 0x001f0e0f},
6377 - {0x0000a39c, 0x0075393f},
6378 - {0x0000a3a0, 0xb79f6427},
6379 - {0x0000a3c0, 0x20202020},
6380 - {0x0000a3c4, 0x22222220},
6381 - {0x0000a3c8, 0x20200020},
6382 - {0x0000a3cc, 0x20202020},
6383 - {0x0000a3d0, 0x20202020},
6384 - {0x0000a3d4, 0x20202020},
6385 - {0x0000a3d8, 0x20202020},
6386 - {0x0000a3dc, 0x20202020},
6387 - {0x0000a3e0, 0x20202020},
6388 - {0x0000a3e4, 0x20202020},
6389 - {0x0000a3e8, 0x20202020},
6390 - {0x0000a3ec, 0x20202020},
6391 - {0x0000a3f0, 0x00000000},
6392 - {0x0000a3f4, 0x00000006},
6393 - {0x0000a3f8, 0x0c9bd380},
6394 - {0x0000a3fc, 0x000f0f01},
6395 - {0x0000a400, 0x8fa91f01},
6396 - {0x0000a404, 0x00000000},
6397 - {0x0000a408, 0x0e79e5c6},
6398 - {0x0000a40c, 0x00820820},
6399 - {0x0000a414, 0x1ce739ce},
6400 - {0x0000a418, 0x2d001dce},
6401 - {0x0000a434, 0x00000000},
6402 - {0x0000a438, 0x00001801},
6403 - {0x0000a43c, 0x00100000},
6404 - {0x0000a444, 0x00000000},
6405 - {0x0000a448, 0x05000080},
6406 - {0x0000a44c, 0x00000001},
6407 - {0x0000a450, 0x00010000},
6408 - {0x0000a454, 0x07000000},
6409 - {0x0000a644, 0xbfad9d74},
6410 - {0x0000a648, 0x0048060a},
6411 - {0x0000a64c, 0x00002037},
6412 - {0x0000a670, 0x03020100},
6413 - {0x0000a674, 0x09080504},
6414 - {0x0000a678, 0x0d0c0b0a},
6415 - {0x0000a67c, 0x13121110},
6416 - {0x0000a680, 0x31301514},
6417 - {0x0000a684, 0x35343332},
6418 - {0x0000a688, 0x00000036},
6419 - {0x0000a690, 0x00000838},
6420 - {0x0000a6b0, 0x0000000a},
6421 - {0x0000a6b4, 0x00512c01},
6422 - {0x0000a7c0, 0x00000000},
6423 - {0x0000a7c4, 0xfffffffc},
6424 - {0x0000a7c8, 0x00000000},
6425 - {0x0000a7cc, 0x00000000},
6426 - {0x0000a7d0, 0x00000000},
6427 - {0x0000a7d4, 0x00000004},
6428 - {0x0000a7dc, 0x00000000},
6429 - {0x0000a7f0, 0x80000000},
6430 - {0x0000a8d0, 0x004b6a8e},
6431 - {0x0000a8d4, 0x00000820},
6432 - {0x0000a8dc, 0x00000000},
6433 - {0x0000a8f0, 0x00000000},
6434 - {0x0000a8f4, 0x00000000},
6435 - {0x0000abf0, 0x80000000},
6436 - {0x0000b2d0, 0x00000080},
6437 - {0x0000b2d4, 0x00000000},
6438 - {0x0000b2ec, 0x00000000},
6439 - {0x0000b2f0, 0x00000000},
6440 - {0x0000b2f4, 0x00000000},
6441 - {0x0000b2f8, 0x00000000},
6442 - {0x0000b408, 0x0e79e5c0},
6443 - {0x0000b40c, 0x00820820},
6444 - {0x0000b420, 0x00000000},
6445 - {0x0000b6b0, 0x0000000a},
6446 - {0x0000b6b4, 0x00000001},
6449 static const u32 ar9462_2p1_baseband_postamble[][5] = {
6450 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
6451 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
6452 @@ -361,7 +237,7 @@ static const u32 ar9462_2p1_baseband_pos
6453 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
6454 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
6455 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
6456 - {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
6457 + {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
6458 {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
6459 {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
6460 {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
6461 @@ -400,1375 +276,16 @@ static const u32 ar9462_2p1_baseband_pos
6462 {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
6463 {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
6464 {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
6465 - {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
6466 + {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
6467 {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
6470 -static const u32 ar9462_2p1_radio_core[][2] = {
6471 - /* Addr allmodes */
6472 - {0x00016000, 0x36db6db6},
6473 - {0x00016004, 0x6db6db40},
6474 - {0x00016008, 0x73f00000},
6475 - {0x0001600c, 0x00000000},
6476 - {0x00016010, 0x6d820001},
6477 - {0x00016040, 0x7f80fff8},
6478 - {0x0001604c, 0x2699e04f},
6479 - {0x00016050, 0x6db6db6c},
6480 - {0x00016058, 0x6c200000},
6481 - {0x00016080, 0x000c0000},
6482 - {0x00016084, 0x9a68048c},
6483 - {0x00016088, 0x54214514},
6484 - {0x0001608c, 0x1203040b},
6485 - {0x00016090, 0x24926490},
6486 - {0x00016098, 0xd2888888},
6487 - {0x000160a0, 0x0a108ffe},
6488 - {0x000160a4, 0x812fc491},
6489 - {0x000160a8, 0x423c8000},
6490 - {0x000160b4, 0x92000000},
6491 - {0x000160b8, 0x0285dddc},
6492 - {0x000160bc, 0x02908888},
6493 - {0x000160c0, 0x00adb6d0},
6494 - {0x000160c4, 0x6db6db60},
6495 - {0x000160c8, 0x6db6db6c},
6496 - {0x000160cc, 0x0de6c1b0},
6497 - {0x00016100, 0x3fffbe04},
6498 - {0x00016104, 0xfff80000},
6499 - {0x00016108, 0x00200400},
6500 - {0x00016110, 0x00000000},
6501 - {0x00016144, 0x02084080},
6502 - {0x00016148, 0x000080c0},
6503 - {0x00016280, 0x050a0001},
6504 - {0x00016284, 0x3d841418},
6505 - {0x00016288, 0x00000000},
6506 - {0x0001628c, 0xe3000000},
6507 - {0x00016290, 0xa1005080},
6508 - {0x00016294, 0x00000020},
6509 - {0x00016298, 0x54a82900},
6510 - {0x00016340, 0x121e4276},
6511 - {0x00016344, 0x00300000},
6512 - {0x00016400, 0x36db6db6},
6513 - {0x00016404, 0x6db6db40},
6514 - {0x00016408, 0x73f00000},
6515 - {0x0001640c, 0x00000000},
6516 - {0x00016410, 0x6c800001},
6517 - {0x00016440, 0x7f80fff8},
6518 - {0x0001644c, 0x4699e04f},
6519 - {0x00016450, 0x6db6db6c},
6520 - {0x00016500, 0x3fffbe04},
6521 - {0x00016504, 0xfff80000},
6522 - {0x00016508, 0x00200400},
6523 - {0x00016510, 0x00000000},
6524 - {0x00016544, 0x02084080},
6525 - {0x00016548, 0x000080c0},
6528 -static const u32 ar9462_2p1_radio_postamble[][5] = {
6529 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
6530 - {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
6531 - {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
6532 - {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
6533 - {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
6536 static const u32 ar9462_2p1_soc_preamble[][2] = {
6538 - {0x000040a4, 0x00a0c1c9},
6539 + {0x000040a4, 0x00a0c9c9},
6540 {0x00007020, 0x00000000},
6541 {0x00007034, 0x00000002},
6542 {0x00007038, 0x000004c2},
6545 -static const u32 ar9462_2p1_soc_postamble[][5] = {
6546 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
6547 - {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
6550 -static const u32 ar9462_2p1_radio_postamble_sys2ant[][5] = {
6551 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
6552 - {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
6553 - {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
6554 - {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
6557 -static const u32 ar9462_2p1_common_rx_gain[][2] = {
6558 - /* Addr allmodes */
6559 - {0x0000a000, 0x00010000},
6560 - {0x0000a004, 0x00030002},
6561 - {0x0000a008, 0x00050004},
6562 - {0x0000a00c, 0x00810080},
6563 - {0x0000a010, 0x00830082},
6564 - {0x0000a014, 0x01810180},
6565 - {0x0000a018, 0x01830182},
6566 - {0x0000a01c, 0x01850184},
6567 - {0x0000a020, 0x01890188},
6568 - {0x0000a024, 0x018b018a},
6569 - {0x0000a028, 0x018d018c},
6570 - {0x0000a02c, 0x01910190},
6571 - {0x0000a030, 0x01930192},
6572 - {0x0000a034, 0x01950194},
6573 - {0x0000a038, 0x038a0196},
6574 - {0x0000a03c, 0x038c038b},
6575 - {0x0000a040, 0x0390038d},
6576 - {0x0000a044, 0x03920391},
6577 - {0x0000a048, 0x03940393},
6578 - {0x0000a04c, 0x03960395},
6579 - {0x0000a050, 0x00000000},
6580 - {0x0000a054, 0x00000000},
6581 - {0x0000a058, 0x00000000},
6582 - {0x0000a05c, 0x00000000},
6583 - {0x0000a060, 0x00000000},
6584 - {0x0000a064, 0x00000000},
6585 - {0x0000a068, 0x00000000},
6586 - {0x0000a06c, 0x00000000},
6587 - {0x0000a070, 0x00000000},
6588 - {0x0000a074, 0x00000000},
6589 - {0x0000a078, 0x00000000},
6590 - {0x0000a07c, 0x00000000},
6591 - {0x0000a080, 0x22222229},
6592 - {0x0000a084, 0x1d1d1d1d},
6593 - {0x0000a088, 0x1d1d1d1d},
6594 - {0x0000a08c, 0x1d1d1d1d},
6595 - {0x0000a090, 0x171d1d1d},
6596 - {0x0000a094, 0x11111717},
6597 - {0x0000a098, 0x00030311},
6598 - {0x0000a09c, 0x00000000},
6599 - {0x0000a0a0, 0x00000000},
6600 - {0x0000a0a4, 0x00000000},
6601 - {0x0000a0a8, 0x00000000},
6602 - {0x0000a0ac, 0x00000000},
6603 - {0x0000a0b0, 0x00000000},
6604 - {0x0000a0b4, 0x00000000},
6605 - {0x0000a0b8, 0x00000000},
6606 - {0x0000a0bc, 0x00000000},
6607 - {0x0000a0c0, 0x001f0000},
6608 - {0x0000a0c4, 0x01000101},
6609 - {0x0000a0c8, 0x011e011f},
6610 - {0x0000a0cc, 0x011c011d},
6611 - {0x0000a0d0, 0x02030204},
6612 - {0x0000a0d4, 0x02010202},
6613 - {0x0000a0d8, 0x021f0200},
6614 - {0x0000a0dc, 0x0302021e},
6615 - {0x0000a0e0, 0x03000301},
6616 - {0x0000a0e4, 0x031e031f},
6617 - {0x0000a0e8, 0x0402031d},
6618 - {0x0000a0ec, 0x04000401},
6619 - {0x0000a0f0, 0x041e041f},
6620 - {0x0000a0f4, 0x0502041d},
6621 - {0x0000a0f8, 0x05000501},
6622 - {0x0000a0fc, 0x051e051f},
6623 - {0x0000a100, 0x06010602},
6624 - {0x0000a104, 0x061f0600},
6625 - {0x0000a108, 0x061d061e},
6626 - {0x0000a10c, 0x07020703},
6627 - {0x0000a110, 0x07000701},
6628 - {0x0000a114, 0x00000000},
6629 - {0x0000a118, 0x00000000},
6630 - {0x0000a11c, 0x00000000},
6631 - {0x0000a120, 0x00000000},
6632 - {0x0000a124, 0x00000000},
6633 - {0x0000a128, 0x00000000},
6634 - {0x0000a12c, 0x00000000},
6635 - {0x0000a130, 0x00000000},
6636 - {0x0000a134, 0x00000000},
6637 - {0x0000a138, 0x00000000},
6638 - {0x0000a13c, 0x00000000},
6639 - {0x0000a140, 0x001f0000},
6640 - {0x0000a144, 0x01000101},
6641 - {0x0000a148, 0x011e011f},
6642 - {0x0000a14c, 0x011c011d},
6643 - {0x0000a150, 0x02030204},
6644 - {0x0000a154, 0x02010202},
6645 - {0x0000a158, 0x021f0200},
6646 - {0x0000a15c, 0x0302021e},
6647 - {0x0000a160, 0x03000301},
6648 - {0x0000a164, 0x031e031f},
6649 - {0x0000a168, 0x0402031d},
6650 - {0x0000a16c, 0x04000401},
6651 - {0x0000a170, 0x041e041f},
6652 - {0x0000a174, 0x0502041d},
6653 - {0x0000a178, 0x05000501},
6654 - {0x0000a17c, 0x051e051f},
6655 - {0x0000a180, 0x06010602},
6656 - {0x0000a184, 0x061f0600},
6657 - {0x0000a188, 0x061d061e},
6658 - {0x0000a18c, 0x07020703},
6659 - {0x0000a190, 0x07000701},
6660 - {0x0000a194, 0x00000000},
6661 - {0x0000a198, 0x00000000},
6662 - {0x0000a19c, 0x00000000},
6663 - {0x0000a1a0, 0x00000000},
6664 - {0x0000a1a4, 0x00000000},
6665 - {0x0000a1a8, 0x00000000},
6666 - {0x0000a1ac, 0x00000000},
6667 - {0x0000a1b0, 0x00000000},
6668 - {0x0000a1b4, 0x00000000},
6669 - {0x0000a1b8, 0x00000000},
6670 - {0x0000a1bc, 0x00000000},
6671 - {0x0000a1c0, 0x00000000},
6672 - {0x0000a1c4, 0x00000000},
6673 - {0x0000a1c8, 0x00000000},
6674 - {0x0000a1cc, 0x00000000},
6675 - {0x0000a1d0, 0x00000000},
6676 - {0x0000a1d4, 0x00000000},
6677 - {0x0000a1d8, 0x00000000},
6678 - {0x0000a1dc, 0x00000000},
6679 - {0x0000a1e0, 0x00000000},
6680 - {0x0000a1e4, 0x00000000},
6681 - {0x0000a1e8, 0x00000000},
6682 - {0x0000a1ec, 0x00000000},
6683 - {0x0000a1f0, 0x00000396},
6684 - {0x0000a1f4, 0x00000396},
6685 - {0x0000a1f8, 0x00000396},
6686 - {0x0000a1fc, 0x00000196},
6687 - {0x0000b000, 0x00010000},
6688 - {0x0000b004, 0x00030002},
6689 - {0x0000b008, 0x00050004},
6690 - {0x0000b00c, 0x00810080},
6691 - {0x0000b010, 0x00830082},
6692 - {0x0000b014, 0x01810180},
6693 - {0x0000b018, 0x01830182},
6694 - {0x0000b01c, 0x01850184},
6695 - {0x0000b020, 0x02810280},
6696 - {0x0000b024, 0x02830282},
6697 - {0x0000b028, 0x02850284},
6698 - {0x0000b02c, 0x02890288},
6699 - {0x0000b030, 0x028b028a},
6700 - {0x0000b034, 0x0388028c},
6701 - {0x0000b038, 0x038a0389},
6702 - {0x0000b03c, 0x038c038b},
6703 - {0x0000b040, 0x0390038d},
6704 - {0x0000b044, 0x03920391},
6705 - {0x0000b048, 0x03940393},
6706 - {0x0000b04c, 0x03960395},
6707 - {0x0000b050, 0x00000000},
6708 - {0x0000b054, 0x00000000},
6709 - {0x0000b058, 0x00000000},
6710 - {0x0000b05c, 0x00000000},
6711 - {0x0000b060, 0x00000000},
6712 - {0x0000b064, 0x00000000},
6713 - {0x0000b068, 0x00000000},
6714 - {0x0000b06c, 0x00000000},
6715 - {0x0000b070, 0x00000000},
6716 - {0x0000b074, 0x00000000},
6717 - {0x0000b078, 0x00000000},
6718 - {0x0000b07c, 0x00000000},
6719 - {0x0000b080, 0x2a2d2f32},
6720 - {0x0000b084, 0x21232328},
6721 - {0x0000b088, 0x19191c1e},
6722 - {0x0000b08c, 0x12141417},
6723 - {0x0000b090, 0x07070e0e},
6724 - {0x0000b094, 0x03030305},
6725 - {0x0000b098, 0x00000003},
6726 - {0x0000b09c, 0x00000000},
6727 - {0x0000b0a0, 0x00000000},
6728 - {0x0000b0a4, 0x00000000},
6729 - {0x0000b0a8, 0x00000000},
6730 - {0x0000b0ac, 0x00000000},
6731 - {0x0000b0b0, 0x00000000},
6732 - {0x0000b0b4, 0x00000000},
6733 - {0x0000b0b8, 0x00000000},
6734 - {0x0000b0bc, 0x00000000},
6735 - {0x0000b0c0, 0x003f0020},
6736 - {0x0000b0c4, 0x00400041},
6737 - {0x0000b0c8, 0x0140005f},
6738 - {0x0000b0cc, 0x0160015f},
6739 - {0x0000b0d0, 0x017e017f},
6740 - {0x0000b0d4, 0x02410242},
6741 - {0x0000b0d8, 0x025f0240},
6742 - {0x0000b0dc, 0x027f0260},
6743 - {0x0000b0e0, 0x0341027e},
6744 - {0x0000b0e4, 0x035f0340},
6745 - {0x0000b0e8, 0x037f0360},
6746 - {0x0000b0ec, 0x04400441},
6747 - {0x0000b0f0, 0x0460045f},
6748 - {0x0000b0f4, 0x0541047f},
6749 - {0x0000b0f8, 0x055f0540},
6750 - {0x0000b0fc, 0x057f0560},
6751 - {0x0000b100, 0x06400641},
6752 - {0x0000b104, 0x0660065f},
6753 - {0x0000b108, 0x067e067f},
6754 - {0x0000b10c, 0x07410742},
6755 - {0x0000b110, 0x075f0740},
6756 - {0x0000b114, 0x077f0760},
6757 - {0x0000b118, 0x07800781},
6758 - {0x0000b11c, 0x07a0079f},
6759 - {0x0000b120, 0x07c107bf},
6760 - {0x0000b124, 0x000007c0},
6761 - {0x0000b128, 0x00000000},
6762 - {0x0000b12c, 0x00000000},
6763 - {0x0000b130, 0x00000000},
6764 - {0x0000b134, 0x00000000},
6765 - {0x0000b138, 0x00000000},
6766 - {0x0000b13c, 0x00000000},
6767 - {0x0000b140, 0x003f0020},
6768 - {0x0000b144, 0x00400041},
6769 - {0x0000b148, 0x0140005f},
6770 - {0x0000b14c, 0x0160015f},
6771 - {0x0000b150, 0x017e017f},
6772 - {0x0000b154, 0x02410242},
6773 - {0x0000b158, 0x025f0240},
6774 - {0x0000b15c, 0x027f0260},
6775 - {0x0000b160, 0x0341027e},
6776 - {0x0000b164, 0x035f0340},
6777 - {0x0000b168, 0x037f0360},
6778 - {0x0000b16c, 0x04400441},
6779 - {0x0000b170, 0x0460045f},
6780 - {0x0000b174, 0x0541047f},
6781 - {0x0000b178, 0x055f0540},
6782 - {0x0000b17c, 0x057f0560},
6783 - {0x0000b180, 0x06400641},
6784 - {0x0000b184, 0x0660065f},
6785 - {0x0000b188, 0x067e067f},
6786 - {0x0000b18c, 0x07410742},
6787 - {0x0000b190, 0x075f0740},
6788 - {0x0000b194, 0x077f0760},
6789 - {0x0000b198, 0x07800781},
6790 - {0x0000b19c, 0x07a0079f},
6791 - {0x0000b1a0, 0x07c107bf},
6792 - {0x0000b1a4, 0x000007c0},
6793 - {0x0000b1a8, 0x00000000},
6794 - {0x0000b1ac, 0x00000000},
6795 - {0x0000b1b0, 0x00000000},
6796 - {0x0000b1b4, 0x00000000},
6797 - {0x0000b1b8, 0x00000000},
6798 - {0x0000b1bc, 0x00000000},
6799 - {0x0000b1c0, 0x00000000},
6800 - {0x0000b1c4, 0x00000000},
6801 - {0x0000b1c8, 0x00000000},
6802 - {0x0000b1cc, 0x00000000},
6803 - {0x0000b1d0, 0x00000000},
6804 - {0x0000b1d4, 0x00000000},
6805 - {0x0000b1d8, 0x00000000},
6806 - {0x0000b1dc, 0x00000000},
6807 - {0x0000b1e0, 0x00000000},
6808 - {0x0000b1e4, 0x00000000},
6809 - {0x0000b1e8, 0x00000000},
6810 - {0x0000b1ec, 0x00000000},
6811 - {0x0000b1f0, 0x00000396},
6812 - {0x0000b1f4, 0x00000396},
6813 - {0x0000b1f8, 0x00000396},
6814 - {0x0000b1fc, 0x00000196},
6817 -static const u32 ar9462_2p1_common_mixed_rx_gain[][2] = {
6818 - /* Addr allmodes */
6819 - {0x0000a000, 0x00010000},
6820 - {0x0000a004, 0x00030002},
6821 - {0x0000a008, 0x00050004},
6822 - {0x0000a00c, 0x00810080},
6823 - {0x0000a010, 0x00830082},
6824 - {0x0000a014, 0x01810180},
6825 - {0x0000a018, 0x01830182},
6826 - {0x0000a01c, 0x01850184},
6827 - {0x0000a020, 0x01890188},
6828 - {0x0000a024, 0x018b018a},
6829 - {0x0000a028, 0x018d018c},
6830 - {0x0000a02c, 0x03820190},
6831 - {0x0000a030, 0x03840383},
6832 - {0x0000a034, 0x03880385},
6833 - {0x0000a038, 0x038a0389},
6834 - {0x0000a03c, 0x038c038b},
6835 - {0x0000a040, 0x0390038d},
6836 - {0x0000a044, 0x03920391},
6837 - {0x0000a048, 0x03940393},
6838 - {0x0000a04c, 0x03960395},
6839 - {0x0000a050, 0x00000000},
6840 - {0x0000a054, 0x00000000},
6841 - {0x0000a058, 0x00000000},
6842 - {0x0000a05c, 0x00000000},
6843 - {0x0000a060, 0x00000000},
6844 - {0x0000a064, 0x00000000},
6845 - {0x0000a068, 0x00000000},
6846 - {0x0000a06c, 0x00000000},
6847 - {0x0000a070, 0x00000000},
6848 - {0x0000a074, 0x00000000},
6849 - {0x0000a078, 0x00000000},
6850 - {0x0000a07c, 0x00000000},
6851 - {0x0000a080, 0x29292929},
6852 - {0x0000a084, 0x29292929},
6853 - {0x0000a088, 0x29292929},
6854 - {0x0000a08c, 0x29292929},
6855 - {0x0000a090, 0x22292929},
6856 - {0x0000a094, 0x1d1d2222},
6857 - {0x0000a098, 0x0c111117},
6858 - {0x0000a09c, 0x00030303},
6859 - {0x0000a0a0, 0x00000000},
6860 - {0x0000a0a4, 0x00000000},
6861 - {0x0000a0a8, 0x00000000},
6862 - {0x0000a0ac, 0x00000000},
6863 - {0x0000a0b0, 0x00000000},
6864 - {0x0000a0b4, 0x00000000},
6865 - {0x0000a0b8, 0x00000000},
6866 - {0x0000a0bc, 0x00000000},
6867 - {0x0000a0c0, 0x001f0000},
6868 - {0x0000a0c4, 0x01000101},
6869 - {0x0000a0c8, 0x011e011f},
6870 - {0x0000a0cc, 0x011c011d},
6871 - {0x0000a0d0, 0x02030204},
6872 - {0x0000a0d4, 0x02010202},
6873 - {0x0000a0d8, 0x021f0200},
6874 - {0x0000a0dc, 0x0302021e},
6875 - {0x0000a0e0, 0x03000301},
6876 - {0x0000a0e4, 0x031e031f},
6877 - {0x0000a0e8, 0x0402031d},
6878 - {0x0000a0ec, 0x04000401},
6879 - {0x0000a0f0, 0x041e041f},
6880 - {0x0000a0f4, 0x0502041d},
6881 - {0x0000a0f8, 0x05000501},
6882 - {0x0000a0fc, 0x051e051f},
6883 - {0x0000a100, 0x06010602},
6884 - {0x0000a104, 0x061f0600},
6885 - {0x0000a108, 0x061d061e},
6886 - {0x0000a10c, 0x07020703},
6887 - {0x0000a110, 0x07000701},
6888 - {0x0000a114, 0x00000000},
6889 - {0x0000a118, 0x00000000},
6890 - {0x0000a11c, 0x00000000},
6891 - {0x0000a120, 0x00000000},
6892 - {0x0000a124, 0x00000000},
6893 - {0x0000a128, 0x00000000},
6894 - {0x0000a12c, 0x00000000},
6895 - {0x0000a130, 0x00000000},
6896 - {0x0000a134, 0x00000000},
6897 - {0x0000a138, 0x00000000},
6898 - {0x0000a13c, 0x00000000},
6899 - {0x0000a140, 0x001f0000},
6900 - {0x0000a144, 0x01000101},
6901 - {0x0000a148, 0x011e011f},
6902 - {0x0000a14c, 0x011c011d},
6903 - {0x0000a150, 0x02030204},
6904 - {0x0000a154, 0x02010202},
6905 - {0x0000a158, 0x021f0200},
6906 - {0x0000a15c, 0x0302021e},
6907 - {0x0000a160, 0x03000301},
6908 - {0x0000a164, 0x031e031f},
6909 - {0x0000a168, 0x0402031d},
6910 - {0x0000a16c, 0x04000401},
6911 - {0x0000a170, 0x041e041f},
6912 - {0x0000a174, 0x0502041d},
6913 - {0x0000a178, 0x05000501},
6914 - {0x0000a17c, 0x051e051f},
6915 - {0x0000a180, 0x06010602},
6916 - {0x0000a184, 0x061f0600},
6917 - {0x0000a188, 0x061d061e},
6918 - {0x0000a18c, 0x07020703},
6919 - {0x0000a190, 0x07000701},
6920 - {0x0000a194, 0x00000000},
6921 - {0x0000a198, 0x00000000},
6922 - {0x0000a19c, 0x00000000},
6923 - {0x0000a1a0, 0x00000000},
6924 - {0x0000a1a4, 0x00000000},
6925 - {0x0000a1a8, 0x00000000},
6926 - {0x0000a1ac, 0x00000000},
6927 - {0x0000a1b0, 0x00000000},
6928 - {0x0000a1b4, 0x00000000},
6929 - {0x0000a1b8, 0x00000000},
6930 - {0x0000a1bc, 0x00000000},
6931 - {0x0000a1c0, 0x00000000},
6932 - {0x0000a1c4, 0x00000000},
6933 - {0x0000a1c8, 0x00000000},
6934 - {0x0000a1cc, 0x00000000},
6935 - {0x0000a1d0, 0x00000000},
6936 - {0x0000a1d4, 0x00000000},
6937 - {0x0000a1d8, 0x00000000},
6938 - {0x0000a1dc, 0x00000000},
6939 - {0x0000a1e0, 0x00000000},
6940 - {0x0000a1e4, 0x00000000},
6941 - {0x0000a1e8, 0x00000000},
6942 - {0x0000a1ec, 0x00000000},
6943 - {0x0000a1f0, 0x00000396},
6944 - {0x0000a1f4, 0x00000396},
6945 - {0x0000a1f8, 0x00000396},
6946 - {0x0000a1fc, 0x00000196},
6947 - {0x0000b000, 0x00010000},
6948 - {0x0000b004, 0x00030002},
6949 - {0x0000b008, 0x00050004},
6950 - {0x0000b00c, 0x00810080},
6951 - {0x0000b010, 0x00830082},
6952 - {0x0000b014, 0x01810180},
6953 - {0x0000b018, 0x01830182},
6954 - {0x0000b01c, 0x01850184},
6955 - {0x0000b020, 0x02810280},
6956 - {0x0000b024, 0x02830282},
6957 - {0x0000b028, 0x02850284},
6958 - {0x0000b02c, 0x02890288},
6959 - {0x0000b030, 0x028b028a},
6960 - {0x0000b034, 0x0388028c},
6961 - {0x0000b038, 0x038a0389},
6962 - {0x0000b03c, 0x038c038b},
6963 - {0x0000b040, 0x0390038d},
6964 - {0x0000b044, 0x03920391},
6965 - {0x0000b048, 0x03940393},
6966 - {0x0000b04c, 0x03960395},
6967 - {0x0000b050, 0x00000000},
6968 - {0x0000b054, 0x00000000},
6969 - {0x0000b058, 0x00000000},
6970 - {0x0000b05c, 0x00000000},
6971 - {0x0000b060, 0x00000000},
6972 - {0x0000b064, 0x00000000},
6973 - {0x0000b068, 0x00000000},
6974 - {0x0000b06c, 0x00000000},
6975 - {0x0000b070, 0x00000000},
6976 - {0x0000b074, 0x00000000},
6977 - {0x0000b078, 0x00000000},
6978 - {0x0000b07c, 0x00000000},
6979 - {0x0000b080, 0x2a2d2f32},
6980 - {0x0000b084, 0x21232328},
6981 - {0x0000b088, 0x19191c1e},
6982 - {0x0000b08c, 0x12141417},
6983 - {0x0000b090, 0x07070e0e},
6984 - {0x0000b094, 0x03030305},
6985 - {0x0000b098, 0x00000003},
6986 - {0x0000b09c, 0x00000000},
6987 - {0x0000b0a0, 0x00000000},
6988 - {0x0000b0a4, 0x00000000},
6989 - {0x0000b0a8, 0x00000000},
6990 - {0x0000b0ac, 0x00000000},
6991 - {0x0000b0b0, 0x00000000},
6992 - {0x0000b0b4, 0x00000000},
6993 - {0x0000b0b8, 0x00000000},
6994 - {0x0000b0bc, 0x00000000},
6995 - {0x0000b0c0, 0x003f0020},
6996 - {0x0000b0c4, 0x00400041},
6997 - {0x0000b0c8, 0x0140005f},
6998 - {0x0000b0cc, 0x0160015f},
6999 - {0x0000b0d0, 0x017e017f},
7000 - {0x0000b0d4, 0x02410242},
7001 - {0x0000b0d8, 0x025f0240},
7002 - {0x0000b0dc, 0x027f0260},
7003 - {0x0000b0e0, 0x0341027e},
7004 - {0x0000b0e4, 0x035f0340},
7005 - {0x0000b0e8, 0x037f0360},
7006 - {0x0000b0ec, 0x04400441},
7007 - {0x0000b0f0, 0x0460045f},
7008 - {0x0000b0f4, 0x0541047f},
7009 - {0x0000b0f8, 0x055f0540},
7010 - {0x0000b0fc, 0x057f0560},
7011 - {0x0000b100, 0x06400641},
7012 - {0x0000b104, 0x0660065f},
7013 - {0x0000b108, 0x067e067f},
7014 - {0x0000b10c, 0x07410742},
7015 - {0x0000b110, 0x075f0740},
7016 - {0x0000b114, 0x077f0760},
7017 - {0x0000b118, 0x07800781},
7018 - {0x0000b11c, 0x07a0079f},
7019 - {0x0000b120, 0x07c107bf},
7020 - {0x0000b124, 0x000007c0},
7021 - {0x0000b128, 0x00000000},
7022 - {0x0000b12c, 0x00000000},
7023 - {0x0000b130, 0x00000000},
7024 - {0x0000b134, 0x00000000},
7025 - {0x0000b138, 0x00000000},
7026 - {0x0000b13c, 0x00000000},
7027 - {0x0000b140, 0x003f0020},
7028 - {0x0000b144, 0x00400041},
7029 - {0x0000b148, 0x0140005f},
7030 - {0x0000b14c, 0x0160015f},
7031 - {0x0000b150, 0x017e017f},
7032 - {0x0000b154, 0x02410242},
7033 - {0x0000b158, 0x025f0240},
7034 - {0x0000b15c, 0x027f0260},
7035 - {0x0000b160, 0x0341027e},
7036 - {0x0000b164, 0x035f0340},
7037 - {0x0000b168, 0x037f0360},
7038 - {0x0000b16c, 0x04400441},
7039 - {0x0000b170, 0x0460045f},
7040 - {0x0000b174, 0x0541047f},
7041 - {0x0000b178, 0x055f0540},
7042 - {0x0000b17c, 0x057f0560},
7043 - {0x0000b180, 0x06400641},
7044 - {0x0000b184, 0x0660065f},
7045 - {0x0000b188, 0x067e067f},
7046 - {0x0000b18c, 0x07410742},
7047 - {0x0000b190, 0x075f0740},
7048 - {0x0000b194, 0x077f0760},
7049 - {0x0000b198, 0x07800781},
7050 - {0x0000b19c, 0x07a0079f},
7051 - {0x0000b1a0, 0x07c107bf},
7052 - {0x0000b1a4, 0x000007c0},
7053 - {0x0000b1a8, 0x00000000},
7054 - {0x0000b1ac, 0x00000000},
7055 - {0x0000b1b0, 0x00000000},
7056 - {0x0000b1b4, 0x00000000},
7057 - {0x0000b1b8, 0x00000000},
7058 - {0x0000b1bc, 0x00000000},
7059 - {0x0000b1c0, 0x00000000},
7060 - {0x0000b1c4, 0x00000000},
7061 - {0x0000b1c8, 0x00000000},
7062 - {0x0000b1cc, 0x00000000},
7063 - {0x0000b1d0, 0x00000000},
7064 - {0x0000b1d4, 0x00000000},
7065 - {0x0000b1d8, 0x00000000},
7066 - {0x0000b1dc, 0x00000000},
7067 - {0x0000b1e0, 0x00000000},
7068 - {0x0000b1e4, 0x00000000},
7069 - {0x0000b1e8, 0x00000000},
7070 - {0x0000b1ec, 0x00000000},
7071 - {0x0000b1f0, 0x00000396},
7072 - {0x0000b1f4, 0x00000396},
7073 - {0x0000b1f8, 0x00000396},
7074 - {0x0000b1fc, 0x00000196},
7077 -static const u32 ar9462_2p1_baseband_core_mix_rxgain[][2] = {
7078 - /* Addr allmodes */
7079 - {0x00009fd0, 0x0a2d6b93},
7082 -static const u32 ar9462_2p1_baseband_postamble_mix_rxgain[][5] = {
7083 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7084 - {0x00009820, 0x206a022e, 0x206a022e, 0x206a01ae, 0x206a01ae},
7085 - {0x00009824, 0x63c640de, 0x5ac640d0, 0x63c640da, 0x63c640da},
7086 - {0x00009828, 0x0796be89, 0x0696b081, 0x0916be81, 0x0916be81},
7087 - {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000d8, 0x6c4000d8},
7088 - {0x00009e10, 0x92c88d2e, 0x7ec88d2e, 0x7ec86d2e, 0x7ec86d2e},
7089 - {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32395c5e},
7092 -static const u32 ar9462_2p1_baseband_postamble_5g_xlna[][5] = {
7093 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7094 - {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
7097 -static const u32 ar9462_2p1_common_wo_xlna_rx_gain[][2] = {
7098 - /* Addr allmodes */
7099 - {0x0000a000, 0x00010000},
7100 - {0x0000a004, 0x00030002},
7101 - {0x0000a008, 0x00050004},
7102 - {0x0000a00c, 0x00810080},
7103 - {0x0000a010, 0x00830082},
7104 - {0x0000a014, 0x01810180},
7105 - {0x0000a018, 0x01830182},
7106 - {0x0000a01c, 0x01850184},
7107 - {0x0000a020, 0x01890188},
7108 - {0x0000a024, 0x018b018a},
7109 - {0x0000a028, 0x018d018c},
7110 - {0x0000a02c, 0x03820190},
7111 - {0x0000a030, 0x03840383},
7112 - {0x0000a034, 0x03880385},
7113 - {0x0000a038, 0x038a0389},
7114 - {0x0000a03c, 0x038c038b},
7115 - {0x0000a040, 0x0390038d},
7116 - {0x0000a044, 0x03920391},
7117 - {0x0000a048, 0x03940393},
7118 - {0x0000a04c, 0x03960395},
7119 - {0x0000a050, 0x00000000},
7120 - {0x0000a054, 0x00000000},
7121 - {0x0000a058, 0x00000000},
7122 - {0x0000a05c, 0x00000000},
7123 - {0x0000a060, 0x00000000},
7124 - {0x0000a064, 0x00000000},
7125 - {0x0000a068, 0x00000000},
7126 - {0x0000a06c, 0x00000000},
7127 - {0x0000a070, 0x00000000},
7128 - {0x0000a074, 0x00000000},
7129 - {0x0000a078, 0x00000000},
7130 - {0x0000a07c, 0x00000000},
7131 - {0x0000a080, 0x29292929},
7132 - {0x0000a084, 0x29292929},
7133 - {0x0000a088, 0x29292929},
7134 - {0x0000a08c, 0x29292929},
7135 - {0x0000a090, 0x22292929},
7136 - {0x0000a094, 0x1d1d2222},
7137 - {0x0000a098, 0x0c111117},
7138 - {0x0000a09c, 0x00030303},
7139 - {0x0000a0a0, 0x00000000},
7140 - {0x0000a0a4, 0x00000000},
7141 - {0x0000a0a8, 0x00000000},
7142 - {0x0000a0ac, 0x00000000},
7143 - {0x0000a0b0, 0x00000000},
7144 - {0x0000a0b4, 0x00000000},
7145 - {0x0000a0b8, 0x00000000},
7146 - {0x0000a0bc, 0x00000000},
7147 - {0x0000a0c0, 0x001f0000},
7148 - {0x0000a0c4, 0x01000101},
7149 - {0x0000a0c8, 0x011e011f},
7150 - {0x0000a0cc, 0x011c011d},
7151 - {0x0000a0d0, 0x02030204},
7152 - {0x0000a0d4, 0x02010202},
7153 - {0x0000a0d8, 0x021f0200},
7154 - {0x0000a0dc, 0x0302021e},
7155 - {0x0000a0e0, 0x03000301},
7156 - {0x0000a0e4, 0x031e031f},
7157 - {0x0000a0e8, 0x0402031d},
7158 - {0x0000a0ec, 0x04000401},
7159 - {0x0000a0f0, 0x041e041f},
7160 - {0x0000a0f4, 0x0502041d},
7161 - {0x0000a0f8, 0x05000501},
7162 - {0x0000a0fc, 0x051e051f},
7163 - {0x0000a100, 0x06010602},
7164 - {0x0000a104, 0x061f0600},
7165 - {0x0000a108, 0x061d061e},
7166 - {0x0000a10c, 0x07020703},
7167 - {0x0000a110, 0x07000701},
7168 - {0x0000a114, 0x00000000},
7169 - {0x0000a118, 0x00000000},
7170 - {0x0000a11c, 0x00000000},
7171 - {0x0000a120, 0x00000000},
7172 - {0x0000a124, 0x00000000},
7173 - {0x0000a128, 0x00000000},
7174 - {0x0000a12c, 0x00000000},
7175 - {0x0000a130, 0x00000000},
7176 - {0x0000a134, 0x00000000},
7177 - {0x0000a138, 0x00000000},
7178 - {0x0000a13c, 0x00000000},
7179 - {0x0000a140, 0x001f0000},
7180 - {0x0000a144, 0x01000101},
7181 - {0x0000a148, 0x011e011f},
7182 - {0x0000a14c, 0x011c011d},
7183 - {0x0000a150, 0x02030204},
7184 - {0x0000a154, 0x02010202},
7185 - {0x0000a158, 0x021f0200},
7186 - {0x0000a15c, 0x0302021e},
7187 - {0x0000a160, 0x03000301},
7188 - {0x0000a164, 0x031e031f},
7189 - {0x0000a168, 0x0402031d},
7190 - {0x0000a16c, 0x04000401},
7191 - {0x0000a170, 0x041e041f},
7192 - {0x0000a174, 0x0502041d},
7193 - {0x0000a178, 0x05000501},
7194 - {0x0000a17c, 0x051e051f},
7195 - {0x0000a180, 0x06010602},
7196 - {0x0000a184, 0x061f0600},
7197 - {0x0000a188, 0x061d061e},
7198 - {0x0000a18c, 0x07020703},
7199 - {0x0000a190, 0x07000701},
7200 - {0x0000a194, 0x00000000},
7201 - {0x0000a198, 0x00000000},
7202 - {0x0000a19c, 0x00000000},
7203 - {0x0000a1a0, 0x00000000},
7204 - {0x0000a1a4, 0x00000000},
7205 - {0x0000a1a8, 0x00000000},
7206 - {0x0000a1ac, 0x00000000},
7207 - {0x0000a1b0, 0x00000000},
7208 - {0x0000a1b4, 0x00000000},
7209 - {0x0000a1b8, 0x00000000},
7210 - {0x0000a1bc, 0x00000000},
7211 - {0x0000a1c0, 0x00000000},
7212 - {0x0000a1c4, 0x00000000},
7213 - {0x0000a1c8, 0x00000000},
7214 - {0x0000a1cc, 0x00000000},
7215 - {0x0000a1d0, 0x00000000},
7216 - {0x0000a1d4, 0x00000000},
7217 - {0x0000a1d8, 0x00000000},
7218 - {0x0000a1dc, 0x00000000},
7219 - {0x0000a1e0, 0x00000000},
7220 - {0x0000a1e4, 0x00000000},
7221 - {0x0000a1e8, 0x00000000},
7222 - {0x0000a1ec, 0x00000000},
7223 - {0x0000a1f0, 0x00000396},
7224 - {0x0000a1f4, 0x00000396},
7225 - {0x0000a1f8, 0x00000396},
7226 - {0x0000a1fc, 0x00000196},
7227 - {0x0000b000, 0x00010000},
7228 - {0x0000b004, 0x00030002},
7229 - {0x0000b008, 0x00050004},
7230 - {0x0000b00c, 0x00810080},
7231 - {0x0000b010, 0x00830082},
7232 - {0x0000b014, 0x01810180},
7233 - {0x0000b018, 0x01830182},
7234 - {0x0000b01c, 0x01850184},
7235 - {0x0000b020, 0x02810280},
7236 - {0x0000b024, 0x02830282},
7237 - {0x0000b028, 0x02850284},
7238 - {0x0000b02c, 0x02890288},
7239 - {0x0000b030, 0x028b028a},
7240 - {0x0000b034, 0x0388028c},
7241 - {0x0000b038, 0x038a0389},
7242 - {0x0000b03c, 0x038c038b},
7243 - {0x0000b040, 0x0390038d},
7244 - {0x0000b044, 0x03920391},
7245 - {0x0000b048, 0x03940393},
7246 - {0x0000b04c, 0x03960395},
7247 - {0x0000b050, 0x00000000},
7248 - {0x0000b054, 0x00000000},
7249 - {0x0000b058, 0x00000000},
7250 - {0x0000b05c, 0x00000000},
7251 - {0x0000b060, 0x00000000},
7252 - {0x0000b064, 0x00000000},
7253 - {0x0000b068, 0x00000000},
7254 - {0x0000b06c, 0x00000000},
7255 - {0x0000b070, 0x00000000},
7256 - {0x0000b074, 0x00000000},
7257 - {0x0000b078, 0x00000000},
7258 - {0x0000b07c, 0x00000000},
7259 - {0x0000b080, 0x32323232},
7260 - {0x0000b084, 0x2f2f3232},
7261 - {0x0000b088, 0x23282a2d},
7262 - {0x0000b08c, 0x1c1e2123},
7263 - {0x0000b090, 0x14171919},
7264 - {0x0000b094, 0x0e0e1214},
7265 - {0x0000b098, 0x03050707},
7266 - {0x0000b09c, 0x00030303},
7267 - {0x0000b0a0, 0x00000000},
7268 - {0x0000b0a4, 0x00000000},
7269 - {0x0000b0a8, 0x00000000},
7270 - {0x0000b0ac, 0x00000000},
7271 - {0x0000b0b0, 0x00000000},
7272 - {0x0000b0b4, 0x00000000},
7273 - {0x0000b0b8, 0x00000000},
7274 - {0x0000b0bc, 0x00000000},
7275 - {0x0000b0c0, 0x003f0020},
7276 - {0x0000b0c4, 0x00400041},
7277 - {0x0000b0c8, 0x0140005f},
7278 - {0x0000b0cc, 0x0160015f},
7279 - {0x0000b0d0, 0x017e017f},
7280 - {0x0000b0d4, 0x02410242},
7281 - {0x0000b0d8, 0x025f0240},
7282 - {0x0000b0dc, 0x027f0260},
7283 - {0x0000b0e0, 0x0341027e},
7284 - {0x0000b0e4, 0x035f0340},
7285 - {0x0000b0e8, 0x037f0360},
7286 - {0x0000b0ec, 0x04400441},
7287 - {0x0000b0f0, 0x0460045f},
7288 - {0x0000b0f4, 0x0541047f},
7289 - {0x0000b0f8, 0x055f0540},
7290 - {0x0000b0fc, 0x057f0560},
7291 - {0x0000b100, 0x06400641},
7292 - {0x0000b104, 0x0660065f},
7293 - {0x0000b108, 0x067e067f},
7294 - {0x0000b10c, 0x07410742},
7295 - {0x0000b110, 0x075f0740},
7296 - {0x0000b114, 0x077f0760},
7297 - {0x0000b118, 0x07800781},
7298 - {0x0000b11c, 0x07a0079f},
7299 - {0x0000b120, 0x07c107bf},
7300 - {0x0000b124, 0x000007c0},
7301 - {0x0000b128, 0x00000000},
7302 - {0x0000b12c, 0x00000000},
7303 - {0x0000b130, 0x00000000},
7304 - {0x0000b134, 0x00000000},
7305 - {0x0000b138, 0x00000000},
7306 - {0x0000b13c, 0x00000000},
7307 - {0x0000b140, 0x003f0020},
7308 - {0x0000b144, 0x00400041},
7309 - {0x0000b148, 0x0140005f},
7310 - {0x0000b14c, 0x0160015f},
7311 - {0x0000b150, 0x017e017f},
7312 - {0x0000b154, 0x02410242},
7313 - {0x0000b158, 0x025f0240},
7314 - {0x0000b15c, 0x027f0260},
7315 - {0x0000b160, 0x0341027e},
7316 - {0x0000b164, 0x035f0340},
7317 - {0x0000b168, 0x037f0360},
7318 - {0x0000b16c, 0x04400441},
7319 - {0x0000b170, 0x0460045f},
7320 - {0x0000b174, 0x0541047f},
7321 - {0x0000b178, 0x055f0540},
7322 - {0x0000b17c, 0x057f0560},
7323 - {0x0000b180, 0x06400641},
7324 - {0x0000b184, 0x0660065f},
7325 - {0x0000b188, 0x067e067f},
7326 - {0x0000b18c, 0x07410742},
7327 - {0x0000b190, 0x075f0740},
7328 - {0x0000b194, 0x077f0760},
7329 - {0x0000b198, 0x07800781},
7330 - {0x0000b19c, 0x07a0079f},
7331 - {0x0000b1a0, 0x07c107bf},
7332 - {0x0000b1a4, 0x000007c0},
7333 - {0x0000b1a8, 0x00000000},
7334 - {0x0000b1ac, 0x00000000},
7335 - {0x0000b1b0, 0x00000000},
7336 - {0x0000b1b4, 0x00000000},
7337 - {0x0000b1b8, 0x00000000},
7338 - {0x0000b1bc, 0x00000000},
7339 - {0x0000b1c0, 0x00000000},
7340 - {0x0000b1c4, 0x00000000},
7341 - {0x0000b1c8, 0x00000000},
7342 - {0x0000b1cc, 0x00000000},
7343 - {0x0000b1d0, 0x00000000},
7344 - {0x0000b1d4, 0x00000000},
7345 - {0x0000b1d8, 0x00000000},
7346 - {0x0000b1dc, 0x00000000},
7347 - {0x0000b1e0, 0x00000000},
7348 - {0x0000b1e4, 0x00000000},
7349 - {0x0000b1e8, 0x00000000},
7350 - {0x0000b1ec, 0x00000000},
7351 - {0x0000b1f0, 0x00000396},
7352 - {0x0000b1f4, 0x00000396},
7353 - {0x0000b1f8, 0x00000396},
7354 - {0x0000b1fc, 0x00000196},
7357 -static const u32 ar9462_2p1_common_5g_xlna_only_rx_gain[][2] = {
7358 - /* Addr allmodes */
7359 - {0x0000a000, 0x00010000},
7360 - {0x0000a004, 0x00030002},
7361 - {0x0000a008, 0x00050004},
7362 - {0x0000a00c, 0x00810080},
7363 - {0x0000a010, 0x00830082},
7364 - {0x0000a014, 0x01810180},
7365 - {0x0000a018, 0x01830182},
7366 - {0x0000a01c, 0x01850184},
7367 - {0x0000a020, 0x01890188},
7368 - {0x0000a024, 0x018b018a},
7369 - {0x0000a028, 0x018d018c},
7370 - {0x0000a02c, 0x03820190},
7371 - {0x0000a030, 0x03840383},
7372 - {0x0000a034, 0x03880385},
7373 - {0x0000a038, 0x038a0389},
7374 - {0x0000a03c, 0x038c038b},
7375 - {0x0000a040, 0x0390038d},
7376 - {0x0000a044, 0x03920391},
7377 - {0x0000a048, 0x03940393},
7378 - {0x0000a04c, 0x03960395},
7379 - {0x0000a050, 0x00000000},
7380 - {0x0000a054, 0x00000000},
7381 - {0x0000a058, 0x00000000},
7382 - {0x0000a05c, 0x00000000},
7383 - {0x0000a060, 0x00000000},
7384 - {0x0000a064, 0x00000000},
7385 - {0x0000a068, 0x00000000},
7386 - {0x0000a06c, 0x00000000},
7387 - {0x0000a070, 0x00000000},
7388 - {0x0000a074, 0x00000000},
7389 - {0x0000a078, 0x00000000},
7390 - {0x0000a07c, 0x00000000},
7391 - {0x0000a080, 0x29292929},
7392 - {0x0000a084, 0x29292929},
7393 - {0x0000a088, 0x29292929},
7394 - {0x0000a08c, 0x29292929},
7395 - {0x0000a090, 0x22292929},
7396 - {0x0000a094, 0x1d1d2222},
7397 - {0x0000a098, 0x0c111117},
7398 - {0x0000a09c, 0x00030303},
7399 - {0x0000a0a0, 0x00000000},
7400 - {0x0000a0a4, 0x00000000},
7401 - {0x0000a0a8, 0x00000000},
7402 - {0x0000a0ac, 0x00000000},
7403 - {0x0000a0b0, 0x00000000},
7404 - {0x0000a0b4, 0x00000000},
7405 - {0x0000a0b8, 0x00000000},
7406 - {0x0000a0bc, 0x00000000},
7407 - {0x0000a0c0, 0x001f0000},
7408 - {0x0000a0c4, 0x01000101},
7409 - {0x0000a0c8, 0x011e011f},
7410 - {0x0000a0cc, 0x011c011d},
7411 - {0x0000a0d0, 0x02030204},
7412 - {0x0000a0d4, 0x02010202},
7413 - {0x0000a0d8, 0x021f0200},
7414 - {0x0000a0dc, 0x0302021e},
7415 - {0x0000a0e0, 0x03000301},
7416 - {0x0000a0e4, 0x031e031f},
7417 - {0x0000a0e8, 0x0402031d},
7418 - {0x0000a0ec, 0x04000401},
7419 - {0x0000a0f0, 0x041e041f},
7420 - {0x0000a0f4, 0x0502041d},
7421 - {0x0000a0f8, 0x05000501},
7422 - {0x0000a0fc, 0x051e051f},
7423 - {0x0000a100, 0x06010602},
7424 - {0x0000a104, 0x061f0600},
7425 - {0x0000a108, 0x061d061e},
7426 - {0x0000a10c, 0x07020703},
7427 - {0x0000a110, 0x07000701},
7428 - {0x0000a114, 0x00000000},
7429 - {0x0000a118, 0x00000000},
7430 - {0x0000a11c, 0x00000000},
7431 - {0x0000a120, 0x00000000},
7432 - {0x0000a124, 0x00000000},
7433 - {0x0000a128, 0x00000000},
7434 - {0x0000a12c, 0x00000000},
7435 - {0x0000a130, 0x00000000},
7436 - {0x0000a134, 0x00000000},
7437 - {0x0000a138, 0x00000000},
7438 - {0x0000a13c, 0x00000000},
7439 - {0x0000a140, 0x001f0000},
7440 - {0x0000a144, 0x01000101},
7441 - {0x0000a148, 0x011e011f},
7442 - {0x0000a14c, 0x011c011d},
7443 - {0x0000a150, 0x02030204},
7444 - {0x0000a154, 0x02010202},
7445 - {0x0000a158, 0x021f0200},
7446 - {0x0000a15c, 0x0302021e},
7447 - {0x0000a160, 0x03000301},
7448 - {0x0000a164, 0x031e031f},
7449 - {0x0000a168, 0x0402031d},
7450 - {0x0000a16c, 0x04000401},
7451 - {0x0000a170, 0x041e041f},
7452 - {0x0000a174, 0x0502041d},
7453 - {0x0000a178, 0x05000501},
7454 - {0x0000a17c, 0x051e051f},
7455 - {0x0000a180, 0x06010602},
7456 - {0x0000a184, 0x061f0600},
7457 - {0x0000a188, 0x061d061e},
7458 - {0x0000a18c, 0x07020703},
7459 - {0x0000a190, 0x07000701},
7460 - {0x0000a194, 0x00000000},
7461 - {0x0000a198, 0x00000000},
7462 - {0x0000a19c, 0x00000000},
7463 - {0x0000a1a0, 0x00000000},
7464 - {0x0000a1a4, 0x00000000},
7465 - {0x0000a1a8, 0x00000000},
7466 - {0x0000a1ac, 0x00000000},
7467 - {0x0000a1b0, 0x00000000},
7468 - {0x0000a1b4, 0x00000000},
7469 - {0x0000a1b8, 0x00000000},
7470 - {0x0000a1bc, 0x00000000},
7471 - {0x0000a1c0, 0x00000000},
7472 - {0x0000a1c4, 0x00000000},
7473 - {0x0000a1c8, 0x00000000},
7474 - {0x0000a1cc, 0x00000000},
7475 - {0x0000a1d0, 0x00000000},
7476 - {0x0000a1d4, 0x00000000},
7477 - {0x0000a1d8, 0x00000000},
7478 - {0x0000a1dc, 0x00000000},
7479 - {0x0000a1e0, 0x00000000},
7480 - {0x0000a1e4, 0x00000000},
7481 - {0x0000a1e8, 0x00000000},
7482 - {0x0000a1ec, 0x00000000},
7483 - {0x0000a1f0, 0x00000396},
7484 - {0x0000a1f4, 0x00000396},
7485 - {0x0000a1f8, 0x00000396},
7486 - {0x0000a1fc, 0x00000196},
7487 - {0x0000b000, 0x00010000},
7488 - {0x0000b004, 0x00030002},
7489 - {0x0000b008, 0x00050004},
7490 - {0x0000b00c, 0x00810080},
7491 - {0x0000b010, 0x00830082},
7492 - {0x0000b014, 0x01810180},
7493 - {0x0000b018, 0x01830182},
7494 - {0x0000b01c, 0x01850184},
7495 - {0x0000b020, 0x02810280},
7496 - {0x0000b024, 0x02830282},
7497 - {0x0000b028, 0x02850284},
7498 - {0x0000b02c, 0x02890288},
7499 - {0x0000b030, 0x028b028a},
7500 - {0x0000b034, 0x0388028c},
7501 - {0x0000b038, 0x038a0389},
7502 - {0x0000b03c, 0x038c038b},
7503 - {0x0000b040, 0x0390038d},
7504 - {0x0000b044, 0x03920391},
7505 - {0x0000b048, 0x03940393},
7506 - {0x0000b04c, 0x03960395},
7507 - {0x0000b050, 0x00000000},
7508 - {0x0000b054, 0x00000000},
7509 - {0x0000b058, 0x00000000},
7510 - {0x0000b05c, 0x00000000},
7511 - {0x0000b060, 0x00000000},
7512 - {0x0000b064, 0x00000000},
7513 - {0x0000b068, 0x00000000},
7514 - {0x0000b06c, 0x00000000},
7515 - {0x0000b070, 0x00000000},
7516 - {0x0000b074, 0x00000000},
7517 - {0x0000b078, 0x00000000},
7518 - {0x0000b07c, 0x00000000},
7519 - {0x0000b080, 0x2a2d2f32},
7520 - {0x0000b084, 0x21232328},
7521 - {0x0000b088, 0x19191c1e},
7522 - {0x0000b08c, 0x12141417},
7523 - {0x0000b090, 0x07070e0e},
7524 - {0x0000b094, 0x03030305},
7525 - {0x0000b098, 0x00000003},
7526 - {0x0000b09c, 0x00000000},
7527 - {0x0000b0a0, 0x00000000},
7528 - {0x0000b0a4, 0x00000000},
7529 - {0x0000b0a8, 0x00000000},
7530 - {0x0000b0ac, 0x00000000},
7531 - {0x0000b0b0, 0x00000000},
7532 - {0x0000b0b4, 0x00000000},
7533 - {0x0000b0b8, 0x00000000},
7534 - {0x0000b0bc, 0x00000000},
7535 - {0x0000b0c0, 0x003f0020},
7536 - {0x0000b0c4, 0x00400041},
7537 - {0x0000b0c8, 0x0140005f},
7538 - {0x0000b0cc, 0x0160015f},
7539 - {0x0000b0d0, 0x017e017f},
7540 - {0x0000b0d4, 0x02410242},
7541 - {0x0000b0d8, 0x025f0240},
7542 - {0x0000b0dc, 0x027f0260},
7543 - {0x0000b0e0, 0x0341027e},
7544 - {0x0000b0e4, 0x035f0340},
7545 - {0x0000b0e8, 0x037f0360},
7546 - {0x0000b0ec, 0x04400441},
7547 - {0x0000b0f0, 0x0460045f},
7548 - {0x0000b0f4, 0x0541047f},
7549 - {0x0000b0f8, 0x055f0540},
7550 - {0x0000b0fc, 0x057f0560},
7551 - {0x0000b100, 0x06400641},
7552 - {0x0000b104, 0x0660065f},
7553 - {0x0000b108, 0x067e067f},
7554 - {0x0000b10c, 0x07410742},
7555 - {0x0000b110, 0x075f0740},
7556 - {0x0000b114, 0x077f0760},
7557 - {0x0000b118, 0x07800781},
7558 - {0x0000b11c, 0x07a0079f},
7559 - {0x0000b120, 0x07c107bf},
7560 - {0x0000b124, 0x000007c0},
7561 - {0x0000b128, 0x00000000},
7562 - {0x0000b12c, 0x00000000},
7563 - {0x0000b130, 0x00000000},
7564 - {0x0000b134, 0x00000000},
7565 - {0x0000b138, 0x00000000},
7566 - {0x0000b13c, 0x00000000},
7567 - {0x0000b140, 0x003f0020},
7568 - {0x0000b144, 0x00400041},
7569 - {0x0000b148, 0x0140005f},
7570 - {0x0000b14c, 0x0160015f},
7571 - {0x0000b150, 0x017e017f},
7572 - {0x0000b154, 0x02410242},
7573 - {0x0000b158, 0x025f0240},
7574 - {0x0000b15c, 0x027f0260},
7575 - {0x0000b160, 0x0341027e},
7576 - {0x0000b164, 0x035f0340},
7577 - {0x0000b168, 0x037f0360},
7578 - {0x0000b16c, 0x04400441},
7579 - {0x0000b170, 0x0460045f},
7580 - {0x0000b174, 0x0541047f},
7581 - {0x0000b178, 0x055f0540},
7582 - {0x0000b17c, 0x057f0560},
7583 - {0x0000b180, 0x06400641},
7584 - {0x0000b184, 0x0660065f},
7585 - {0x0000b188, 0x067e067f},
7586 - {0x0000b18c, 0x07410742},
7587 - {0x0000b190, 0x075f0740},
7588 - {0x0000b194, 0x077f0760},
7589 - {0x0000b198, 0x07800781},
7590 - {0x0000b19c, 0x07a0079f},
7591 - {0x0000b1a0, 0x07c107bf},
7592 - {0x0000b1a4, 0x000007c0},
7593 - {0x0000b1a8, 0x00000000},
7594 - {0x0000b1ac, 0x00000000},
7595 - {0x0000b1b0, 0x00000000},
7596 - {0x0000b1b4, 0x00000000},
7597 - {0x0000b1b8, 0x00000000},
7598 - {0x0000b1bc, 0x00000000},
7599 - {0x0000b1c0, 0x00000000},
7600 - {0x0000b1c4, 0x00000000},
7601 - {0x0000b1c8, 0x00000000},
7602 - {0x0000b1cc, 0x00000000},
7603 - {0x0000b1d0, 0x00000000},
7604 - {0x0000b1d4, 0x00000000},
7605 - {0x0000b1d8, 0x00000000},
7606 - {0x0000b1dc, 0x00000000},
7607 - {0x0000b1e0, 0x00000000},
7608 - {0x0000b1e4, 0x00000000},
7609 - {0x0000b1e8, 0x00000000},
7610 - {0x0000b1ec, 0x00000000},
7611 - {0x0000b1f0, 0x00000396},
7612 - {0x0000b1f4, 0x00000396},
7613 - {0x0000b1f8, 0x00000396},
7614 - {0x0000b1fc, 0x00000196},
7617 -static const u32 ar9462_2p1_modes_low_ob_db_tx_gain[][5] = {
7618 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7619 - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
7620 - {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
7621 - {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
7622 - {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
7623 - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
7624 - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
7625 - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7626 - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7627 - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
7628 - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
7629 - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
7630 - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
7631 - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
7632 - {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
7633 - {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
7634 - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
7635 - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
7636 - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
7637 - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
7638 - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
7639 - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
7640 - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
7641 - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
7642 - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
7643 - {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
7644 - {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
7645 - {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
7646 - {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
7647 - {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
7648 - {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
7649 - {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
7650 - {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
7651 - {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7652 - {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7653 - {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7654 - {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7655 - {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7656 - {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7657 - {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
7658 - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7659 - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7660 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7661 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7662 - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7663 - {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
7664 - {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
7665 - {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
7666 - {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
7667 - {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
7668 - {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
7669 - {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
7670 - {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
7671 - {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
7672 - {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
7673 - {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
7674 - {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
7675 - {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
7676 - {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
7677 - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
7678 - {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
7679 - {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
7680 - {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
7681 - {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
7682 - {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
7683 - {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
7686 -static const u32 ar9462_2p1_modes_high_ob_db_tx_gain[][5] = {
7687 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7688 - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
7689 - {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
7690 - {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
7691 - {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
7692 - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
7693 - {0x0000a410, 0x000050da, 0x000050da, 0x000050de, 0x000050de},
7694 - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7695 - {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
7696 - {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
7697 - {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
7698 - {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
7699 - {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
7700 - {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
7701 - {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
7702 - {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
7703 - {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
7704 - {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
7705 - {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
7706 - {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
7707 - {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
7708 - {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
7709 - {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
7710 - {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
7711 - {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
7712 - {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
7713 - {0x0000a548, 0x55025eb3, 0x55025eb3, 0x3e001a81, 0x3e001a81},
7714 - {0x0000a54c, 0x58025ef3, 0x58025ef3, 0x42001a83, 0x42001a83},
7715 - {0x0000a550, 0x5d025ef6, 0x5d025ef6, 0x44001a84, 0x44001a84},
7716 - {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
7717 - {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
7718 - {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
7719 - {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
7720 - {0x0000a564, 0x751ffff6, 0x751ffff6, 0x56001eec, 0x56001eec},
7721 - {0x0000a568, 0x751ffff6, 0x751ffff6, 0x58001ef0, 0x58001ef0},
7722 - {0x0000a56c, 0x751ffff6, 0x751ffff6, 0x5a001ef4, 0x5a001ef4},
7723 - {0x0000a570, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
7724 - {0x0000a574, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
7725 - {0x0000a578, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
7726 - {0x0000a57c, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
7727 - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7728 - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7729 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7730 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7731 - {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
7732 - {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
7733 - {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
7734 - {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
7735 - {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
7736 - {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
7737 - {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
7738 - {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7739 - {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7740 - {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7741 - {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7742 - {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7743 - {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
7744 - {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
7745 - {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
7746 - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
7747 - {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
7748 - {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
7749 - {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
7750 - {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
7751 - {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
7752 - {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
7755 -static const u32 ar9462_2p1_modes_mix_ob_db_tx_gain[][5] = {
7756 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7757 - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
7758 - {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
7759 - {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
7760 - {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
7761 - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
7762 - {0x0000a410, 0x0000d0da, 0x0000d0da, 0x0000d0de, 0x0000d0de},
7763 - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7764 - {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
7765 - {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
7766 - {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
7767 - {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
7768 - {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
7769 - {0x0000a514, 0x18022622, 0x18022622, 0x12000400, 0x12000400},
7770 - {0x0000a518, 0x1b022822, 0x1b022822, 0x16000402, 0x16000402},
7771 - {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
7772 - {0x0000a520, 0x22022c41, 0x22022c41, 0x1c000603, 0x1c000603},
7773 - {0x0000a524, 0x28023042, 0x28023042, 0x21000a02, 0x21000a02},
7774 - {0x0000a528, 0x2c023044, 0x2c023044, 0x25000a04, 0x25000a04},
7775 - {0x0000a52c, 0x2f023644, 0x2f023644, 0x28000a20, 0x28000a20},
7776 - {0x0000a530, 0x34025643, 0x34025643, 0x2c000e20, 0x2c000e20},
7777 - {0x0000a534, 0x38025a44, 0x38025a44, 0x30000e22, 0x30000e22},
7778 - {0x0000a538, 0x3b025e45, 0x3b025e45, 0x34000e24, 0x34000e24},
7779 - {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x38001640, 0x38001640},
7780 - {0x0000a540, 0x48025e6c, 0x48025e6c, 0x3c001660, 0x3c001660},
7781 - {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3f001861, 0x3f001861},
7782 - {0x0000a548, 0x55025eb3, 0x55025eb3, 0x43001a81, 0x43001a81},
7783 - {0x0000a54c, 0x58025ef3, 0x58025ef3, 0x47001a83, 0x47001a83},
7784 - {0x0000a550, 0x5d025ef6, 0x5d025ef6, 0x4a001c84, 0x4a001c84},
7785 - {0x0000a554, 0x62025f56, 0x62025f56, 0x4e001ce3, 0x4e001ce3},
7786 - {0x0000a558, 0x66027f56, 0x66027f56, 0x52001ce5, 0x52001ce5},
7787 - {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x56001ce9, 0x56001ce9},
7788 - {0x0000a560, 0x70049f56, 0x70049f56, 0x5a001ceb, 0x5a001ceb},
7789 - {0x0000a564, 0x751ffff6, 0x751ffff6, 0x5c001eec, 0x5c001eec},
7790 - {0x0000a568, 0x751ffff6, 0x751ffff6, 0x5e001ef0, 0x5e001ef0},
7791 - {0x0000a56c, 0x751ffff6, 0x751ffff6, 0x60001ef4, 0x60001ef4},
7792 - {0x0000a570, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
7793 - {0x0000a574, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
7794 - {0x0000a578, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
7795 - {0x0000a57c, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
7796 - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7797 - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7798 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7799 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7800 - {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
7801 - {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
7802 - {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
7803 - {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
7804 - {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
7805 - {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
7806 - {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
7807 - {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7808 - {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7809 - {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7810 - {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7811 - {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
7812 - {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
7813 - {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
7814 - {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
7815 - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
7818 -static const u32 ar9462_2p1_modes_fast_clock[][3] = {
7819 - /* Addr 5G_HT20 5G_HT40 */
7820 - {0x00001030, 0x00000268, 0x000004d0},
7821 - {0x00001070, 0x0000018c, 0x00000318},
7822 - {0x000010b0, 0x00000fd0, 0x00001fa0},
7823 - {0x00008014, 0x044c044c, 0x08980898},
7824 - {0x0000801c, 0x148ec02b, 0x148ec057},
7825 - {0x00008318, 0x000044c0, 0x00008980},
7826 - {0x00009e00, 0x0372131c, 0x0372131c},
7827 - {0x0000a230, 0x0000400b, 0x00004016},
7828 - {0x0000a254, 0x00000898, 0x00001130},
7831 -static const u32 ar9462_2p1_baseband_core_txfir_coeff_japan_2484[][2] = {
7832 - /* Addr allmodes */
7833 - {0x0000a398, 0x00000000},
7834 - {0x0000a39c, 0x6f7f0301},
7835 - {0x0000a3a0, 0xca9228ee},
7838 #endif /* INITVALS_9462_2P1_H */
7839 --- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
7840 +++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
7845 -static const u32 ar9485_1_1_mac_postamble[][5] = {
7846 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7847 - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
7848 - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
7849 - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
7850 - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
7851 - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
7852 - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
7853 - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
7854 - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
7856 +#define ar9485_modes_lowest_ob_db_tx_gain_1_1 ar9485Modes_low_ob_db_tx_gain_1_1
7858 -static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = {
7859 - /* Addr allmodes */
7860 - {0x00018c00, 0x18012e5e},
7861 - {0x00018c04, 0x000801d8},
7862 - {0x00018c08, 0x0000080c},
7864 +#define ar9485_1_1_mac_postamble ar9331_1p1_mac_postamble
7866 +#define ar9485_1_1_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
7868 static const u32 ar9485Common_wo_xlna_rx_gain_1_1[][2] = {
7870 @@ -553,100 +540,6 @@ static const u32 ar9485Modes_low_ob_db_t
7871 {0x00016048, 0x6c924260, 0x6c924260, 0x6c924260, 0x6c924260},
7874 -static const u32 ar9485_modes_lowest_ob_db_tx_gain_1_1[][5] = {
7875 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7876 - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
7877 - {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0x7999a83a, 0x7999a83a},
7878 - {0x0000a2dc, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
7879 - {0x0000a2e0, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
7880 - {0x0000a2e4, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
7881 - {0x0000a2e8, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
7882 - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d8, 0x000050d8},
7883 - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7884 - {0x0000a500, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
7885 - {0x0000a504, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
7886 - {0x0000a508, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
7887 - {0x0000a50c, 0x11062202, 0x11062202, 0x0d000200, 0x0d000200},
7888 - {0x0000a510, 0x17022e00, 0x17022e00, 0x11000202, 0x11000202},
7889 - {0x0000a514, 0x1d000ec2, 0x1d000ec2, 0x15000400, 0x15000400},
7890 - {0x0000a518, 0x25020ec0, 0x25020ec0, 0x19000402, 0x19000402},
7891 - {0x0000a51c, 0x2b020ec3, 0x2b020ec3, 0x1d000404, 0x1d000404},
7892 - {0x0000a520, 0x2f001f04, 0x2f001f04, 0x21000603, 0x21000603},
7893 - {0x0000a524, 0x35001fc4, 0x35001fc4, 0x25000605, 0x25000605},
7894 - {0x0000a528, 0x3c022f04, 0x3c022f04, 0x2a000a03, 0x2a000a03},
7895 - {0x0000a52c, 0x41023e85, 0x41023e85, 0x2c000a04, 0x2c000a04},
7896 - {0x0000a530, 0x48023ec6, 0x48023ec6, 0x34000e20, 0x34000e20},
7897 - {0x0000a534, 0x4d023f01, 0x4d023f01, 0x35000e21, 0x35000e21},
7898 - {0x0000a538, 0x53023f4b, 0x53023f4b, 0x43000e62, 0x43000e62},
7899 - {0x0000a53c, 0x5a027f09, 0x5a027f09, 0x45000e63, 0x45000e63},
7900 - {0x0000a540, 0x5f027fc9, 0x5f027fc9, 0x49000e65, 0x49000e65},
7901 - {0x0000a544, 0x6502feca, 0x6502feca, 0x4b000e66, 0x4b000e66},
7902 - {0x0000a548, 0x6b02ff4a, 0x6b02ff4a, 0x4d001645, 0x4d001645},
7903 - {0x0000a54c, 0x7203feca, 0x7203feca, 0x51001865, 0x51001865},
7904 - {0x0000a550, 0x7703ff0b, 0x7703ff0b, 0x55001a86, 0x55001a86},
7905 - {0x0000a554, 0x7d06ffcb, 0x7d06ffcb, 0x57001ce9, 0x57001ce9},
7906 - {0x0000a558, 0x8407ff0b, 0x8407ff0b, 0x5a001ceb, 0x5a001ceb},
7907 - {0x0000a55c, 0x8907ffcb, 0x8907ffcb, 0x5e001eeb, 0x5e001eeb},
7908 - {0x0000a560, 0x900fff0b, 0x900fff0b, 0x5e001eeb, 0x5e001eeb},
7909 - {0x0000a564, 0x960fffcb, 0x960fffcb, 0x5e001eeb, 0x5e001eeb},
7910 - {0x0000a568, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
7911 - {0x0000a56c, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
7912 - {0x0000a570, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
7913 - {0x0000a574, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
7914 - {0x0000a578, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
7915 - {0x0000a57c, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
7916 - {0x0000a580, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7917 - {0x0000a584, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7918 - {0x0000a588, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7919 - {0x0000a58c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7920 - {0x0000a590, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7921 - {0x0000a594, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7922 - {0x0000a598, 0x00000000, 0x00000000, 0x01404501, 0x01404501},
7923 - {0x0000a59c, 0x00000000, 0x00000000, 0x02808a02, 0x02808a02},
7924 - {0x0000a5a0, 0x00000000, 0x00000000, 0x02808a02, 0x02808a02},
7925 - {0x0000a5a4, 0x00000000, 0x00000000, 0x02808803, 0x02808803},
7926 - {0x0000a5a8, 0x00000000, 0x00000000, 0x04c14b04, 0x04c14b04},
7927 - {0x0000a5ac, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
7928 - {0x0000a5b0, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
7929 - {0x0000a5b4, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
7930 - {0x0000a5b8, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
7931 - {0x0000a5bc, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
7932 - {0x0000b500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7933 - {0x0000b504, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7934 - {0x0000b508, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7935 - {0x0000b50c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7936 - {0x0000b510, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7937 - {0x0000b514, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7938 - {0x0000b518, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7939 - {0x0000b51c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7940 - {0x0000b520, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7941 - {0x0000b524, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7942 - {0x0000b528, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7943 - {0x0000b52c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7944 - {0x0000b530, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7945 - {0x0000b534, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7946 - {0x0000b538, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7947 - {0x0000b53c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7948 - {0x0000b540, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7949 - {0x0000b544, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7950 - {0x0000b548, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7951 - {0x0000b54c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7952 - {0x0000b550, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7953 - {0x0000b554, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7954 - {0x0000b558, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7955 - {0x0000b55c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7956 - {0x0000b560, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7957 - {0x0000b564, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7958 - {0x0000b568, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7959 - {0x0000b56c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7960 - {0x0000b570, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7961 - {0x0000b574, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7962 - {0x0000b578, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7963 - {0x0000b57c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7964 - {0x00016044, 0x05d6b2db, 0x05d6b2db, 0x05d6b2db, 0x05d6b2db},
7965 - {0x00016048, 0x6c924260, 0x6c924260, 0x6c924260, 0x6c924260},
7968 static const u32 ar9485Modes_green_spur_ob_db_tx_gain_1_1[][5] = {
7969 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
7970 {0x000098bc, 0x00000003, 0x00000003, 0x00000003, 0x00000003},
7971 @@ -1101,20 +994,6 @@ static const u32 ar9485_common_rx_gain_1
7972 {0x0000a1fc, 0x00000296},
7975 -static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = {
7976 - /* Addr allmodes */
7977 - {0x00018c00, 0x18052e5e},
7978 - {0x00018c04, 0x000801d8},
7979 - {0x00018c08, 0x0000080c},
7982 -static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = {
7983 - /* Addr allmodes */
7984 - {0x00018c00, 0x18053e5e},
7985 - {0x00018c04, 0x000801d8},
7986 - {0x00018c08, 0x0000080c},
7989 static const u32 ar9485_1_1_soc_preamble[][2] = {
7991 {0x00004014, 0xba280400},
7992 @@ -1173,13 +1052,6 @@ static const u32 ar9485_1_1_baseband_pos
7993 {0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
7996 -static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
7997 - /* Addr allmodes */
7998 - {0x00018c00, 0x18013e5e},
7999 - {0x00018c04, 0x000801d8},
8000 - {0x00018c08, 0x0000080c},
8003 static const u32 ar9485_1_1_radio_postamble[][2] = {
8005 {0x0001609c, 0x0b283f31},
8006 @@ -1351,11 +1223,18 @@ static const u32 ar9485_1_1_mac_core[][2
8007 {0x000083d0, 0x000301ff},
8010 -static const u32 ar9485_1_1_baseband_core_txfir_coeff_japan_2484[][2] = {
8011 +static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
8013 - {0x0000a398, 0x00000000},
8014 - {0x0000a39c, 0x6f7f0301},
8015 - {0x0000a3a0, 0xca9228ee},
8016 + {0x00018c00, 0x18013e5e},
8017 + {0x00018c04, 0x000801d8},
8018 + {0x00018c08, 0x0000080c},
8021 +static const u32 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1[][2] = {
8022 + /* Addr allmodes */
8023 + {0x00018c00, 0x1801265e},
8024 + {0x00018c04, 0x000801d8},
8025 + {0x00018c08, 0x0000080c},
8028 #endif /* INITVALS_9485_H */
8029 --- a/drivers/net/wireless/ath/ath9k/pci.c
8030 +++ b/drivers/net/wireless/ath/ath9k/pci.c
8031 @@ -195,6 +195,93 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_i
8033 .driver_data = ATH9K_PCI_BT_ANT_DIV },
8035 + /* AR9485 cards with PLL power-save disabled by default. */
8036 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8038 + PCI_VENDOR_ID_AZWAVE,
8040 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8041 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8043 + PCI_VENDOR_ID_AZWAVE,
8045 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8046 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8048 + 0x1C56, /* ASKEY */
8050 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8051 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8053 + 0x11AD, /* LITEON */
8055 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8056 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8058 + 0x11AD, /* LITEON */
8060 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8061 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8063 + PCI_VENDOR_ID_FOXCONN,
8065 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8066 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8068 + PCI_VENDOR_ID_FOXCONN,
8070 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8071 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8073 + 0x144F, /* ASKEY */
8075 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8076 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8078 + 0x1B9A, /* XAVI */
8080 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8081 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8083 + 0x1B9A, /* XAVI */
8085 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8086 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8088 + PCI_VENDOR_ID_AZWAVE,
8090 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8091 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8093 + PCI_VENDOR_ID_AZWAVE,
8095 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8096 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8098 + PCI_VENDOR_ID_AZWAVE,
8100 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8101 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8103 + PCI_VENDOR_ID_AZWAVE,
8105 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8106 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8108 + 0x1B9A, /* XAVI */
8110 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8111 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8113 + 0x1B9A, /* XAVI */
8115 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8116 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
8118 + PCI_VENDOR_ID_ASUSTEK,
8120 + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
8122 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
8123 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
8125 --- a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
8126 +++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
8131 -static const u32 ar9462_modes_fast_clock_2p0[][3] = {
8132 +#define ar9462_2p0_mac_postamble ar9331_1p1_mac_postamble
8134 +#define ar9462_2p0_common_wo_xlna_rx_gain ar9300Common_wo_xlna_rx_gain_table_2p2
8136 +#define ar9462_2p0_common_5g_xlna_only_rxgain ar9462_2p0_common_mixed_rx_gain
8138 +#define ar9462_2p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
8140 +static const u32 ar9462_2p0_modes_fast_clock[][3] = {
8141 /* Addr 5G_HT20 5G_HT40 */
8142 {0x00001030, 0x00000268, 0x000004d0},
8143 {0x00001070, 0x0000018c, 0x00000318},
8144 @@ -33,13 +41,6 @@ static const u32 ar9462_modes_fast_clock
8145 {0x0000a254, 0x00000898, 0x00001130},
8148 -static const u32 ar9462_pciephy_clkreq_enable_L1_2p0[][2] = {
8149 - /* Addr allmodes */
8150 - {0x00018c00, 0x18253ede},
8151 - {0x00018c04, 0x000801d8},
8152 - {0x00018c08, 0x0003780c},
8155 static const u32 ar9462_2p0_baseband_postamble[][5] = {
8156 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8157 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
8158 @@ -99,7 +100,7 @@ static const u32 ar9462_2p0_baseband_pos
8159 {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
8162 -static const u32 ar9462_common_rx_gain_table_2p0[][2] = {
8163 +static const u32 ar9462_2p0_common_rx_gain[][2] = {
8165 {0x0000a000, 0x00010000},
8166 {0x0000a004, 0x00030002},
8167 @@ -359,20 +360,13 @@ static const u32 ar9462_common_rx_gain_t
8168 {0x0000b1fc, 0x00000196},
8171 -static const u32 ar9462_pciephy_clkreq_disable_L1_2p0[][2] = {
8172 +static const u32 ar9462_2p0_pciephy_clkreq_disable_L1[][2] = {
8174 {0x00018c00, 0x18213ede},
8175 {0x00018c04, 0x000801d8},
8176 {0x00018c08, 0x0003780c},
8179 -static const u32 ar9462_pciephy_pll_on_clkreq_disable_L1_2p0[][2] = {
8180 - /* Addr allmodes */
8181 - {0x00018c00, 0x18212ede},
8182 - {0x00018c04, 0x000801d8},
8183 - {0x00018c08, 0x0003780c},
8186 static const u32 ar9462_2p0_radio_postamble_sys2ant[][5] = {
8187 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8188 {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
8189 @@ -380,348 +374,81 @@ static const u32 ar9462_2p0_radio_postam
8190 {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
8193 -static const u32 ar9462_common_wo_xlna_rx_gain_table_2p0[][2] = {
8194 - /* Addr allmodes */
8195 - {0x0000a000, 0x00010000},
8196 - {0x0000a004, 0x00030002},
8197 - {0x0000a008, 0x00050004},
8198 - {0x0000a00c, 0x00810080},
8199 - {0x0000a010, 0x00830082},
8200 - {0x0000a014, 0x01810180},
8201 - {0x0000a018, 0x01830182},
8202 - {0x0000a01c, 0x01850184},
8203 - {0x0000a020, 0x01890188},
8204 - {0x0000a024, 0x018b018a},
8205 - {0x0000a028, 0x018d018c},
8206 - {0x0000a02c, 0x03820190},
8207 - {0x0000a030, 0x03840383},
8208 - {0x0000a034, 0x03880385},
8209 - {0x0000a038, 0x038a0389},
8210 - {0x0000a03c, 0x038c038b},
8211 - {0x0000a040, 0x0390038d},
8212 - {0x0000a044, 0x03920391},
8213 - {0x0000a048, 0x03940393},
8214 - {0x0000a04c, 0x03960395},
8215 - {0x0000a050, 0x00000000},
8216 - {0x0000a054, 0x00000000},
8217 - {0x0000a058, 0x00000000},
8218 - {0x0000a05c, 0x00000000},
8219 - {0x0000a060, 0x00000000},
8220 - {0x0000a064, 0x00000000},
8221 - {0x0000a068, 0x00000000},
8222 - {0x0000a06c, 0x00000000},
8223 - {0x0000a070, 0x00000000},
8224 - {0x0000a074, 0x00000000},
8225 - {0x0000a078, 0x00000000},
8226 - {0x0000a07c, 0x00000000},
8227 - {0x0000a080, 0x29292929},
8228 - {0x0000a084, 0x29292929},
8229 - {0x0000a088, 0x29292929},
8230 - {0x0000a08c, 0x29292929},
8231 - {0x0000a090, 0x22292929},
8232 - {0x0000a094, 0x1d1d2222},
8233 - {0x0000a098, 0x0c111117},
8234 - {0x0000a09c, 0x00030303},
8235 - {0x0000a0a0, 0x00000000},
8236 - {0x0000a0a4, 0x00000000},
8237 - {0x0000a0a8, 0x00000000},
8238 - {0x0000a0ac, 0x00000000},
8239 - {0x0000a0b0, 0x00000000},
8240 - {0x0000a0b4, 0x00000000},
8241 - {0x0000a0b8, 0x00000000},
8242 - {0x0000a0bc, 0x00000000},
8243 - {0x0000a0c0, 0x001f0000},
8244 - {0x0000a0c4, 0x01000101},
8245 - {0x0000a0c8, 0x011e011f},
8246 - {0x0000a0cc, 0x011c011d},
8247 - {0x0000a0d0, 0x02030204},
8248 - {0x0000a0d4, 0x02010202},
8249 - {0x0000a0d8, 0x021f0200},
8250 - {0x0000a0dc, 0x0302021e},
8251 - {0x0000a0e0, 0x03000301},
8252 - {0x0000a0e4, 0x031e031f},
8253 - {0x0000a0e8, 0x0402031d},
8254 - {0x0000a0ec, 0x04000401},
8255 - {0x0000a0f0, 0x041e041f},
8256 - {0x0000a0f4, 0x0502041d},
8257 - {0x0000a0f8, 0x05000501},
8258 - {0x0000a0fc, 0x051e051f},
8259 - {0x0000a100, 0x06010602},
8260 - {0x0000a104, 0x061f0600},
8261 - {0x0000a108, 0x061d061e},
8262 - {0x0000a10c, 0x07020703},
8263 - {0x0000a110, 0x07000701},
8264 - {0x0000a114, 0x00000000},
8265 - {0x0000a118, 0x00000000},
8266 - {0x0000a11c, 0x00000000},
8267 - {0x0000a120, 0x00000000},
8268 - {0x0000a124, 0x00000000},
8269 - {0x0000a128, 0x00000000},
8270 - {0x0000a12c, 0x00000000},
8271 - {0x0000a130, 0x00000000},
8272 - {0x0000a134, 0x00000000},
8273 - {0x0000a138, 0x00000000},
8274 - {0x0000a13c, 0x00000000},
8275 - {0x0000a140, 0x001f0000},
8276 - {0x0000a144, 0x01000101},
8277 - {0x0000a148, 0x011e011f},
8278 - {0x0000a14c, 0x011c011d},
8279 - {0x0000a150, 0x02030204},
8280 - {0x0000a154, 0x02010202},
8281 - {0x0000a158, 0x021f0200},
8282 - {0x0000a15c, 0x0302021e},
8283 - {0x0000a160, 0x03000301},
8284 - {0x0000a164, 0x031e031f},
8285 - {0x0000a168, 0x0402031d},
8286 - {0x0000a16c, 0x04000401},
8287 - {0x0000a170, 0x041e041f},
8288 - {0x0000a174, 0x0502041d},
8289 - {0x0000a178, 0x05000501},
8290 - {0x0000a17c, 0x051e051f},
8291 - {0x0000a180, 0x06010602},
8292 - {0x0000a184, 0x061f0600},
8293 - {0x0000a188, 0x061d061e},
8294 - {0x0000a18c, 0x07020703},
8295 - {0x0000a190, 0x07000701},
8296 - {0x0000a194, 0x00000000},
8297 - {0x0000a198, 0x00000000},
8298 - {0x0000a19c, 0x00000000},
8299 - {0x0000a1a0, 0x00000000},
8300 - {0x0000a1a4, 0x00000000},
8301 - {0x0000a1a8, 0x00000000},
8302 - {0x0000a1ac, 0x00000000},
8303 - {0x0000a1b0, 0x00000000},
8304 - {0x0000a1b4, 0x00000000},
8305 - {0x0000a1b8, 0x00000000},
8306 - {0x0000a1bc, 0x00000000},
8307 - {0x0000a1c0, 0x00000000},
8308 - {0x0000a1c4, 0x00000000},
8309 - {0x0000a1c8, 0x00000000},
8310 - {0x0000a1cc, 0x00000000},
8311 - {0x0000a1d0, 0x00000000},
8312 - {0x0000a1d4, 0x00000000},
8313 - {0x0000a1d8, 0x00000000},
8314 - {0x0000a1dc, 0x00000000},
8315 - {0x0000a1e0, 0x00000000},
8316 - {0x0000a1e4, 0x00000000},
8317 - {0x0000a1e8, 0x00000000},
8318 - {0x0000a1ec, 0x00000000},
8319 - {0x0000a1f0, 0x00000396},
8320 - {0x0000a1f4, 0x00000396},
8321 - {0x0000a1f8, 0x00000396},
8322 - {0x0000a1fc, 0x00000196},
8323 - {0x0000b000, 0x00010000},
8324 - {0x0000b004, 0x00030002},
8325 - {0x0000b008, 0x00050004},
8326 - {0x0000b00c, 0x00810080},
8327 - {0x0000b010, 0x00830082},
8328 - {0x0000b014, 0x01810180},
8329 - {0x0000b018, 0x01830182},
8330 - {0x0000b01c, 0x01850184},
8331 - {0x0000b020, 0x02810280},
8332 - {0x0000b024, 0x02830282},
8333 - {0x0000b028, 0x02850284},
8334 - {0x0000b02c, 0x02890288},
8335 - {0x0000b030, 0x028b028a},
8336 - {0x0000b034, 0x0388028c},
8337 - {0x0000b038, 0x038a0389},
8338 - {0x0000b03c, 0x038c038b},
8339 - {0x0000b040, 0x0390038d},
8340 - {0x0000b044, 0x03920391},
8341 - {0x0000b048, 0x03940393},
8342 - {0x0000b04c, 0x03960395},
8343 - {0x0000b050, 0x00000000},
8344 - {0x0000b054, 0x00000000},
8345 - {0x0000b058, 0x00000000},
8346 - {0x0000b05c, 0x00000000},
8347 - {0x0000b060, 0x00000000},
8348 - {0x0000b064, 0x00000000},
8349 - {0x0000b068, 0x00000000},
8350 - {0x0000b06c, 0x00000000},
8351 - {0x0000b070, 0x00000000},
8352 - {0x0000b074, 0x00000000},
8353 - {0x0000b078, 0x00000000},
8354 - {0x0000b07c, 0x00000000},
8355 - {0x0000b080, 0x32323232},
8356 - {0x0000b084, 0x2f2f3232},
8357 - {0x0000b088, 0x23282a2d},
8358 - {0x0000b08c, 0x1c1e2123},
8359 - {0x0000b090, 0x14171919},
8360 - {0x0000b094, 0x0e0e1214},
8361 - {0x0000b098, 0x03050707},
8362 - {0x0000b09c, 0x00030303},
8363 - {0x0000b0a0, 0x00000000},
8364 - {0x0000b0a4, 0x00000000},
8365 - {0x0000b0a8, 0x00000000},
8366 - {0x0000b0ac, 0x00000000},
8367 - {0x0000b0b0, 0x00000000},
8368 - {0x0000b0b4, 0x00000000},
8369 - {0x0000b0b8, 0x00000000},
8370 - {0x0000b0bc, 0x00000000},
8371 - {0x0000b0c0, 0x003f0020},
8372 - {0x0000b0c4, 0x00400041},
8373 - {0x0000b0c8, 0x0140005f},
8374 - {0x0000b0cc, 0x0160015f},
8375 - {0x0000b0d0, 0x017e017f},
8376 - {0x0000b0d4, 0x02410242},
8377 - {0x0000b0d8, 0x025f0240},
8378 - {0x0000b0dc, 0x027f0260},
8379 - {0x0000b0e0, 0x0341027e},
8380 - {0x0000b0e4, 0x035f0340},
8381 - {0x0000b0e8, 0x037f0360},
8382 - {0x0000b0ec, 0x04400441},
8383 - {0x0000b0f0, 0x0460045f},
8384 - {0x0000b0f4, 0x0541047f},
8385 - {0x0000b0f8, 0x055f0540},
8386 - {0x0000b0fc, 0x057f0560},
8387 - {0x0000b100, 0x06400641},
8388 - {0x0000b104, 0x0660065f},
8389 - {0x0000b108, 0x067e067f},
8390 - {0x0000b10c, 0x07410742},
8391 - {0x0000b110, 0x075f0740},
8392 - {0x0000b114, 0x077f0760},
8393 - {0x0000b118, 0x07800781},
8394 - {0x0000b11c, 0x07a0079f},
8395 - {0x0000b120, 0x07c107bf},
8396 - {0x0000b124, 0x000007c0},
8397 - {0x0000b128, 0x00000000},
8398 - {0x0000b12c, 0x00000000},
8399 - {0x0000b130, 0x00000000},
8400 - {0x0000b134, 0x00000000},
8401 - {0x0000b138, 0x00000000},
8402 - {0x0000b13c, 0x00000000},
8403 - {0x0000b140, 0x003f0020},
8404 - {0x0000b144, 0x00400041},
8405 - {0x0000b148, 0x0140005f},
8406 - {0x0000b14c, 0x0160015f},
8407 - {0x0000b150, 0x017e017f},
8408 - {0x0000b154, 0x02410242},
8409 - {0x0000b158, 0x025f0240},
8410 - {0x0000b15c, 0x027f0260},
8411 - {0x0000b160, 0x0341027e},
8412 - {0x0000b164, 0x035f0340},
8413 - {0x0000b168, 0x037f0360},
8414 - {0x0000b16c, 0x04400441},
8415 - {0x0000b170, 0x0460045f},
8416 - {0x0000b174, 0x0541047f},
8417 - {0x0000b178, 0x055f0540},
8418 - {0x0000b17c, 0x057f0560},
8419 - {0x0000b180, 0x06400641},
8420 - {0x0000b184, 0x0660065f},
8421 - {0x0000b188, 0x067e067f},
8422 - {0x0000b18c, 0x07410742},
8423 - {0x0000b190, 0x075f0740},
8424 - {0x0000b194, 0x077f0760},
8425 - {0x0000b198, 0x07800781},
8426 - {0x0000b19c, 0x07a0079f},
8427 - {0x0000b1a0, 0x07c107bf},
8428 - {0x0000b1a4, 0x000007c0},
8429 - {0x0000b1a8, 0x00000000},
8430 - {0x0000b1ac, 0x00000000},
8431 - {0x0000b1b0, 0x00000000},
8432 - {0x0000b1b4, 0x00000000},
8433 - {0x0000b1b8, 0x00000000},
8434 - {0x0000b1bc, 0x00000000},
8435 - {0x0000b1c0, 0x00000000},
8436 - {0x0000b1c4, 0x00000000},
8437 - {0x0000b1c8, 0x00000000},
8438 - {0x0000b1cc, 0x00000000},
8439 - {0x0000b1d0, 0x00000000},
8440 - {0x0000b1d4, 0x00000000},
8441 - {0x0000b1d8, 0x00000000},
8442 - {0x0000b1dc, 0x00000000},
8443 - {0x0000b1e0, 0x00000000},
8444 - {0x0000b1e4, 0x00000000},
8445 - {0x0000b1e8, 0x00000000},
8446 - {0x0000b1ec, 0x00000000},
8447 - {0x0000b1f0, 0x00000396},
8448 - {0x0000b1f4, 0x00000396},
8449 - {0x0000b1f8, 0x00000396},
8450 - {0x0000b1fc, 0x00000196},
8453 -static const u32 ar9462_2p0_baseband_core_txfir_coeff_japan_2484[][2] = {
8454 - /* Addr allmodes */
8455 - {0x0000a398, 0x00000000},
8456 - {0x0000a39c, 0x6f7f0301},
8457 - {0x0000a3a0, 0xca9228ee},
8460 -static const u32 ar9462_modes_low_ob_db_tx_gain_table_2p0[][5] = {
8461 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8462 - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
8463 - {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
8464 - {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
8465 - {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
8466 - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
8467 - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
8468 - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8469 - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8470 - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
8471 - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
8472 - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
8473 - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
8474 - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
8475 - {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
8476 - {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
8477 - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
8478 - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
8479 - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
8480 - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
8481 - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
8482 - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
8483 - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
8484 - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
8485 - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
8486 - {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
8487 - {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
8488 - {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
8489 - {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
8490 - {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
8491 - {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
8492 - {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
8493 - {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
8494 - {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8495 - {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8496 - {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8497 - {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8498 - {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8499 - {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8500 - {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8501 - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8502 - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8503 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8504 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8505 - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8506 - {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
8507 - {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
8508 - {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
8509 - {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
8510 - {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
8511 - {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
8512 - {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
8513 - {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8514 - {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8515 - {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8516 - {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8517 - {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
8518 - {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
8519 - {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
8520 - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
8521 - {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
8522 - {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
8523 - {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
8524 - {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
8525 - {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
8526 - {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
8529 -static const u32 ar9462_2p0_soc_postamble[][5] = {
8530 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8531 - {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
8534 -static const u32 ar9462_2p0_baseband_core[][2] = {
8535 +static const u32 ar9462_2p0_modes_low_ob_db_tx_gain[][5] = {
8536 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8537 + {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
8538 + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
8539 + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
8540 + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
8541 + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
8542 + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
8543 + {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8544 + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8545 + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
8546 + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
8547 + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
8548 + {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
8549 + {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
8550 + {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
8551 + {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
8552 + {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
8553 + {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
8554 + {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
8555 + {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
8556 + {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
8557 + {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
8558 + {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
8559 + {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
8560 + {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
8561 + {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
8562 + {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
8563 + {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
8564 + {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
8565 + {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
8566 + {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
8567 + {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
8568 + {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
8569 + {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8570 + {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8571 + {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8572 + {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8573 + {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8574 + {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8575 + {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
8576 + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8577 + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8578 + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8579 + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8580 + {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8581 + {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
8582 + {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
8583 + {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
8584 + {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
8585 + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
8586 + {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
8587 + {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
8588 + {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8589 + {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8590 + {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8591 + {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
8592 + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
8593 + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
8594 + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
8595 + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
8596 + {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
8597 + {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
8598 + {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
8599 + {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
8600 + {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
8601 + {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
8604 +static const u32 ar9462_2p0_soc_postamble[][5] = {
8605 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8606 + {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
8609 +static const u32 ar9462_2p0_baseband_core[][2] = {
8611 {0x00009800, 0xafe68e30},
8612 {0x00009804, 0xfd14e000},
8613 @@ -879,7 +606,7 @@ static const u32 ar9462_2p0_radio_postam
8614 {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
8617 -static const u32 ar9462_modes_mix_ob_db_tx_gain_table_2p0[][5] = {
8618 +static const u32 ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = {
8619 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8620 {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
8621 {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
8622 @@ -942,7 +669,7 @@ static const u32 ar9462_modes_mix_ob_db_
8623 {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
8626 -static const u32 ar9462_modes_high_ob_db_tx_gain_table_2p0[][5] = {
8627 +static const u32 ar9462_2p0_modes_high_ob_db_tx_gain[][5] = {
8628 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8629 {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
8630 {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
8631 @@ -1240,19 +967,7 @@ static const u32 ar9462_2p0_mac_core[][2
8632 {0x000083d0, 0x000301ff},
8635 -static const u32 ar9462_2p0_mac_postamble[][5] = {
8636 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8637 - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
8638 - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
8639 - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
8640 - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
8641 - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
8642 - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
8643 - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
8644 - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
8647 -static const u32 ar9462_common_mixed_rx_gain_table_2p0[][2] = {
8648 +static const u32 ar9462_2p0_common_mixed_rx_gain[][2] = {
8650 {0x0000a000, 0x00010000},
8651 {0x0000a004, 0x00030002},
8652 @@ -1517,266 +1232,6 @@ static const u32 ar9462_2p0_baseband_pos
8653 {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
8656 -static const u32 ar9462_2p0_5g_xlna_only_rxgain[][2] = {
8657 - /* Addr allmodes */
8658 - {0x0000a000, 0x00010000},
8659 - {0x0000a004, 0x00030002},
8660 - {0x0000a008, 0x00050004},
8661 - {0x0000a00c, 0x00810080},
8662 - {0x0000a010, 0x00830082},
8663 - {0x0000a014, 0x01810180},
8664 - {0x0000a018, 0x01830182},
8665 - {0x0000a01c, 0x01850184},
8666 - {0x0000a020, 0x01890188},
8667 - {0x0000a024, 0x018b018a},
8668 - {0x0000a028, 0x018d018c},
8669 - {0x0000a02c, 0x03820190},
8670 - {0x0000a030, 0x03840383},
8671 - {0x0000a034, 0x03880385},
8672 - {0x0000a038, 0x038a0389},
8673 - {0x0000a03c, 0x038c038b},
8674 - {0x0000a040, 0x0390038d},
8675 - {0x0000a044, 0x03920391},
8676 - {0x0000a048, 0x03940393},
8677 - {0x0000a04c, 0x03960395},
8678 - {0x0000a050, 0x00000000},
8679 - {0x0000a054, 0x00000000},
8680 - {0x0000a058, 0x00000000},
8681 - {0x0000a05c, 0x00000000},
8682 - {0x0000a060, 0x00000000},
8683 - {0x0000a064, 0x00000000},
8684 - {0x0000a068, 0x00000000},
8685 - {0x0000a06c, 0x00000000},
8686 - {0x0000a070, 0x00000000},
8687 - {0x0000a074, 0x00000000},
8688 - {0x0000a078, 0x00000000},
8689 - {0x0000a07c, 0x00000000},
8690 - {0x0000a080, 0x29292929},
8691 - {0x0000a084, 0x29292929},
8692 - {0x0000a088, 0x29292929},
8693 - {0x0000a08c, 0x29292929},
8694 - {0x0000a090, 0x22292929},
8695 - {0x0000a094, 0x1d1d2222},
8696 - {0x0000a098, 0x0c111117},
8697 - {0x0000a09c, 0x00030303},
8698 - {0x0000a0a0, 0x00000000},
8699 - {0x0000a0a4, 0x00000000},
8700 - {0x0000a0a8, 0x00000000},
8701 - {0x0000a0ac, 0x00000000},
8702 - {0x0000a0b0, 0x00000000},
8703 - {0x0000a0b4, 0x00000000},
8704 - {0x0000a0b8, 0x00000000},
8705 - {0x0000a0bc, 0x00000000},
8706 - {0x0000a0c0, 0x001f0000},
8707 - {0x0000a0c4, 0x01000101},
8708 - {0x0000a0c8, 0x011e011f},
8709 - {0x0000a0cc, 0x011c011d},
8710 - {0x0000a0d0, 0x02030204},
8711 - {0x0000a0d4, 0x02010202},
8712 - {0x0000a0d8, 0x021f0200},
8713 - {0x0000a0dc, 0x0302021e},
8714 - {0x0000a0e0, 0x03000301},
8715 - {0x0000a0e4, 0x031e031f},
8716 - {0x0000a0e8, 0x0402031d},
8717 - {0x0000a0ec, 0x04000401},
8718 - {0x0000a0f0, 0x041e041f},
8719 - {0x0000a0f4, 0x0502041d},
8720 - {0x0000a0f8, 0x05000501},
8721 - {0x0000a0fc, 0x051e051f},
8722 - {0x0000a100, 0x06010602},
8723 - {0x0000a104, 0x061f0600},
8724 - {0x0000a108, 0x061d061e},
8725 - {0x0000a10c, 0x07020703},
8726 - {0x0000a110, 0x07000701},
8727 - {0x0000a114, 0x00000000},
8728 - {0x0000a118, 0x00000000},
8729 - {0x0000a11c, 0x00000000},
8730 - {0x0000a120, 0x00000000},
8731 - {0x0000a124, 0x00000000},
8732 - {0x0000a128, 0x00000000},
8733 - {0x0000a12c, 0x00000000},
8734 - {0x0000a130, 0x00000000},
8735 - {0x0000a134, 0x00000000},
8736 - {0x0000a138, 0x00000000},
8737 - {0x0000a13c, 0x00000000},
8738 - {0x0000a140, 0x001f0000},
8739 - {0x0000a144, 0x01000101},
8740 - {0x0000a148, 0x011e011f},
8741 - {0x0000a14c, 0x011c011d},
8742 - {0x0000a150, 0x02030204},
8743 - {0x0000a154, 0x02010202},
8744 - {0x0000a158, 0x021f0200},
8745 - {0x0000a15c, 0x0302021e},
8746 - {0x0000a160, 0x03000301},
8747 - {0x0000a164, 0x031e031f},
8748 - {0x0000a168, 0x0402031d},
8749 - {0x0000a16c, 0x04000401},
8750 - {0x0000a170, 0x041e041f},
8751 - {0x0000a174, 0x0502041d},
8752 - {0x0000a178, 0x05000501},
8753 - {0x0000a17c, 0x051e051f},
8754 - {0x0000a180, 0x06010602},
8755 - {0x0000a184, 0x061f0600},
8756 - {0x0000a188, 0x061d061e},
8757 - {0x0000a18c, 0x07020703},
8758 - {0x0000a190, 0x07000701},
8759 - {0x0000a194, 0x00000000},
8760 - {0x0000a198, 0x00000000},
8761 - {0x0000a19c, 0x00000000},
8762 - {0x0000a1a0, 0x00000000},
8763 - {0x0000a1a4, 0x00000000},
8764 - {0x0000a1a8, 0x00000000},
8765 - {0x0000a1ac, 0x00000000},
8766 - {0x0000a1b0, 0x00000000},
8767 - {0x0000a1b4, 0x00000000},
8768 - {0x0000a1b8, 0x00000000},
8769 - {0x0000a1bc, 0x00000000},
8770 - {0x0000a1c0, 0x00000000},
8771 - {0x0000a1c4, 0x00000000},
8772 - {0x0000a1c8, 0x00000000},
8773 - {0x0000a1cc, 0x00000000},
8774 - {0x0000a1d0, 0x00000000},
8775 - {0x0000a1d4, 0x00000000},
8776 - {0x0000a1d8, 0x00000000},
8777 - {0x0000a1dc, 0x00000000},
8778 - {0x0000a1e0, 0x00000000},
8779 - {0x0000a1e4, 0x00000000},
8780 - {0x0000a1e8, 0x00000000},
8781 - {0x0000a1ec, 0x00000000},
8782 - {0x0000a1f0, 0x00000396},
8783 - {0x0000a1f4, 0x00000396},
8784 - {0x0000a1f8, 0x00000396},
8785 - {0x0000a1fc, 0x00000196},
8786 - {0x0000b000, 0x00010000},
8787 - {0x0000b004, 0x00030002},
8788 - {0x0000b008, 0x00050004},
8789 - {0x0000b00c, 0x00810080},
8790 - {0x0000b010, 0x00830082},
8791 - {0x0000b014, 0x01810180},
8792 - {0x0000b018, 0x01830182},
8793 - {0x0000b01c, 0x01850184},
8794 - {0x0000b020, 0x02810280},
8795 - {0x0000b024, 0x02830282},
8796 - {0x0000b028, 0x02850284},
8797 - {0x0000b02c, 0x02890288},
8798 - {0x0000b030, 0x028b028a},
8799 - {0x0000b034, 0x0388028c},
8800 - {0x0000b038, 0x038a0389},
8801 - {0x0000b03c, 0x038c038b},
8802 - {0x0000b040, 0x0390038d},
8803 - {0x0000b044, 0x03920391},
8804 - {0x0000b048, 0x03940393},
8805 - {0x0000b04c, 0x03960395},
8806 - {0x0000b050, 0x00000000},
8807 - {0x0000b054, 0x00000000},
8808 - {0x0000b058, 0x00000000},
8809 - {0x0000b05c, 0x00000000},
8810 - {0x0000b060, 0x00000000},
8811 - {0x0000b064, 0x00000000},
8812 - {0x0000b068, 0x00000000},
8813 - {0x0000b06c, 0x00000000},
8814 - {0x0000b070, 0x00000000},
8815 - {0x0000b074, 0x00000000},
8816 - {0x0000b078, 0x00000000},
8817 - {0x0000b07c, 0x00000000},
8818 - {0x0000b080, 0x2a2d2f32},
8819 - {0x0000b084, 0x21232328},
8820 - {0x0000b088, 0x19191c1e},
8821 - {0x0000b08c, 0x12141417},
8822 - {0x0000b090, 0x07070e0e},
8823 - {0x0000b094, 0x03030305},
8824 - {0x0000b098, 0x00000003},
8825 - {0x0000b09c, 0x00000000},
8826 - {0x0000b0a0, 0x00000000},
8827 - {0x0000b0a4, 0x00000000},
8828 - {0x0000b0a8, 0x00000000},
8829 - {0x0000b0ac, 0x00000000},
8830 - {0x0000b0b0, 0x00000000},
8831 - {0x0000b0b4, 0x00000000},
8832 - {0x0000b0b8, 0x00000000},
8833 - {0x0000b0bc, 0x00000000},
8834 - {0x0000b0c0, 0x003f0020},
8835 - {0x0000b0c4, 0x00400041},
8836 - {0x0000b0c8, 0x0140005f},
8837 - {0x0000b0cc, 0x0160015f},
8838 - {0x0000b0d0, 0x017e017f},
8839 - {0x0000b0d4, 0x02410242},
8840 - {0x0000b0d8, 0x025f0240},
8841 - {0x0000b0dc, 0x027f0260},
8842 - {0x0000b0e0, 0x0341027e},
8843 - {0x0000b0e4, 0x035f0340},
8844 - {0x0000b0e8, 0x037f0360},
8845 - {0x0000b0ec, 0x04400441},
8846 - {0x0000b0f0, 0x0460045f},
8847 - {0x0000b0f4, 0x0541047f},
8848 - {0x0000b0f8, 0x055f0540},
8849 - {0x0000b0fc, 0x057f0560},
8850 - {0x0000b100, 0x06400641},
8851 - {0x0000b104, 0x0660065f},
8852 - {0x0000b108, 0x067e067f},
8853 - {0x0000b10c, 0x07410742},
8854 - {0x0000b110, 0x075f0740},
8855 - {0x0000b114, 0x077f0760},
8856 - {0x0000b118, 0x07800781},
8857 - {0x0000b11c, 0x07a0079f},
8858 - {0x0000b120, 0x07c107bf},
8859 - {0x0000b124, 0x000007c0},
8860 - {0x0000b128, 0x00000000},
8861 - {0x0000b12c, 0x00000000},
8862 - {0x0000b130, 0x00000000},
8863 - {0x0000b134, 0x00000000},
8864 - {0x0000b138, 0x00000000},
8865 - {0x0000b13c, 0x00000000},
8866 - {0x0000b140, 0x003f0020},
8867 - {0x0000b144, 0x00400041},
8868 - {0x0000b148, 0x0140005f},
8869 - {0x0000b14c, 0x0160015f},
8870 - {0x0000b150, 0x017e017f},
8871 - {0x0000b154, 0x02410242},
8872 - {0x0000b158, 0x025f0240},
8873 - {0x0000b15c, 0x027f0260},
8874 - {0x0000b160, 0x0341027e},
8875 - {0x0000b164, 0x035f0340},
8876 - {0x0000b168, 0x037f0360},
8877 - {0x0000b16c, 0x04400441},
8878 - {0x0000b170, 0x0460045f},
8879 - {0x0000b174, 0x0541047f},
8880 - {0x0000b178, 0x055f0540},
8881 - {0x0000b17c, 0x057f0560},
8882 - {0x0000b180, 0x06400641},
8883 - {0x0000b184, 0x0660065f},
8884 - {0x0000b188, 0x067e067f},
8885 - {0x0000b18c, 0x07410742},
8886 - {0x0000b190, 0x075f0740},
8887 - {0x0000b194, 0x077f0760},
8888 - {0x0000b198, 0x07800781},
8889 - {0x0000b19c, 0x07a0079f},
8890 - {0x0000b1a0, 0x07c107bf},
8891 - {0x0000b1a4, 0x000007c0},
8892 - {0x0000b1a8, 0x00000000},
8893 - {0x0000b1ac, 0x00000000},
8894 - {0x0000b1b0, 0x00000000},
8895 - {0x0000b1b4, 0x00000000},
8896 - {0x0000b1b8, 0x00000000},
8897 - {0x0000b1bc, 0x00000000},
8898 - {0x0000b1c0, 0x00000000},
8899 - {0x0000b1c4, 0x00000000},
8900 - {0x0000b1c8, 0x00000000},
8901 - {0x0000b1cc, 0x00000000},
8902 - {0x0000b1d0, 0x00000000},
8903 - {0x0000b1d4, 0x00000000},
8904 - {0x0000b1d8, 0x00000000},
8905 - {0x0000b1dc, 0x00000000},
8906 - {0x0000b1e0, 0x00000000},
8907 - {0x0000b1e4, 0x00000000},
8908 - {0x0000b1e8, 0x00000000},
8909 - {0x0000b1ec, 0x00000000},
8910 - {0x0000b1f0, 0x00000396},
8911 - {0x0000b1f4, 0x00000396},
8912 - {0x0000b1f8, 0x00000396},
8913 - {0x0000b1fc, 0x00000196},
8916 static const u32 ar9462_2p0_baseband_core_mix_rxgain[][2] = {
8918 {0x00009fd0, 0x0a2d6b93},
8919 --- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
8920 +++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
8921 @@ -303,7 +303,7 @@ static const u32 ar9300_2p2_mac_postambl
8922 {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
8923 {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
8924 {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
8925 - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
8926 + {0x00008120, 0x18f04800, 0x18f04800, 0x18f04810, 0x18f04810},
8927 {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
8928 {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
8930 @@ -352,7 +352,7 @@ static const u32 ar9300_2p2_baseband_pos
8931 {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
8932 {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
8933 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
8934 - {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
8935 + {0x0000a2d0, 0x00041983, 0x00041983, 0x00041981, 0x00041982},
8936 {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
8937 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
8938 {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
8939 @@ -378,9 +378,9 @@ static const u32 ar9300_2p2_baseband_cor
8940 {0x00009814, 0x9280c00a},
8941 {0x00009818, 0x00000000},
8942 {0x0000981c, 0x00020028},
8943 - {0x00009834, 0x6400a290},
8944 + {0x00009834, 0x6400a190},
8945 {0x00009838, 0x0108ecff},
8946 - {0x0000983c, 0x0d000600},
8947 + {0x0000983c, 0x14000600},
8948 {0x00009880, 0x201fff00},
8949 {0x00009884, 0x00001042},
8950 {0x000098a4, 0x00200400},
8951 @@ -401,7 +401,7 @@ static const u32 ar9300_2p2_baseband_cor
8952 {0x00009d04, 0x40206c10},
8953 {0x00009d08, 0x009c4060},
8954 {0x00009d0c, 0x9883800a},
8955 - {0x00009d10, 0x01834061},
8956 + {0x00009d10, 0x01884061},
8957 {0x00009d14, 0x00c0040b},
8958 {0x00009d18, 0x00000000},
8959 {0x00009e08, 0x0038230c},
8960 @@ -459,7 +459,7 @@ static const u32 ar9300_2p2_baseband_cor
8961 {0x0000a3e8, 0x20202020},
8962 {0x0000a3ec, 0x20202020},
8963 {0x0000a3f0, 0x00000000},
8964 - {0x0000a3f4, 0x00000246},
8965 + {0x0000a3f4, 0x00000000},
8966 {0x0000a3f8, 0x0c9bd380},
8967 {0x0000a3fc, 0x000f0f01},
8968 {0x0000a400, 0x8fa91f01},
8969 @@ -534,107 +534,107 @@ static const u32 ar9300_2p2_baseband_cor
8971 static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = {
8972 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
8973 - {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
8974 - {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
8975 - {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
8976 + {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
8977 + {0x0000a2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
8978 + {0x0000a2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
8979 {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
8980 - {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
8981 - {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
8982 - {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
8983 - {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
8984 - {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
8985 - {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
8986 - {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
8987 - {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
8988 - {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
8989 - {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
8990 - {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
8991 - {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
8992 - {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
8993 - {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
8994 - {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
8995 - {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
8996 - {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
8997 - {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
8998 - {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
8999 - {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
9000 - {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
9001 - {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
9002 - {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
9003 - {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
9004 - {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
9005 - {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
9006 - {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9007 - {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9008 - {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9009 - {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9010 - {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9011 - {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9012 - {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
9013 - {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
9014 - {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
9015 - {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
9016 - {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
9017 - {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
9018 - {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
9019 - {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
9020 - {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
9021 - {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
9022 - {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
9023 - {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
9024 - {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
9025 - {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
9026 - {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
9027 - {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
9028 - {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
9029 - {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
9030 - {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
9031 - {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
9032 - {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
9033 - {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
9034 - {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
9035 - {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
9036 - {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
9037 - {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
9038 - {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9039 - {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9040 - {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9041 - {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9042 - {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9043 - {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9044 - {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
9045 + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
9046 + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9047 + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
9048 + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
9049 + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
9050 + {0x0000a510, 0x15000028, 0x15000028, 0x0f000202, 0x0f000202},
9051 + {0x0000a514, 0x1b00002b, 0x1b00002b, 0x12000400, 0x12000400},
9052 + {0x0000a518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
9053 + {0x0000a51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
9054 + {0x0000a520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
9055 + {0x0000a524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
9056 + {0x0000a528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
9057 + {0x0000a52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
9058 + {0x0000a530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
9059 + {0x0000a534, 0x4108202d, 0x4108202d, 0x30000e22, 0x30000e22},
9060 + {0x0000a538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
9061 + {0x0000a53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
9062 + {0x0000a540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
9063 + {0x0000a544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
9064 + {0x0000a548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
9065 + {0x0000a54c, 0x5e08442e, 0x5e08442e, 0x47001a83, 0x47001a83},
9066 + {0x0000a550, 0x620a4431, 0x620a4431, 0x4a001c84, 0x4a001c84},
9067 + {0x0000a554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
9068 + {0x0000a558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
9069 + {0x0000a55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
9070 + {0x0000a560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
9071 + {0x0000a564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9072 + {0x0000a568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9073 + {0x0000a56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9074 + {0x0000a570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9075 + {0x0000a574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9076 + {0x0000a578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9077 + {0x0000a57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9078 + {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
9079 + {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
9080 + {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
9081 + {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
9082 + {0x0000a590, 0x15800028, 0x15800028, 0x0f800202, 0x0f800202},
9083 + {0x0000a594, 0x1b80002b, 0x1b80002b, 0x12800400, 0x12800400},
9084 + {0x0000a598, 0x1f820028, 0x1f820028, 0x16800402, 0x16800402},
9085 + {0x0000a59c, 0x2582002b, 0x2582002b, 0x19800404, 0x19800404},
9086 + {0x0000a5a0, 0x2a84002a, 0x2a84002a, 0x1c800603, 0x1c800603},
9087 + {0x0000a5a4, 0x2e86002a, 0x2e86002a, 0x21800a02, 0x21800a02},
9088 + {0x0000a5a8, 0x3382202d, 0x3382202d, 0x25800a04, 0x25800a04},
9089 + {0x0000a5ac, 0x3884202c, 0x3884202c, 0x28800a20, 0x28800a20},
9090 + {0x0000a5b0, 0x3c86202c, 0x3c86202c, 0x2c800e20, 0x2c800e20},
9091 + {0x0000a5b4, 0x4188202d, 0x4188202d, 0x30800e22, 0x30800e22},
9092 + {0x0000a5b8, 0x4586402d, 0x4586402d, 0x34800e24, 0x34800e24},
9093 + {0x0000a5bc, 0x4986222d, 0x4986222d, 0x38801640, 0x38801640},
9094 + {0x0000a5c0, 0x4d862231, 0x4d862231, 0x3c801660, 0x3c801660},
9095 + {0x0000a5c4, 0x50882231, 0x50882231, 0x3f801861, 0x3f801861},
9096 + {0x0000a5c8, 0x5688422e, 0x5688422e, 0x43801a81, 0x43801a81},
9097 + {0x0000a5cc, 0x5e88442e, 0x5e88442e, 0x47801a83, 0x47801a83},
9098 + {0x0000a5d0, 0x628a4431, 0x628a4431, 0x4a801c84, 0x4a801c84},
9099 + {0x0000a5d4, 0x648a4432, 0x648a4432, 0x4e801ce3, 0x4e801ce3},
9100 + {0x0000a5d8, 0x688a4434, 0x688a4434, 0x52801ce5, 0x52801ce5},
9101 + {0x0000a5dc, 0x6c8a6434, 0x6c8a6434, 0x56801ce9, 0x56801ce9},
9102 + {0x0000a5e0, 0x6f8a6633, 0x6f8a6633, 0x5a801ceb, 0x5a801ceb},
9103 + {0x0000a5e4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9104 + {0x0000a5e8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9105 + {0x0000a5ec, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9106 + {0x0000a5f0, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9107 + {0x0000a5f4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9108 + {0x0000a5f8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9109 + {0x0000a5fc, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9110 {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9111 {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9112 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9113 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9114 - {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
9115 - {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
9116 - {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
9117 - {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
9118 - {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
9119 - {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
9120 - {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
9121 - {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
9122 - {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
9123 - {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
9124 - {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
9125 - {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
9126 - {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
9127 - {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
9128 - {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
9129 + {0x0000a608, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
9130 + {0x0000a60c, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
9131 + {0x0000a610, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
9132 + {0x0000a614, 0x01804601, 0x01804601, 0x01404000, 0x01404000},
9133 + {0x0000a618, 0x01804601, 0x01804601, 0x01404501, 0x01404501},
9134 + {0x0000a61c, 0x01804601, 0x01804601, 0x02008501, 0x02008501},
9135 + {0x0000a620, 0x03408d02, 0x03408d02, 0x0280ca03, 0x0280ca03},
9136 + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
9137 + {0x0000a628, 0x03410d04, 0x03410d04, 0x04014c04, 0x04014c04},
9138 + {0x0000a62c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9139 + {0x0000a630, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9140 + {0x0000a634, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9141 + {0x0000a638, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9142 + {0x0000a63c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9143 + {0x0000b2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
9144 + {0x0000b2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
9145 + {0x0000b2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
9146 {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
9147 - {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
9148 - {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
9149 - {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
9150 + {0x0000c2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
9151 + {0x0000c2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
9152 + {0x0000c2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
9153 {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
9154 {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
9155 - {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
9156 + {0x00016048, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
9157 {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9158 {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
9159 - {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
9160 + {0x00016448, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
9161 {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9162 {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
9163 - {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
9164 + {0x00016848, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
9165 {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9168 @@ -644,7 +644,7 @@ static const u32 ar9300Modes_high_ob_db_
9169 {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
9170 {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
9171 {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
9172 - {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
9173 + {0x0000a410, 0x000050d4, 0x000050d4, 0x000050d9, 0x000050d9},
9174 {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
9175 {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
9176 {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
9177 @@ -1086,8 +1086,8 @@ static const u32 ar9300Common_rx_gain_ta
9178 {0x0000b074, 0x00000000},
9179 {0x0000b078, 0x00000000},
9180 {0x0000b07c, 0x00000000},
9181 - {0x0000b080, 0x2a2d2f32},
9182 - {0x0000b084, 0x21232328},
9183 + {0x0000b080, 0x23232323},
9184 + {0x0000b084, 0x21232323},
9185 {0x0000b088, 0x19191c1e},
9186 {0x0000b08c, 0x12141417},
9187 {0x0000b090, 0x07070e0e},
9188 @@ -1385,9 +1385,9 @@ static const u32 ar9300_2p2_mac_core[][2
9189 {0x000081f8, 0x00000000},
9190 {0x000081fc, 0x00000000},
9191 {0x00008240, 0x00100000},
9192 - {0x00008244, 0x0010f424},
9193 + {0x00008244, 0x0010f400},
9194 {0x00008248, 0x00000800},
9195 - {0x0000824c, 0x0001e848},
9196 + {0x0000824c, 0x0001e800},
9197 {0x00008250, 0x00000000},
9198 {0x00008254, 0x00000000},
9199 {0x00008258, 0x00000000},
9200 @@ -1726,16 +1726,30 @@ static const u32 ar9300PciePhy_pll_on_cl
9202 static const u32 ar9300PciePhy_clkreq_enable_L1_2p2[][2] = {
9204 - {0x00004040, 0x08253e5e},
9205 + {0x00004040, 0x0825365e},
9206 {0x00004040, 0x0008003b},
9207 {0x00004044, 0x00000000},
9210 static const u32 ar9300PciePhy_clkreq_disable_L1_2p2[][2] = {
9212 - {0x00004040, 0x08213e5e},
9213 + {0x00004040, 0x0821365e},
9214 {0x00004040, 0x0008003b},
9215 {0x00004044, 0x00000000},
9218 +static const u32 ar9300_2p2_baseband_core_txfir_coeff_japan_2484[][2] = {
9219 + /* Addr allmodes */
9220 + {0x0000a398, 0x00000000},
9221 + {0x0000a39c, 0x6f7f0301},
9222 + {0x0000a3a0, 0xca9228ee},
9225 +static const u32 ar9300_2p2_baseband_postamble_dfs_channel[][3] = {
9227 + {0x00009824, 0x5ac668d0, 0x5ac668d0},
9228 + {0x00009e0c, 0x6d4000e2, 0x6d4000e2},
9229 + {0x00009e14, 0x37b9625e, 0x37b9625e},
9232 #endif /* INITVALS_9003_2P2_H */
9234 +++ b/drivers/net/wireless/ath/ath9k/ar9565_1p1_initvals.h
9237 + * Copyright (c) 2010-2011 Atheros Communications Inc.
9238 + * Copyright (c) 2011-2012 Qualcomm Atheros Inc.
9240 + * Permission to use, copy, modify, and/or distribute this software for any
9241 + * purpose with or without fee is hereby granted, provided that the above
9242 + * copyright notice and this permission notice appear in all copies.
9244 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9245 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9246 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9247 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
9248 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
9249 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
9250 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9253 +#ifndef INITVALS_9565_1P1_H
9254 +#define INITVALS_9565_1P1_H
9258 +#define ar9565_1p1_mac_core ar9565_1p0_mac_core
9260 +#define ar9565_1p1_mac_postamble ar9565_1p0_mac_postamble
9262 +#define ar9565_1p1_baseband_core ar9565_1p0_baseband_core
9264 +#define ar9565_1p1_baseband_postamble ar9565_1p0_baseband_postamble
9266 +#define ar9565_1p1_radio_core ar9565_1p0_radio_core
9268 +#define ar9565_1p1_soc_preamble ar9565_1p0_soc_preamble
9270 +#define ar9565_1p1_soc_postamble ar9565_1p0_soc_postamble
9272 +#define ar9565_1p1_Common_rx_gain_table ar9565_1p0_Common_rx_gain_table
9274 +#define ar9565_1p1_Modes_lowest_ob_db_tx_gain_table ar9565_1p0_Modes_lowest_ob_db_tx_gain_table
9276 +#define ar9565_1p1_pciephy_clkreq_disable_L1 ar9565_1p0_pciephy_clkreq_disable_L1
9278 +#define ar9565_1p1_modes_fast_clock ar9565_1p0_modes_fast_clock
9280 +#define ar9565_1p1_common_wo_xlna_rx_gain_table ar9565_1p0_common_wo_xlna_rx_gain_table
9282 +#define ar9565_1p1_modes_low_ob_db_tx_gain_table ar9565_1p0_modes_low_ob_db_tx_gain_table
9284 +#define ar9565_1p1_modes_high_ob_db_tx_gain_table ar9565_1p0_modes_high_ob_db_tx_gain_table
9286 +#define ar9565_1p1_modes_high_power_tx_gain_table ar9565_1p0_modes_high_power_tx_gain_table
9288 +#define ar9565_1p1_baseband_core_txfir_coeff_japan_2484 ar9565_1p0_baseband_core_txfir_coeff_japan_2484
9290 +static const u32 ar9565_1p1_radio_postamble[][5] = {
9291 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9292 + {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
9293 + {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
9294 + {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
9295 + {0x0001610c, 0x40000000, 0x40000000, 0x40000000, 0x40000000},
9296 + {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
9299 +#endif /* INITVALS_9565_1P1_H */
9300 --- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
9301 +++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
9306 +#define ar9580_1p0_soc_preamble ar9300_2p2_soc_preamble
9308 +#define ar9580_1p0_soc_postamble ar9300_2p2_soc_postamble
9310 +#define ar9580_1p0_radio_core ar9300_2p2_radio_core
9312 +#define ar9580_1p0_mac_postamble ar9300_2p2_mac_postamble
9314 +#define ar9580_1p0_wo_xlna_rx_gain_table ar9300Common_wo_xlna_rx_gain_table_2p2
9316 +#define ar9580_1p0_type5_tx_gain_table ar9300Modes_type5_tx_gain_table_2p2
9318 +#define ar9580_1p0_high_ob_db_tx_gain_table ar9300Modes_high_ob_db_tx_gain_table_2p2
9320 #define ar9580_1p0_modes_fast_clock ar9300Modes_fast_clock_2p2
9322 +#define ar9580_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
9324 static const u32 ar9580_1p0_radio_postamble[][5] = {
9325 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9326 {0x0001609c, 0x0dd08f29, 0x0dd08f29, 0x0b283f31, 0x0b283f31},
9327 {0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800},
9328 {0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20},
9329 - {0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
9330 + {0x0001610c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
9331 {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
9332 - {0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
9333 + {0x0001650c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
9334 {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
9335 - {0x0001690c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
9336 + {0x0001690c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
9337 {0x00016940, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
9340 @@ -41,12 +57,10 @@ static const u32 ar9580_1p0_baseband_cor
9341 {0x00009804, 0xfd14e000},
9342 {0x00009808, 0x9c0a9f6b},
9343 {0x0000980c, 0x04900000},
9344 - {0x00009814, 0x3280c00a},
9345 - {0x00009818, 0x00000000},
9346 {0x0000981c, 0x00020028},
9347 - {0x00009834, 0x6400a290},
9348 + {0x00009834, 0x6400a190},
9349 {0x00009838, 0x0108ecff},
9350 - {0x0000983c, 0x0d000600},
9351 + {0x0000983c, 0x14000600},
9352 {0x00009880, 0x201fff00},
9353 {0x00009884, 0x00001042},
9354 {0x000098a4, 0x00200400},
9355 @@ -67,7 +81,7 @@ static const u32 ar9580_1p0_baseband_cor
9356 {0x00009d04, 0x40206c10},
9357 {0x00009d08, 0x009c4060},
9358 {0x00009d0c, 0x9883800a},
9359 - {0x00009d10, 0x01834061},
9360 + {0x00009d10, 0x01884061},
9361 {0x00009d14, 0x00c0040b},
9362 {0x00009d18, 0x00000000},
9363 {0x00009e08, 0x0038230c},
9364 @@ -198,8 +212,6 @@ static const u32 ar9580_1p0_baseband_cor
9365 {0x0000c420, 0x00000000},
9368 -#define ar9580_1p0_mac_postamble ar9300_2p2_mac_postamble
9370 static const u32 ar9580_1p0_low_ob_db_tx_gain_table[][5] = {
9371 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9372 {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
9373 @@ -306,7 +318,112 @@ static const u32 ar9580_1p0_low_ob_db_tx
9374 {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9377 -#define ar9580_1p0_high_power_tx_gain_table ar9580_1p0_low_ob_db_tx_gain_table
9378 +static const u32 ar9580_1p0_high_power_tx_gain_table[][5] = {
9379 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9380 + {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
9381 + {0x0000a2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
9382 + {0x0000a2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
9383 + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
9384 + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
9385 + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9386 + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
9387 + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
9388 + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
9389 + {0x0000a510, 0x15000028, 0x15000028, 0x0f000202, 0x0f000202},
9390 + {0x0000a514, 0x1b00002b, 0x1b00002b, 0x12000400, 0x12000400},
9391 + {0x0000a518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
9392 + {0x0000a51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
9393 + {0x0000a520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
9394 + {0x0000a524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
9395 + {0x0000a528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
9396 + {0x0000a52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
9397 + {0x0000a530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
9398 + {0x0000a534, 0x4108202d, 0x4108202d, 0x30000e22, 0x30000e22},
9399 + {0x0000a538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
9400 + {0x0000a53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
9401 + {0x0000a540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
9402 + {0x0000a544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
9403 + {0x0000a548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
9404 + {0x0000a54c, 0x5e08442e, 0x5e08442e, 0x47001a83, 0x47001a83},
9405 + {0x0000a550, 0x620a4431, 0x620a4431, 0x4a001c84, 0x4a001c84},
9406 + {0x0000a554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
9407 + {0x0000a558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
9408 + {0x0000a55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
9409 + {0x0000a560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
9410 + {0x0000a564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9411 + {0x0000a568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9412 + {0x0000a56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9413 + {0x0000a570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9414 + {0x0000a574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9415 + {0x0000a578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9416 + {0x0000a57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
9417 + {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
9418 + {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
9419 + {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
9420 + {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
9421 + {0x0000a590, 0x15800028, 0x15800028, 0x0f800202, 0x0f800202},
9422 + {0x0000a594, 0x1b80002b, 0x1b80002b, 0x12800400, 0x12800400},
9423 + {0x0000a598, 0x1f820028, 0x1f820028, 0x16800402, 0x16800402},
9424 + {0x0000a59c, 0x2582002b, 0x2582002b, 0x19800404, 0x19800404},
9425 + {0x0000a5a0, 0x2a84002a, 0x2a84002a, 0x1c800603, 0x1c800603},
9426 + {0x0000a5a4, 0x2e86002a, 0x2e86002a, 0x21800a02, 0x21800a02},
9427 + {0x0000a5a8, 0x3382202d, 0x3382202d, 0x25800a04, 0x25800a04},
9428 + {0x0000a5ac, 0x3884202c, 0x3884202c, 0x28800a20, 0x28800a20},
9429 + {0x0000a5b0, 0x3c86202c, 0x3c86202c, 0x2c800e20, 0x2c800e20},
9430 + {0x0000a5b4, 0x4188202d, 0x4188202d, 0x30800e22, 0x30800e22},
9431 + {0x0000a5b8, 0x4586402d, 0x4586402d, 0x34800e24, 0x34800e24},
9432 + {0x0000a5bc, 0x4986222d, 0x4986222d, 0x38801640, 0x38801640},
9433 + {0x0000a5c0, 0x4d862231, 0x4d862231, 0x3c801660, 0x3c801660},
9434 + {0x0000a5c4, 0x50882231, 0x50882231, 0x3f801861, 0x3f801861},
9435 + {0x0000a5c8, 0x5688422e, 0x5688422e, 0x43801a81, 0x43801a81},
9436 + {0x0000a5cc, 0x5a88442e, 0x5a88442e, 0x47801a83, 0x47801a83},
9437 + {0x0000a5d0, 0x5e8a4431, 0x5e8a4431, 0x4a801c84, 0x4a801c84},
9438 + {0x0000a5d4, 0x648a4432, 0x648a4432, 0x4e801ce3, 0x4e801ce3},
9439 + {0x0000a5d8, 0x688a4434, 0x688a4434, 0x52801ce5, 0x52801ce5},
9440 + {0x0000a5dc, 0x6c8a6434, 0x6c8a6434, 0x56801ce9, 0x56801ce9},
9441 + {0x0000a5e0, 0x6f8a6633, 0x6f8a6633, 0x5a801ceb, 0x5a801ceb},
9442 + {0x0000a5e4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9443 + {0x0000a5e8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9444 + {0x0000a5ec, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9445 + {0x0000a5f0, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9446 + {0x0000a5f4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9447 + {0x0000a5f8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9448 + {0x0000a5fc, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
9449 + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9450 + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9451 + {0x0000a608, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
9452 + {0x0000a60c, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
9453 + {0x0000a610, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
9454 + {0x0000a614, 0x01804601, 0x01804601, 0x01404000, 0x01404000},
9455 + {0x0000a618, 0x01804601, 0x01804601, 0x01404501, 0x01404501},
9456 + {0x0000a61c, 0x01804601, 0x01804601, 0x02008501, 0x02008501},
9457 + {0x0000a620, 0x03408d02, 0x03408d02, 0x0280ca03, 0x0280ca03},
9458 + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
9459 + {0x0000a628, 0x03410d04, 0x03410d04, 0x04014c04, 0x04014c04},
9460 + {0x0000a62c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9461 + {0x0000a630, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9462 + {0x0000a634, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9463 + {0x0000a638, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9464 + {0x0000a63c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
9465 + {0x0000b2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
9466 + {0x0000b2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
9467 + {0x0000b2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
9468 + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
9469 + {0x0000c2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
9470 + {0x0000c2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
9471 + {0x0000c2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
9472 + {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
9473 + {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
9474 + {0x00016048, 0x65240001, 0x65240001, 0x66480001, 0x66480001},
9475 + {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9476 + {0x00016288, 0x05a2040a, 0x05a2040a, 0x05a20408, 0x05a20408},
9477 + {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
9478 + {0x00016448, 0x65240001, 0x65240001, 0x66480001, 0x66480001},
9479 + {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9480 + {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
9481 + {0x00016848, 0x65240001, 0x65240001, 0x66480001, 0x66480001},
9482 + {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9485 static const u32 ar9580_1p0_lowest_ob_db_tx_gain_table[][5] = {
9486 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9487 @@ -414,8 +531,6 @@ static const u32 ar9580_1p0_lowest_ob_db
9488 {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9491 -#define ar9580_1p0_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
9493 static const u32 ar9580_1p0_mac_core[][2] = {
9495 {0x00000008, 0x00000000},
9496 @@ -679,14 +794,6 @@ static const u32 ar9580_1p0_mixed_ob_db_
9497 {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9500 -#define ar9580_1p0_wo_xlna_rx_gain_table ar9300Common_wo_xlna_rx_gain_table_2p2
9502 -#define ar9580_1p0_soc_postamble ar9300_2p2_soc_postamble
9504 -#define ar9580_1p0_high_ob_db_tx_gain_table ar9300Modes_high_ob_db_tx_gain_table_2p2
9506 -#define ar9580_1p0_type5_tx_gain_table ar9300Modes_type5_tx_gain_table_2p2
9508 static const u32 ar9580_1p0_type6_tx_gain_table[][5] = {
9509 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9510 {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
9511 @@ -761,165 +868,271 @@ static const u32 ar9580_1p0_type6_tx_gai
9512 {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
9515 -static const u32 ar9580_1p0_soc_preamble[][2] = {
9516 +static const u32 ar9580_1p0_rx_gain_table[][2] = {
9518 - {0x000040a4, 0x00a0c1c9},
9519 - {0x00007008, 0x00000000},
9520 - {0x00007020, 0x00000000},
9521 - {0x00007034, 0x00000002},
9522 - {0x00007038, 0x000004c2},
9523 - {0x00007048, 0x00000008},
9526 -#define ar9580_1p0_rx_gain_table ar9462_common_rx_gain_table_2p0
9528 -static const u32 ar9580_1p0_radio_core[][2] = {
9529 - /* Addr allmodes */
9530 - {0x00016000, 0x36db6db6},
9531 - {0x00016004, 0x6db6db40},
9532 - {0x00016008, 0x73f00000},
9533 - {0x0001600c, 0x00000000},
9534 - {0x00016040, 0x7f80fff8},
9535 - {0x0001604c, 0x76d005b5},
9536 - {0x00016050, 0x556cf031},
9537 - {0x00016054, 0x13449440},
9538 - {0x00016058, 0x0c51c92c},
9539 - {0x0001605c, 0x3db7fffc},
9540 - {0x00016060, 0xfffffffc},
9541 - {0x00016064, 0x000f0278},
9542 - {0x0001606c, 0x6db60000},
9543 - {0x00016080, 0x00000000},
9544 - {0x00016084, 0x0e48048c},
9545 - {0x00016088, 0x54214514},
9546 - {0x0001608c, 0x119f481e},
9547 - {0x00016090, 0x24926490},
9548 - {0x00016098, 0xd2888888},
9549 - {0x000160a0, 0x0a108ffe},
9550 - {0x000160a4, 0x812fc370},
9551 - {0x000160a8, 0x423c8000},
9552 - {0x000160b4, 0x92480080},
9553 - {0x000160c0, 0x00adb6d0},
9554 - {0x000160c4, 0x6db6db60},
9555 - {0x000160c8, 0x6db6db6c},
9556 - {0x000160cc, 0x01e6c000},
9557 - {0x00016100, 0x3fffbe01},
9558 - {0x00016104, 0xfff80000},
9559 - {0x00016108, 0x00080010},
9560 - {0x00016144, 0x02084080},
9561 - {0x00016148, 0x00000000},
9562 - {0x00016280, 0x058a0001},
9563 - {0x00016284, 0x3d840208},
9564 - {0x00016288, 0x05a20408},
9565 - {0x0001628c, 0x00038c07},
9566 - {0x00016290, 0x00000004},
9567 - {0x00016294, 0x458aa14f},
9568 - {0x00016380, 0x00000000},
9569 - {0x00016384, 0x00000000},
9570 - {0x00016388, 0x00800700},
9571 - {0x0001638c, 0x00800700},
9572 - {0x00016390, 0x00800700},
9573 - {0x00016394, 0x00000000},
9574 - {0x00016398, 0x00000000},
9575 - {0x0001639c, 0x00000000},
9576 - {0x000163a0, 0x00000001},
9577 - {0x000163a4, 0x00000001},
9578 - {0x000163a8, 0x00000000},
9579 - {0x000163ac, 0x00000000},
9580 - {0x000163b0, 0x00000000},
9581 - {0x000163b4, 0x00000000},
9582 - {0x000163b8, 0x00000000},
9583 - {0x000163bc, 0x00000000},
9584 - {0x000163c0, 0x000000a0},
9585 - {0x000163c4, 0x000c0000},
9586 - {0x000163c8, 0x14021402},
9587 - {0x000163cc, 0x00001402},
9588 - {0x000163d0, 0x00000000},
9589 - {0x000163d4, 0x00000000},
9590 - {0x00016400, 0x36db6db6},
9591 - {0x00016404, 0x6db6db40},
9592 - {0x00016408, 0x73f00000},
9593 - {0x0001640c, 0x00000000},
9594 - {0x00016440, 0x7f80fff8},
9595 - {0x0001644c, 0x76d005b5},
9596 - {0x00016450, 0x556cf031},
9597 - {0x00016454, 0x13449440},
9598 - {0x00016458, 0x0c51c92c},
9599 - {0x0001645c, 0x3db7fffc},
9600 - {0x00016460, 0xfffffffc},
9601 - {0x00016464, 0x000f0278},
9602 - {0x0001646c, 0x6db60000},
9603 - {0x00016500, 0x3fffbe01},
9604 - {0x00016504, 0xfff80000},
9605 - {0x00016508, 0x00080010},
9606 - {0x00016544, 0x02084080},
9607 - {0x00016548, 0x00000000},
9608 - {0x00016780, 0x00000000},
9609 - {0x00016784, 0x00000000},
9610 - {0x00016788, 0x00800700},
9611 - {0x0001678c, 0x00800700},
9612 - {0x00016790, 0x00800700},
9613 - {0x00016794, 0x00000000},
9614 - {0x00016798, 0x00000000},
9615 - {0x0001679c, 0x00000000},
9616 - {0x000167a0, 0x00000001},
9617 - {0x000167a4, 0x00000001},
9618 - {0x000167a8, 0x00000000},
9619 - {0x000167ac, 0x00000000},
9620 - {0x000167b0, 0x00000000},
9621 - {0x000167b4, 0x00000000},
9622 - {0x000167b8, 0x00000000},
9623 - {0x000167bc, 0x00000000},
9624 - {0x000167c0, 0x000000a0},
9625 - {0x000167c4, 0x000c0000},
9626 - {0x000167c8, 0x14021402},
9627 - {0x000167cc, 0x00001402},
9628 - {0x000167d0, 0x00000000},
9629 - {0x000167d4, 0x00000000},
9630 - {0x00016800, 0x36db6db6},
9631 - {0x00016804, 0x6db6db40},
9632 - {0x00016808, 0x73f00000},
9633 - {0x0001680c, 0x00000000},
9634 - {0x00016840, 0x7f80fff8},
9635 - {0x0001684c, 0x76d005b5},
9636 - {0x00016850, 0x556cf031},
9637 - {0x00016854, 0x13449440},
9638 - {0x00016858, 0x0c51c92c},
9639 - {0x0001685c, 0x3db7fffc},
9640 - {0x00016860, 0xfffffffc},
9641 - {0x00016864, 0x000f0278},
9642 - {0x0001686c, 0x6db60000},
9643 - {0x00016900, 0x3fffbe01},
9644 - {0x00016904, 0xfff80000},
9645 - {0x00016908, 0x00080010},
9646 - {0x00016944, 0x02084080},
9647 - {0x00016948, 0x00000000},
9648 - {0x00016b80, 0x00000000},
9649 - {0x00016b84, 0x00000000},
9650 - {0x00016b88, 0x00800700},
9651 - {0x00016b8c, 0x00800700},
9652 - {0x00016b90, 0x00800700},
9653 - {0x00016b94, 0x00000000},
9654 - {0x00016b98, 0x00000000},
9655 - {0x00016b9c, 0x00000000},
9656 - {0x00016ba0, 0x00000001},
9657 - {0x00016ba4, 0x00000001},
9658 - {0x00016ba8, 0x00000000},
9659 - {0x00016bac, 0x00000000},
9660 - {0x00016bb0, 0x00000000},
9661 - {0x00016bb4, 0x00000000},
9662 - {0x00016bb8, 0x00000000},
9663 - {0x00016bbc, 0x00000000},
9664 - {0x00016bc0, 0x000000a0},
9665 - {0x00016bc4, 0x000c0000},
9666 - {0x00016bc8, 0x14021402},
9667 - {0x00016bcc, 0x00001402},
9668 - {0x00016bd0, 0x00000000},
9669 - {0x00016bd4, 0x00000000},
9670 + {0x0000a000, 0x00010000},
9671 + {0x0000a004, 0x00030002},
9672 + {0x0000a008, 0x00050004},
9673 + {0x0000a00c, 0x00810080},
9674 + {0x0000a010, 0x00830082},
9675 + {0x0000a014, 0x01810180},
9676 + {0x0000a018, 0x01830182},
9677 + {0x0000a01c, 0x01850184},
9678 + {0x0000a020, 0x01890188},
9679 + {0x0000a024, 0x018b018a},
9680 + {0x0000a028, 0x018d018c},
9681 + {0x0000a02c, 0x01910190},
9682 + {0x0000a030, 0x01930192},
9683 + {0x0000a034, 0x01950194},
9684 + {0x0000a038, 0x038a0196},
9685 + {0x0000a03c, 0x038c038b},
9686 + {0x0000a040, 0x0390038d},
9687 + {0x0000a044, 0x03920391},
9688 + {0x0000a048, 0x03940393},
9689 + {0x0000a04c, 0x03960395},
9690 + {0x0000a050, 0x00000000},
9691 + {0x0000a054, 0x00000000},
9692 + {0x0000a058, 0x00000000},
9693 + {0x0000a05c, 0x00000000},
9694 + {0x0000a060, 0x00000000},
9695 + {0x0000a064, 0x00000000},
9696 + {0x0000a068, 0x00000000},
9697 + {0x0000a06c, 0x00000000},
9698 + {0x0000a070, 0x00000000},
9699 + {0x0000a074, 0x00000000},
9700 + {0x0000a078, 0x00000000},
9701 + {0x0000a07c, 0x00000000},
9702 + {0x0000a080, 0x22222229},
9703 + {0x0000a084, 0x1d1d1d1d},
9704 + {0x0000a088, 0x1d1d1d1d},
9705 + {0x0000a08c, 0x1d1d1d1d},
9706 + {0x0000a090, 0x171d1d1d},
9707 + {0x0000a094, 0x11111717},
9708 + {0x0000a098, 0x00030311},
9709 + {0x0000a09c, 0x00000000},
9710 + {0x0000a0a0, 0x00000000},
9711 + {0x0000a0a4, 0x00000000},
9712 + {0x0000a0a8, 0x00000000},
9713 + {0x0000a0ac, 0x00000000},
9714 + {0x0000a0b0, 0x00000000},
9715 + {0x0000a0b4, 0x00000000},
9716 + {0x0000a0b8, 0x00000000},
9717 + {0x0000a0bc, 0x00000000},
9718 + {0x0000a0c0, 0x001f0000},
9719 + {0x0000a0c4, 0x01000101},
9720 + {0x0000a0c8, 0x011e011f},
9721 + {0x0000a0cc, 0x011c011d},
9722 + {0x0000a0d0, 0x02030204},
9723 + {0x0000a0d4, 0x02010202},
9724 + {0x0000a0d8, 0x021f0200},
9725 + {0x0000a0dc, 0x0302021e},
9726 + {0x0000a0e0, 0x03000301},
9727 + {0x0000a0e4, 0x031e031f},
9728 + {0x0000a0e8, 0x0402031d},
9729 + {0x0000a0ec, 0x04000401},
9730 + {0x0000a0f0, 0x041e041f},
9731 + {0x0000a0f4, 0x0502041d},
9732 + {0x0000a0f8, 0x05000501},
9733 + {0x0000a0fc, 0x051e051f},
9734 + {0x0000a100, 0x06010602},
9735 + {0x0000a104, 0x061f0600},
9736 + {0x0000a108, 0x061d061e},
9737 + {0x0000a10c, 0x07020703},
9738 + {0x0000a110, 0x07000701},
9739 + {0x0000a114, 0x00000000},
9740 + {0x0000a118, 0x00000000},
9741 + {0x0000a11c, 0x00000000},
9742 + {0x0000a120, 0x00000000},
9743 + {0x0000a124, 0x00000000},
9744 + {0x0000a128, 0x00000000},
9745 + {0x0000a12c, 0x00000000},
9746 + {0x0000a130, 0x00000000},
9747 + {0x0000a134, 0x00000000},
9748 + {0x0000a138, 0x00000000},
9749 + {0x0000a13c, 0x00000000},
9750 + {0x0000a140, 0x001f0000},
9751 + {0x0000a144, 0x01000101},
9752 + {0x0000a148, 0x011e011f},
9753 + {0x0000a14c, 0x011c011d},
9754 + {0x0000a150, 0x02030204},
9755 + {0x0000a154, 0x02010202},
9756 + {0x0000a158, 0x021f0200},
9757 + {0x0000a15c, 0x0302021e},
9758 + {0x0000a160, 0x03000301},
9759 + {0x0000a164, 0x031e031f},
9760 + {0x0000a168, 0x0402031d},
9761 + {0x0000a16c, 0x04000401},
9762 + {0x0000a170, 0x041e041f},
9763 + {0x0000a174, 0x0502041d},
9764 + {0x0000a178, 0x05000501},
9765 + {0x0000a17c, 0x051e051f},
9766 + {0x0000a180, 0x06010602},
9767 + {0x0000a184, 0x061f0600},
9768 + {0x0000a188, 0x061d061e},
9769 + {0x0000a18c, 0x07020703},
9770 + {0x0000a190, 0x07000701},
9771 + {0x0000a194, 0x00000000},
9772 + {0x0000a198, 0x00000000},
9773 + {0x0000a19c, 0x00000000},
9774 + {0x0000a1a0, 0x00000000},
9775 + {0x0000a1a4, 0x00000000},
9776 + {0x0000a1a8, 0x00000000},
9777 + {0x0000a1ac, 0x00000000},
9778 + {0x0000a1b0, 0x00000000},
9779 + {0x0000a1b4, 0x00000000},
9780 + {0x0000a1b8, 0x00000000},
9781 + {0x0000a1bc, 0x00000000},
9782 + {0x0000a1c0, 0x00000000},
9783 + {0x0000a1c4, 0x00000000},
9784 + {0x0000a1c8, 0x00000000},
9785 + {0x0000a1cc, 0x00000000},
9786 + {0x0000a1d0, 0x00000000},
9787 + {0x0000a1d4, 0x00000000},
9788 + {0x0000a1d8, 0x00000000},
9789 + {0x0000a1dc, 0x00000000},
9790 + {0x0000a1e0, 0x00000000},
9791 + {0x0000a1e4, 0x00000000},
9792 + {0x0000a1e8, 0x00000000},
9793 + {0x0000a1ec, 0x00000000},
9794 + {0x0000a1f0, 0x00000396},
9795 + {0x0000a1f4, 0x00000396},
9796 + {0x0000a1f8, 0x00000396},
9797 + {0x0000a1fc, 0x00000196},
9798 + {0x0000b000, 0x00010000},
9799 + {0x0000b004, 0x00030002},
9800 + {0x0000b008, 0x00050004},
9801 + {0x0000b00c, 0x00810080},
9802 + {0x0000b010, 0x00830082},
9803 + {0x0000b014, 0x01810180},
9804 + {0x0000b018, 0x01830182},
9805 + {0x0000b01c, 0x01850184},
9806 + {0x0000b020, 0x02810280},
9807 + {0x0000b024, 0x02830282},
9808 + {0x0000b028, 0x02850284},
9809 + {0x0000b02c, 0x02890288},
9810 + {0x0000b030, 0x028b028a},
9811 + {0x0000b034, 0x0388028c},
9812 + {0x0000b038, 0x038a0389},
9813 + {0x0000b03c, 0x038c038b},
9814 + {0x0000b040, 0x0390038d},
9815 + {0x0000b044, 0x03920391},
9816 + {0x0000b048, 0x03940393},
9817 + {0x0000b04c, 0x03960395},
9818 + {0x0000b050, 0x00000000},
9819 + {0x0000b054, 0x00000000},
9820 + {0x0000b058, 0x00000000},
9821 + {0x0000b05c, 0x00000000},
9822 + {0x0000b060, 0x00000000},
9823 + {0x0000b064, 0x00000000},
9824 + {0x0000b068, 0x00000000},
9825 + {0x0000b06c, 0x00000000},
9826 + {0x0000b070, 0x00000000},
9827 + {0x0000b074, 0x00000000},
9828 + {0x0000b078, 0x00000000},
9829 + {0x0000b07c, 0x00000000},
9830 + {0x0000b080, 0x23232323},
9831 + {0x0000b084, 0x21232323},
9832 + {0x0000b088, 0x19191c1e},
9833 + {0x0000b08c, 0x12141417},
9834 + {0x0000b090, 0x07070e0e},
9835 + {0x0000b094, 0x03030305},
9836 + {0x0000b098, 0x00000003},
9837 + {0x0000b09c, 0x00000000},
9838 + {0x0000b0a0, 0x00000000},
9839 + {0x0000b0a4, 0x00000000},
9840 + {0x0000b0a8, 0x00000000},
9841 + {0x0000b0ac, 0x00000000},
9842 + {0x0000b0b0, 0x00000000},
9843 + {0x0000b0b4, 0x00000000},
9844 + {0x0000b0b8, 0x00000000},
9845 + {0x0000b0bc, 0x00000000},
9846 + {0x0000b0c0, 0x003f0020},
9847 + {0x0000b0c4, 0x00400041},
9848 + {0x0000b0c8, 0x0140005f},
9849 + {0x0000b0cc, 0x0160015f},
9850 + {0x0000b0d0, 0x017e017f},
9851 + {0x0000b0d4, 0x02410242},
9852 + {0x0000b0d8, 0x025f0240},
9853 + {0x0000b0dc, 0x027f0260},
9854 + {0x0000b0e0, 0x0341027e},
9855 + {0x0000b0e4, 0x035f0340},
9856 + {0x0000b0e8, 0x037f0360},
9857 + {0x0000b0ec, 0x04400441},
9858 + {0x0000b0f0, 0x0460045f},
9859 + {0x0000b0f4, 0x0541047f},
9860 + {0x0000b0f8, 0x055f0540},
9861 + {0x0000b0fc, 0x057f0560},
9862 + {0x0000b100, 0x06400641},
9863 + {0x0000b104, 0x0660065f},
9864 + {0x0000b108, 0x067e067f},
9865 + {0x0000b10c, 0x07410742},
9866 + {0x0000b110, 0x075f0740},
9867 + {0x0000b114, 0x077f0760},
9868 + {0x0000b118, 0x07800781},
9869 + {0x0000b11c, 0x07a0079f},
9870 + {0x0000b120, 0x07c107bf},
9871 + {0x0000b124, 0x000007c0},
9872 + {0x0000b128, 0x00000000},
9873 + {0x0000b12c, 0x00000000},
9874 + {0x0000b130, 0x00000000},
9875 + {0x0000b134, 0x00000000},
9876 + {0x0000b138, 0x00000000},
9877 + {0x0000b13c, 0x00000000},
9878 + {0x0000b140, 0x003f0020},
9879 + {0x0000b144, 0x00400041},
9880 + {0x0000b148, 0x0140005f},
9881 + {0x0000b14c, 0x0160015f},
9882 + {0x0000b150, 0x017e017f},
9883 + {0x0000b154, 0x02410242},
9884 + {0x0000b158, 0x025f0240},
9885 + {0x0000b15c, 0x027f0260},
9886 + {0x0000b160, 0x0341027e},
9887 + {0x0000b164, 0x035f0340},
9888 + {0x0000b168, 0x037f0360},
9889 + {0x0000b16c, 0x04400441},
9890 + {0x0000b170, 0x0460045f},
9891 + {0x0000b174, 0x0541047f},
9892 + {0x0000b178, 0x055f0540},
9893 + {0x0000b17c, 0x057f0560},
9894 + {0x0000b180, 0x06400641},
9895 + {0x0000b184, 0x0660065f},
9896 + {0x0000b188, 0x067e067f},
9897 + {0x0000b18c, 0x07410742},
9898 + {0x0000b190, 0x075f0740},
9899 + {0x0000b194, 0x077f0760},
9900 + {0x0000b198, 0x07800781},
9901 + {0x0000b19c, 0x07a0079f},
9902 + {0x0000b1a0, 0x07c107bf},
9903 + {0x0000b1a4, 0x000007c0},
9904 + {0x0000b1a8, 0x00000000},
9905 + {0x0000b1ac, 0x00000000},
9906 + {0x0000b1b0, 0x00000000},
9907 + {0x0000b1b4, 0x00000000},
9908 + {0x0000b1b8, 0x00000000},
9909 + {0x0000b1bc, 0x00000000},
9910 + {0x0000b1c0, 0x00000000},
9911 + {0x0000b1c4, 0x00000000},
9912 + {0x0000b1c8, 0x00000000},
9913 + {0x0000b1cc, 0x00000000},
9914 + {0x0000b1d0, 0x00000000},
9915 + {0x0000b1d4, 0x00000000},
9916 + {0x0000b1d8, 0x00000000},
9917 + {0x0000b1dc, 0x00000000},
9918 + {0x0000b1e0, 0x00000000},
9919 + {0x0000b1e4, 0x00000000},
9920 + {0x0000b1e8, 0x00000000},
9921 + {0x0000b1ec, 0x00000000},
9922 + {0x0000b1f0, 0x00000396},
9923 + {0x0000b1f4, 0x00000396},
9924 + {0x0000b1f8, 0x00000396},
9925 + {0x0000b1fc, 0x00000196},
9928 static const u32 ar9580_1p0_baseband_postamble[][5] = {
9929 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
9930 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
9931 + {0x00009814, 0x3280c00a, 0x3280c00a, 0x3280c00a, 0x3280c00a},
9932 + {0x00009818, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9933 {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
9934 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
9935 {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
9936 @@ -956,7 +1169,7 @@ static const u32 ar9580_1p0_baseband_pos
9937 {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
9938 {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
9939 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
9940 - {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
9941 + {0x0000a2d0, 0x00041983, 0x00041983, 0x00041981, 0x00041982},
9942 {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
9943 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
9944 {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
9945 @@ -994,4 +1207,13 @@ static const u32 ar9580_1p0_pcie_phy_pll
9946 {0x00004044, 0x00000000},
9949 +static const u32 ar9580_1p0_baseband_postamble_dfs_channel[][3] = {
9951 + {0x00009814, 0x3400c00f, 0x3400c00f},
9952 + {0x00009824, 0x5ac668d0, 0x5ac668d0},
9953 + {0x00009828, 0x06903080, 0x06903080},
9954 + {0x00009e0c, 0x6d4000e2, 0x6d4000e2},
9955 + {0x00009e14, 0x37b9625e, 0x37b9625e},
9958 #endif /* INITVALS_9580_1P0_H */
9959 --- a/drivers/net/wireless/ath/ath9k/reg.h
9960 +++ b/drivers/net/wireless/ath/ath9k/reg.h
9962 #define AR_SREV_REVISION_9462_21 3
9963 #define AR_SREV_VERSION_9565 0x2C0
9964 #define AR_SREV_REVISION_9565_10 0
9965 +#define AR_SREV_REVISION_9565_101 1
9966 +#define AR_SREV_REVISION_9565_11 2
9967 #define AR_SREV_VERSION_9550 0x400
9969 #define AR_SREV_5416(_ah) \
9972 #define AR_SREV_9330(_ah) \
9973 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9330))
9974 -#define AR_SREV_9330_10(_ah) \
9975 - (AR_SREV_9330((_ah)) && \
9976 - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_10))
9977 #define AR_SREV_9330_11(_ah) \
9978 (AR_SREV_9330((_ah)) && \
9979 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_11))
9980 @@ -927,10 +926,18 @@
9982 #define AR_SREV_9565(_ah) \
9983 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565))
9985 #define AR_SREV_9565_10(_ah) \
9986 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
9987 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10))
9988 +#define AR_SREV_9565_101(_ah) \
9989 + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
9990 + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101))
9991 +#define AR_SREV_9565_11(_ah) \
9992 + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
9993 + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11))
9994 +#define AR_SREV_9565_11_OR_LATER(_ah) \
9995 + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
9996 + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11))
9998 #define AR_SREV_9550(_ah) \
9999 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550))
10000 --- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
10001 +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
10003 #ifndef INITVALS_9330_1P1_H
10004 #define INITVALS_9330_1P1_H
10006 +#define ar9331_1p1_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
10008 +#define ar9331_modes_high_power_tx_gain_1p1 ar9331_modes_lowest_ob_db_tx_gain_1p1
10010 static const u32 ar9331_1p1_baseband_postamble[][5] = {
10011 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10012 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
10013 @@ -55,7 +59,7 @@ static const u32 ar9331_1p1_baseband_pos
10014 {0x0000a284, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10015 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10016 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10017 - {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
10018 + {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18},
10019 {0x0000a2d0, 0x00071982, 0x00071982, 0x00071982, 0x00071982},
10020 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
10021 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10022 @@ -252,7 +256,7 @@ static const u32 ar9331_modes_low_ob_db_
10023 {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
10024 {0x0000a2e4, 0xfffff000, 0xfffff000, 0xfffff000, 0xfffff000},
10025 {0x0000a2e8, 0xfffe0000, 0xfffe0000, 0xfffe0000, 0xfffe0000},
10026 - {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d0, 0x000050d0},
10027 + {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d4, 0x000050d4},
10028 {0x0000a500, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
10029 {0x0000a504, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
10030 {0x0000a508, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
10031 @@ -337,8 +341,6 @@ static const u32 ar9331_modes_low_ob_db_
10032 {0x00016284, 0x14d3f000, 0x14d3f000, 0x14d3f000, 0x14d3f000},
10035 -#define ar9331_1p1_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
10037 static const u32 ar9331_1p1_xtal_25M[][2] = {
10038 /* Addr allmodes */
10039 {0x00007038, 0x000002f8},
10040 @@ -373,17 +375,17 @@ static const u32 ar9331_1p1_radio_core[]
10041 {0x000160b4, 0x92480040},
10042 {0x000160c0, 0x006db6db},
10043 {0x000160c4, 0x0186db60},
10044 - {0x000160c8, 0x6db4db6c},
10045 + {0x000160c8, 0x6db6db6c},
10046 {0x000160cc, 0x6de6c300},
10047 {0x000160d0, 0x14500820},
10048 {0x00016100, 0x04cb0001},
10049 {0x00016104, 0xfff80015},
10050 {0x00016108, 0x00080010},
10051 {0x0001610c, 0x00170000},
10052 - {0x00016140, 0x10800000},
10053 + {0x00016140, 0x50804000},
10054 {0x00016144, 0x01884080},
10055 {0x00016148, 0x000080c0},
10056 - {0x00016280, 0x01000015},
10057 + {0x00016280, 0x01001015},
10058 {0x00016284, 0x14d20000},
10059 {0x00016288, 0x00318000},
10060 {0x0001628c, 0x50000000},
10061 @@ -622,12 +624,12 @@ static const u32 ar9331_1p1_baseband_cor
10062 {0x0000a370, 0x00000000},
10063 {0x0000a390, 0x00000001},
10064 {0x0000a394, 0x00000444},
10065 - {0x0000a398, 0x001f0e0f},
10066 - {0x0000a39c, 0x0075393f},
10067 - {0x0000a3a0, 0xb79f6427},
10068 - {0x0000a3a4, 0x00000000},
10069 - {0x0000a3a8, 0xaaaaaaaa},
10070 - {0x0000a3ac, 0x3c466478},
10071 + {0x0000a398, 0x00000000},
10072 + {0x0000a39c, 0x210d0401},
10073 + {0x0000a3a0, 0xab9a7144},
10074 + {0x0000a3a4, 0x00000011},
10075 + {0x0000a3a8, 0x3c3c003d},
10076 + {0x0000a3ac, 0x30310030},
10077 {0x0000a3c0, 0x20202020},
10078 {0x0000a3c4, 0x22222220},
10079 {0x0000a3c8, 0x20200020},
10080 @@ -686,100 +688,18 @@ static const u32 ar9331_1p1_baseband_cor
10081 {0x0000a7dc, 0x00000001},
10084 -static const u32 ar9331_modes_high_power_tx_gain_1p1[][5] = {
10085 +static const u32 ar9331_1p1_mac_postamble[][5] = {
10086 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10087 - {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
10088 - {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52},
10089 - {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
10090 - {0x0000a2e4, 0xfffff000, 0xfffff000, 0xfffff000, 0xfffff000},
10091 - {0x0000a2e8, 0xfffe0000, 0xfffe0000, 0xfffe0000, 0xfffe0000},
10092 - {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d0, 0x000050d0},
10093 - {0x0000a500, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
10094 - {0x0000a504, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
10095 - {0x0000a508, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
10096 - {0x0000a50c, 0x11062202, 0x11062202, 0x0d000200, 0x0d000200},
10097 - {0x0000a510, 0x17022e00, 0x17022e00, 0x11000202, 0x11000202},
10098 - {0x0000a514, 0x1d000ec2, 0x1d000ec2, 0x15000400, 0x15000400},
10099 - {0x0000a518, 0x25020ec0, 0x25020ec0, 0x19000402, 0x19000402},
10100 - {0x0000a51c, 0x2b020ec3, 0x2b020ec3, 0x1d000404, 0x1d000404},
10101 - {0x0000a520, 0x2f001f04, 0x2f001f04, 0x23000a00, 0x23000a00},
10102 - {0x0000a524, 0x35001fc4, 0x35001fc4, 0x27000a02, 0x27000a02},
10103 - {0x0000a528, 0x3c022f04, 0x3c022f04, 0x2b000a04, 0x2b000a04},
10104 - {0x0000a52c, 0x41023e85, 0x41023e85, 0x2d000a20, 0x2d000a20},
10105 - {0x0000a530, 0x48023ec6, 0x48023ec6, 0x31000a22, 0x31000a22},
10106 - {0x0000a534, 0x4d023f01, 0x4d023f01, 0x35000a24, 0x35000a24},
10107 - {0x0000a538, 0x53023f4b, 0x53023f4b, 0x38000a43, 0x38000a43},
10108 - {0x0000a53c, 0x5a027f09, 0x5a027f09, 0x3b000e42, 0x3b000e42},
10109 - {0x0000a540, 0x5f027fc9, 0x5f027fc9, 0x3f000e44, 0x3f000e44},
10110 - {0x0000a544, 0x6502feca, 0x6502feca, 0x42000e64, 0x42000e64},
10111 - {0x0000a548, 0x6b02ff4a, 0x6b02ff4a, 0x46000e66, 0x46000e66},
10112 - {0x0000a54c, 0x7203feca, 0x7203feca, 0x4a000ea6, 0x4a000ea6},
10113 - {0x0000a550, 0x7703ff0b, 0x7703ff0b, 0x4a000ea6, 0x4a000ea6},
10114 - {0x0000a554, 0x7d06ffcb, 0x7d06ffcb, 0x4a000ea6, 0x4a000ea6},
10115 - {0x0000a558, 0x8407ff0b, 0x8407ff0b, 0x4a000ea6, 0x4a000ea6},
10116 - {0x0000a55c, 0x8907ffcb, 0x8907ffcb, 0x4a000ea6, 0x4a000ea6},
10117 - {0x0000a560, 0x900fff0b, 0x900fff0b, 0x4a000ea6, 0x4a000ea6},
10118 - {0x0000a564, 0x960fffcb, 0x960fffcb, 0x4a000ea6, 0x4a000ea6},
10119 - {0x0000a568, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
10120 - {0x0000a56c, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
10121 - {0x0000a570, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
10122 - {0x0000a574, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
10123 - {0x0000a578, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
10124 - {0x0000a57c, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
10125 - {0x0000a580, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
10126 - {0x0000a584, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
10127 - {0x0000a588, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
10128 - {0x0000a58c, 0x11062202, 0x11062202, 0x0b000200, 0x0b000200},
10129 - {0x0000a590, 0x17022e00, 0x17022e00, 0x0f000202, 0x0f000202},
10130 - {0x0000a594, 0x1d000ec2, 0x1d000ec2, 0x11000400, 0x11000400},
10131 - {0x0000a598, 0x25020ec0, 0x25020ec0, 0x15000402, 0x15000402},
10132 - {0x0000a59c, 0x2b020ec3, 0x2b020ec3, 0x19000404, 0x19000404},
10133 - {0x0000a5a0, 0x2f001f04, 0x2f001f04, 0x1b000603, 0x1b000603},
10134 - {0x0000a5a4, 0x35001fc4, 0x35001fc4, 0x1f000a02, 0x1f000a02},
10135 - {0x0000a5a8, 0x3c022f04, 0x3c022f04, 0x23000a04, 0x23000a04},
10136 - {0x0000a5ac, 0x41023e85, 0x41023e85, 0x26000a20, 0x26000a20},
10137 - {0x0000a5b0, 0x48023ec6, 0x48023ec6, 0x2a000e20, 0x2a000e20},
10138 - {0x0000a5b4, 0x4d023f01, 0x4d023f01, 0x2e000e22, 0x2e000e22},
10139 - {0x0000a5b8, 0x53023f4b, 0x53023f4b, 0x31000e24, 0x31000e24},
10140 - {0x0000a5bc, 0x5a027f09, 0x5a027f09, 0x34001640, 0x34001640},
10141 - {0x0000a5c0, 0x5f027fc9, 0x5f027fc9, 0x38001660, 0x38001660},
10142 - {0x0000a5c4, 0x6502feca, 0x6502feca, 0x3b001861, 0x3b001861},
10143 - {0x0000a5c8, 0x6b02ff4a, 0x6b02ff4a, 0x3e001a81, 0x3e001a81},
10144 - {0x0000a5cc, 0x7203feca, 0x7203feca, 0x42001a83, 0x42001a83},
10145 - {0x0000a5d0, 0x7703ff0b, 0x7703ff0b, 0x44001c84, 0x44001c84},
10146 - {0x0000a5d4, 0x7d06ffcb, 0x7d06ffcb, 0x48001ce3, 0x48001ce3},
10147 - {0x0000a5d8, 0x8407ff0b, 0x8407ff0b, 0x4c001ce5, 0x4c001ce5},
10148 - {0x0000a5dc, 0x8907ffcb, 0x8907ffcb, 0x50001ce9, 0x50001ce9},
10149 - {0x0000a5e0, 0x900fff0b, 0x900fff0b, 0x54001ceb, 0x54001ceb},
10150 - {0x0000a5e4, 0x960fffcb, 0x960fffcb, 0x56001eec, 0x56001eec},
10151 - {0x0000a5e8, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
10152 - {0x0000a5ec, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
10153 - {0x0000a5f0, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
10154 - {0x0000a5f4, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
10155 - {0x0000a5f8, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
10156 - {0x0000a5fc, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
10157 - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10158 - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10159 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10160 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10161 - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10162 - {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
10163 - {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
10164 - {0x0000a61c, 0x02008802, 0x02008802, 0x02008802, 0x02008802},
10165 - {0x0000a620, 0x0280c802, 0x0280c802, 0x0280c802, 0x0280c802},
10166 - {0x0000a624, 0x03010a03, 0x03010a03, 0x03010a03, 0x03010a03},
10167 - {0x0000a628, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
10168 - {0x0000a62c, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
10169 - {0x0000a630, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
10170 - {0x0000a634, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
10171 - {0x0000a638, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
10172 - {0x0000a63c, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
10173 - {0x00016044, 0x034922db, 0x034922db, 0x034922db, 0x034922db},
10174 - {0x00016284, 0x14d3f000, 0x14d3f000, 0x14d3f000, 0x14d3f000},
10175 + {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
10176 + {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
10177 + {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
10178 + {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
10179 + {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
10180 + {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
10181 + {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
10182 + {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
10185 -#define ar9331_1p1_mac_postamble ar9300_2p2_mac_postamble
10187 static const u32 ar9331_1p1_soc_preamble[][2] = {
10188 /* Addr allmodes */
10189 {0x00007020, 0x00000000},
10190 --- a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
10191 +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
10193 #ifndef INITVALS_9330_1P2_H
10194 #define INITVALS_9330_1P2_H
10196 +#define ar9331_modes_high_power_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
10198 +#define ar9331_modes_low_ob_db_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
10200 +#define ar9331_modes_lowest_ob_db_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
10202 +#define ar9331_1p2_baseband_core_txfir_coeff_japan_2484 ar9331_1p1_baseband_core_txfir_coeff_japan_2484
10204 +#define ar9331_1p2_xtal_25M ar9331_1p1_xtal_25M
10206 +#define ar9331_1p2_xtal_40M ar9331_1p1_xtal_40M
10208 +#define ar9331_1p2_soc_postamble ar9331_1p1_soc_postamble
10210 +#define ar9331_1p2_mac_postamble ar9331_1p1_mac_postamble
10212 +#define ar9331_1p2_soc_preamble ar9331_1p1_soc_preamble
10214 +#define ar9331_1p2_mac_core ar9331_1p1_mac_core
10216 +#define ar9331_common_wo_xlna_rx_gain_1p2 ar9331_common_wo_xlna_rx_gain_1p1
10218 static const u32 ar9331_modes_high_ob_db_tx_gain_1p2[][5] = {
10219 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10220 {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d7, 0x000050d7},
10221 @@ -103,57 +125,6 @@ static const u32 ar9331_modes_high_ob_db
10222 {0x0000a63c, 0x04011004, 0x04011004, 0x04011004, 0x04011004},
10225 -#define ar9331_modes_high_power_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
10227 -#define ar9331_modes_low_ob_db_tx_gain_1p2 ar9331_modes_high_power_tx_gain_1p2
10229 -#define ar9331_modes_lowest_ob_db_tx_gain_1p2 ar9331_modes_low_ob_db_tx_gain_1p2
10231 -static const u32 ar9331_1p2_baseband_postamble[][5] = {
10232 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10233 - {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
10234 - {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
10235 - {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
10236 - {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
10237 - {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
10238 - {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c},
10239 - {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044},
10240 - {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4},
10241 - {0x00009e04, 0x00182020, 0x00182020, 0x00182020, 0x00182020},
10242 - {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
10243 - {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e},
10244 - {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e},
10245 - {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10246 - {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
10247 - {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
10248 - {0x00009e2c, 0x0000001c, 0x0000001c, 0x00003221, 0x00003221},
10249 - {0x00009e3c, 0xcf946222, 0xcf946222, 0xcf946222, 0xcf946222},
10250 - {0x00009e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
10251 - {0x00009e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
10252 - {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
10253 - {0x0000a204, 0x00003fc0, 0x00003fc4, 0x00003fc4, 0x00003fc0},
10254 - {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
10255 - {0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b},
10256 - {0x0000a234, 0x00000fff, 0x00000fff, 0x10000fff, 0x00000fff},
10257 - {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
10258 - {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
10259 - {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
10260 - {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
10261 - {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
10262 - {0x0000a260, 0x3a021501, 0x3a021501, 0x3a021501, 0x3a021501},
10263 - {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
10264 - {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
10265 - {0x0000a284, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10266 - {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10267 - {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10268 - {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
10269 - {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981},
10270 - {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
10271 - {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10272 - {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
10273 - {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10276 static const u32 ar9331_1p2_radio_core[][2] = {
10277 /* Addr allmodes */
10278 {0x00016000, 0x36db6db6},
10279 @@ -219,24 +190,318 @@ static const u32 ar9331_1p2_radio_core[]
10280 {0x000163d4, 0x00000000},
10283 -#define ar9331_1p2_baseband_core_txfir_coeff_japan_2484 ar9331_1p1_baseband_core_txfir_coeff_japan_2484
10285 -#define ar9331_1p2_xtal_25M ar9331_1p1_xtal_25M
10287 -#define ar9331_1p2_xtal_40M ar9331_1p1_xtal_40M
10289 -#define ar9331_1p2_baseband_core ar9331_1p1_baseband_core
10291 -#define ar9331_1p2_soc_postamble ar9331_1p1_soc_postamble
10293 -#define ar9331_1p2_mac_postamble ar9331_1p1_mac_postamble
10295 -#define ar9331_1p2_soc_preamble ar9331_1p1_soc_preamble
10297 -#define ar9331_1p2_mac_core ar9331_1p1_mac_core
10298 +static const u32 ar9331_1p2_baseband_core[][2] = {
10299 + /* Addr allmodes */
10300 + {0x00009800, 0xafe68e30},
10301 + {0x00009804, 0xfd14e000},
10302 + {0x00009808, 0x9c0a8f6b},
10303 + {0x0000980c, 0x04800000},
10304 + {0x00009814, 0x9280c00a},
10305 + {0x00009818, 0x00000000},
10306 + {0x0000981c, 0x00020028},
10307 + {0x00009834, 0x5f3ca3de},
10308 + {0x00009838, 0x0108ecff},
10309 + {0x0000983c, 0x14750600},
10310 + {0x00009880, 0x201fff00},
10311 + {0x00009884, 0x00001042},
10312 + {0x000098a4, 0x00200400},
10313 + {0x000098b0, 0x32840bbe},
10314 + {0x000098d0, 0x004b6a8e},
10315 + {0x000098d4, 0x00000820},
10316 + {0x000098dc, 0x00000000},
10317 + {0x000098f0, 0x00000000},
10318 + {0x000098f4, 0x00000000},
10319 + {0x00009c04, 0x00000000},
10320 + {0x00009c08, 0x03200000},
10321 + {0x00009c0c, 0x00000000},
10322 + {0x00009c10, 0x00000000},
10323 + {0x00009c14, 0x00046384},
10324 + {0x00009c18, 0x05b6b440},
10325 + {0x00009c1c, 0x00b6b440},
10326 + {0x00009d00, 0xc080a333},
10327 + {0x00009d04, 0x40206c10},
10328 + {0x00009d08, 0x009c4060},
10329 + {0x00009d0c, 0x1883800a},
10330 + {0x00009d10, 0x01834061},
10331 + {0x00009d14, 0x00c00400},
10332 + {0x00009d18, 0x00000000},
10333 + {0x00009e08, 0x0038233c},
10334 + {0x00009e24, 0x9927b515},
10335 + {0x00009e28, 0x12ef0200},
10336 + {0x00009e30, 0x06336f77},
10337 + {0x00009e34, 0x6af6532f},
10338 + {0x00009e38, 0x0cc80c00},
10339 + {0x00009e40, 0x0d261820},
10340 + {0x00009e4c, 0x00001004},
10341 + {0x00009e50, 0x00ff03f1},
10342 + {0x00009fc0, 0x803e4788},
10343 + {0x00009fc4, 0x0001efb5},
10344 + {0x00009fcc, 0x40000014},
10345 + {0x0000a20c, 0x00000000},
10346 + {0x0000a220, 0x00000000},
10347 + {0x0000a224, 0x00000000},
10348 + {0x0000a228, 0x10002310},
10349 + {0x0000a23c, 0x00000000},
10350 + {0x0000a244, 0x0c000000},
10351 + {0x0000a2a0, 0x00000001},
10352 + {0x0000a2c0, 0x00000001},
10353 + {0x0000a2c8, 0x00000000},
10354 + {0x0000a2cc, 0x18c43433},
10355 + {0x0000a2d4, 0x00000000},
10356 + {0x0000a2dc, 0x00000000},
10357 + {0x0000a2e0, 0x00000000},
10358 + {0x0000a2e4, 0x00000000},
10359 + {0x0000a2e8, 0x00000000},
10360 + {0x0000a2ec, 0x00000000},
10361 + {0x0000a2f0, 0x00000000},
10362 + {0x0000a2f4, 0x00000000},
10363 + {0x0000a2f8, 0x00000000},
10364 + {0x0000a344, 0x00000000},
10365 + {0x0000a34c, 0x00000000},
10366 + {0x0000a350, 0x0000a000},
10367 + {0x0000a364, 0x00000000},
10368 + {0x0000a370, 0x00000000},
10369 + {0x0000a390, 0x00000001},
10370 + {0x0000a394, 0x00000444},
10371 + {0x0000a398, 0x001f0e0f},
10372 + {0x0000a39c, 0x0075393f},
10373 + {0x0000a3a0, 0xb79f6427},
10374 + {0x0000a3a4, 0x00000000},
10375 + {0x0000a3a8, 0xaaaaaaaa},
10376 + {0x0000a3ac, 0x3c466478},
10377 + {0x0000a3c0, 0x20202020},
10378 + {0x0000a3c4, 0x22222220},
10379 + {0x0000a3c8, 0x20200020},
10380 + {0x0000a3cc, 0x20202020},
10381 + {0x0000a3d0, 0x20202020},
10382 + {0x0000a3d4, 0x20202020},
10383 + {0x0000a3d8, 0x20202020},
10384 + {0x0000a3dc, 0x20202020},
10385 + {0x0000a3e0, 0x20202020},
10386 + {0x0000a3e4, 0x20202020},
10387 + {0x0000a3e8, 0x20202020},
10388 + {0x0000a3ec, 0x20202020},
10389 + {0x0000a3f0, 0x00000000},
10390 + {0x0000a3f4, 0x00000006},
10391 + {0x0000a3f8, 0x0cdbd380},
10392 + {0x0000a3fc, 0x000f0f01},
10393 + {0x0000a400, 0x8fa91f01},
10394 + {0x0000a404, 0x00000000},
10395 + {0x0000a408, 0x0e79e5c6},
10396 + {0x0000a40c, 0x00820820},
10397 + {0x0000a414, 0x1ce739ce},
10398 + {0x0000a418, 0x2d001dce},
10399 + {0x0000a41c, 0x1ce739ce},
10400 + {0x0000a420, 0x000001ce},
10401 + {0x0000a424, 0x1ce739ce},
10402 + {0x0000a428, 0x000001ce},
10403 + {0x0000a42c, 0x1ce739ce},
10404 + {0x0000a430, 0x1ce739ce},
10405 + {0x0000a434, 0x00000000},
10406 + {0x0000a438, 0x00001801},
10407 + {0x0000a43c, 0x00000000},
10408 + {0x0000a440, 0x00000000},
10409 + {0x0000a444, 0x00000000},
10410 + {0x0000a448, 0x04000000},
10411 + {0x0000a44c, 0x00000001},
10412 + {0x0000a450, 0x00010000},
10413 + {0x0000a458, 0x00000000},
10414 + {0x0000a640, 0x00000000},
10415 + {0x0000a644, 0x3fad9d74},
10416 + {0x0000a648, 0x0048060a},
10417 + {0x0000a64c, 0x00003c37},
10418 + {0x0000a670, 0x03020100},
10419 + {0x0000a674, 0x09080504},
10420 + {0x0000a678, 0x0d0c0b0a},
10421 + {0x0000a67c, 0x13121110},
10422 + {0x0000a680, 0x31301514},
10423 + {0x0000a684, 0x35343332},
10424 + {0x0000a688, 0x00000036},
10425 + {0x0000a690, 0x00000838},
10426 + {0x0000a7c0, 0x00000000},
10427 + {0x0000a7c4, 0xfffffffc},
10428 + {0x0000a7c8, 0x00000000},
10429 + {0x0000a7cc, 0x00000000},
10430 + {0x0000a7d0, 0x00000000},
10431 + {0x0000a7d4, 0x00000004},
10432 + {0x0000a7dc, 0x00000001},
10435 -#define ar9331_common_wo_xlna_rx_gain_1p2 ar9331_common_wo_xlna_rx_gain_1p1
10436 +static const u32 ar9331_1p2_baseband_postamble[][5] = {
10437 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10438 + {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
10439 + {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
10440 + {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
10441 + {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
10442 + {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
10443 + {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c},
10444 + {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044},
10445 + {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4},
10446 + {0x00009e04, 0x00182020, 0x00182020, 0x00182020, 0x00182020},
10447 + {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
10448 + {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e},
10449 + {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e},
10450 + {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10451 + {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
10452 + {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
10453 + {0x00009e2c, 0x0000001c, 0x0000001c, 0x00003221, 0x00003221},
10454 + {0x00009e3c, 0xcf946222, 0xcf946222, 0xcf946222, 0xcf946222},
10455 + {0x00009e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
10456 + {0x00009e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
10457 + {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
10458 + {0x0000a204, 0x00003fc0, 0x00003fc4, 0x00003fc4, 0x00003fc0},
10459 + {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
10460 + {0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b},
10461 + {0x0000a234, 0x00000fff, 0x00000fff, 0x10000fff, 0x00000fff},
10462 + {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
10463 + {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
10464 + {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
10465 + {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
10466 + {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
10467 + {0x0000a260, 0x3a021501, 0x3a021501, 0x3a021501, 0x3a021501},
10468 + {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
10469 + {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
10470 + {0x0000a284, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10471 + {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10472 + {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10473 + {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
10474 + {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981},
10475 + {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
10476 + {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10477 + {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
10478 + {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
10481 -#define ar9331_common_rx_gain_1p2 ar9485_common_rx_gain_1_1
10482 +static const u32 ar9331_common_rx_gain_1p2[][2] = {
10483 + /* Addr allmodes */
10484 + {0x0000a000, 0x00010000},
10485 + {0x0000a004, 0x00030002},
10486 + {0x0000a008, 0x00050004},
10487 + {0x0000a00c, 0x00810080},
10488 + {0x0000a010, 0x01800082},
10489 + {0x0000a014, 0x01820181},
10490 + {0x0000a018, 0x01840183},
10491 + {0x0000a01c, 0x01880185},
10492 + {0x0000a020, 0x018a0189},
10493 + {0x0000a024, 0x02850284},
10494 + {0x0000a028, 0x02890288},
10495 + {0x0000a02c, 0x03850384},
10496 + {0x0000a030, 0x03890388},
10497 + {0x0000a034, 0x038b038a},
10498 + {0x0000a038, 0x038d038c},
10499 + {0x0000a03c, 0x03910390},
10500 + {0x0000a040, 0x03930392},
10501 + {0x0000a044, 0x03950394},
10502 + {0x0000a048, 0x00000396},
10503 + {0x0000a04c, 0x00000000},
10504 + {0x0000a050, 0x00000000},
10505 + {0x0000a054, 0x00000000},
10506 + {0x0000a058, 0x00000000},
10507 + {0x0000a05c, 0x00000000},
10508 + {0x0000a060, 0x00000000},
10509 + {0x0000a064, 0x00000000},
10510 + {0x0000a068, 0x00000000},
10511 + {0x0000a06c, 0x00000000},
10512 + {0x0000a070, 0x00000000},
10513 + {0x0000a074, 0x00000000},
10514 + {0x0000a078, 0x00000000},
10515 + {0x0000a07c, 0x00000000},
10516 + {0x0000a080, 0x28282828},
10517 + {0x0000a084, 0x28282828},
10518 + {0x0000a088, 0x28282828},
10519 + {0x0000a08c, 0x28282828},
10520 + {0x0000a090, 0x28282828},
10521 + {0x0000a094, 0x21212128},
10522 + {0x0000a098, 0x171c1c1c},
10523 + {0x0000a09c, 0x02020212},
10524 + {0x0000a0a0, 0x00000202},
10525 + {0x0000a0a4, 0x00000000},
10526 + {0x0000a0a8, 0x00000000},
10527 + {0x0000a0ac, 0x00000000},
10528 + {0x0000a0b0, 0x00000000},
10529 + {0x0000a0b4, 0x00000000},
10530 + {0x0000a0b8, 0x00000000},
10531 + {0x0000a0bc, 0x00000000},
10532 + {0x0000a0c0, 0x001f0000},
10533 + {0x0000a0c4, 0x111f1100},
10534 + {0x0000a0c8, 0x111d111e},
10535 + {0x0000a0cc, 0x111b111c},
10536 + {0x0000a0d0, 0x22032204},
10537 + {0x0000a0d4, 0x22012202},
10538 + {0x0000a0d8, 0x221f2200},
10539 + {0x0000a0dc, 0x221d221e},
10540 + {0x0000a0e0, 0x33013302},
10541 + {0x0000a0e4, 0x331f3300},
10542 + {0x0000a0e8, 0x4402331e},
10543 + {0x0000a0ec, 0x44004401},
10544 + {0x0000a0f0, 0x441e441f},
10545 + {0x0000a0f4, 0x55015502},
10546 + {0x0000a0f8, 0x551f5500},
10547 + {0x0000a0fc, 0x6602551e},
10548 + {0x0000a100, 0x66006601},
10549 + {0x0000a104, 0x661e661f},
10550 + {0x0000a108, 0x7703661d},
10551 + {0x0000a10c, 0x77017702},
10552 + {0x0000a110, 0x00007700},
10553 + {0x0000a114, 0x00000000},
10554 + {0x0000a118, 0x00000000},
10555 + {0x0000a11c, 0x00000000},
10556 + {0x0000a120, 0x00000000},
10557 + {0x0000a124, 0x00000000},
10558 + {0x0000a128, 0x00000000},
10559 + {0x0000a12c, 0x00000000},
10560 + {0x0000a130, 0x00000000},
10561 + {0x0000a134, 0x00000000},
10562 + {0x0000a138, 0x00000000},
10563 + {0x0000a13c, 0x00000000},
10564 + {0x0000a140, 0x001f0000},
10565 + {0x0000a144, 0x111f1100},
10566 + {0x0000a148, 0x111d111e},
10567 + {0x0000a14c, 0x111b111c},
10568 + {0x0000a150, 0x22032204},
10569 + {0x0000a154, 0x22012202},
10570 + {0x0000a158, 0x221f2200},
10571 + {0x0000a15c, 0x221d221e},
10572 + {0x0000a160, 0x33013302},
10573 + {0x0000a164, 0x331f3300},
10574 + {0x0000a168, 0x4402331e},
10575 + {0x0000a16c, 0x44004401},
10576 + {0x0000a170, 0x441e441f},
10577 + {0x0000a174, 0x55015502},
10578 + {0x0000a178, 0x551f5500},
10579 + {0x0000a17c, 0x6602551e},
10580 + {0x0000a180, 0x66006601},
10581 + {0x0000a184, 0x661e661f},
10582 + {0x0000a188, 0x7703661d},
10583 + {0x0000a18c, 0x77017702},
10584 + {0x0000a190, 0x00007700},
10585 + {0x0000a194, 0x00000000},
10586 + {0x0000a198, 0x00000000},
10587 + {0x0000a19c, 0x00000000},
10588 + {0x0000a1a0, 0x00000000},
10589 + {0x0000a1a4, 0x00000000},
10590 + {0x0000a1a8, 0x00000000},
10591 + {0x0000a1ac, 0x00000000},
10592 + {0x0000a1b0, 0x00000000},
10593 + {0x0000a1b4, 0x00000000},
10594 + {0x0000a1b8, 0x00000000},
10595 + {0x0000a1bc, 0x00000000},
10596 + {0x0000a1c0, 0x00000000},
10597 + {0x0000a1c4, 0x00000000},
10598 + {0x0000a1c8, 0x00000000},
10599 + {0x0000a1cc, 0x00000000},
10600 + {0x0000a1d0, 0x00000000},
10601 + {0x0000a1d4, 0x00000000},
10602 + {0x0000a1d8, 0x00000000},
10603 + {0x0000a1dc, 0x00000000},
10604 + {0x0000a1e0, 0x00000000},
10605 + {0x0000a1e4, 0x00000000},
10606 + {0x0000a1e8, 0x00000000},
10607 + {0x0000a1ec, 0x00000000},
10608 + {0x0000a1f0, 0x00000396},
10609 + {0x0000a1f4, 0x00000396},
10610 + {0x0000a1f8, 0x00000396},
10611 + {0x0000a1fc, 0x00000296},
10614 #endif /* INITVALS_9330_1P2_H */
10615 --- a/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
10616 +++ b/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
10621 +#define ar955x_1p0_soc_postamble ar9300_2p2_soc_postamble
10623 +#define ar955x_1p0_common_rx_gain_table ar9300Common_rx_gain_table_2p2
10625 +#define ar955x_1p0_common_wo_xlna_rx_gain_table ar9300Common_wo_xlna_rx_gain_table_2p2
10627 +#define ar955x_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
10629 static const u32 ar955x_1p0_radio_postamble[][5] = {
10630 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10631 {0x00016098, 0xd2dd5554, 0xd2dd5554, 0xd28b3330, 0xd28b3330},
10632 @@ -37,13 +45,6 @@ static const u32 ar955x_1p0_radio_postam
10633 {0x00016940, 0x10804008, 0x10804008, 0x10804008, 0x10804008},
10636 -static const u32 ar955x_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
10637 - /* Addr allmodes */
10638 - {0x0000a398, 0x00000000},
10639 - {0x0000a39c, 0x6f7f0301},
10640 - {0x0000a3a0, 0xca9228ee},
10643 static const u32 ar955x_1p0_baseband_postamble[][5] = {
10644 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
10645 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
10646 @@ -473,266 +474,6 @@ static const u32 ar955x_1p0_mac_core[][2
10647 {0x000083d0, 0x8c7901ff},
10650 -static const u32 ar955x_1p0_common_rx_gain_table[][2] = {
10651 - /* Addr allmodes */
10652 - {0x0000a000, 0x00010000},
10653 - {0x0000a004, 0x00030002},
10654 - {0x0000a008, 0x00050004},
10655 - {0x0000a00c, 0x00810080},
10656 - {0x0000a010, 0x00830082},
10657 - {0x0000a014, 0x01810180},
10658 - {0x0000a018, 0x01830182},
10659 - {0x0000a01c, 0x01850184},
10660 - {0x0000a020, 0x01890188},
10661 - {0x0000a024, 0x018b018a},
10662 - {0x0000a028, 0x018d018c},
10663 - {0x0000a02c, 0x01910190},
10664 - {0x0000a030, 0x01930192},
10665 - {0x0000a034, 0x01950194},
10666 - {0x0000a038, 0x038a0196},
10667 - {0x0000a03c, 0x038c038b},
10668 - {0x0000a040, 0x0390038d},
10669 - {0x0000a044, 0x03920391},
10670 - {0x0000a048, 0x03940393},
10671 - {0x0000a04c, 0x03960395},
10672 - {0x0000a050, 0x00000000},
10673 - {0x0000a054, 0x00000000},
10674 - {0x0000a058, 0x00000000},
10675 - {0x0000a05c, 0x00000000},
10676 - {0x0000a060, 0x00000000},
10677 - {0x0000a064, 0x00000000},
10678 - {0x0000a068, 0x00000000},
10679 - {0x0000a06c, 0x00000000},
10680 - {0x0000a070, 0x00000000},
10681 - {0x0000a074, 0x00000000},
10682 - {0x0000a078, 0x00000000},
10683 - {0x0000a07c, 0x00000000},
10684 - {0x0000a080, 0x22222229},
10685 - {0x0000a084, 0x1d1d1d1d},
10686 - {0x0000a088, 0x1d1d1d1d},
10687 - {0x0000a08c, 0x1d1d1d1d},
10688 - {0x0000a090, 0x171d1d1d},
10689 - {0x0000a094, 0x11111717},
10690 - {0x0000a098, 0x00030311},
10691 - {0x0000a09c, 0x00000000},
10692 - {0x0000a0a0, 0x00000000},
10693 - {0x0000a0a4, 0x00000000},
10694 - {0x0000a0a8, 0x00000000},
10695 - {0x0000a0ac, 0x00000000},
10696 - {0x0000a0b0, 0x00000000},
10697 - {0x0000a0b4, 0x00000000},
10698 - {0x0000a0b8, 0x00000000},
10699 - {0x0000a0bc, 0x00000000},
10700 - {0x0000a0c0, 0x001f0000},
10701 - {0x0000a0c4, 0x01000101},
10702 - {0x0000a0c8, 0x011e011f},
10703 - {0x0000a0cc, 0x011c011d},
10704 - {0x0000a0d0, 0x02030204},
10705 - {0x0000a0d4, 0x02010202},
10706 - {0x0000a0d8, 0x021f0200},
10707 - {0x0000a0dc, 0x0302021e},
10708 - {0x0000a0e0, 0x03000301},
10709 - {0x0000a0e4, 0x031e031f},
10710 - {0x0000a0e8, 0x0402031d},
10711 - {0x0000a0ec, 0x04000401},
10712 - {0x0000a0f0, 0x041e041f},
10713 - {0x0000a0f4, 0x0502041d},
10714 - {0x0000a0f8, 0x05000501},
10715 - {0x0000a0fc, 0x051e051f},
10716 - {0x0000a100, 0x06010602},
10717 - {0x0000a104, 0x061f0600},
10718 - {0x0000a108, 0x061d061e},
10719 - {0x0000a10c, 0x07020703},
10720 - {0x0000a110, 0x07000701},
10721 - {0x0000a114, 0x00000000},
10722 - {0x0000a118, 0x00000000},
10723 - {0x0000a11c, 0x00000000},
10724 - {0x0000a120, 0x00000000},
10725 - {0x0000a124, 0x00000000},
10726 - {0x0000a128, 0x00000000},
10727 - {0x0000a12c, 0x00000000},
10728 - {0x0000a130, 0x00000000},
10729 - {0x0000a134, 0x00000000},
10730 - {0x0000a138, 0x00000000},
10731 - {0x0000a13c, 0x00000000},
10732 - {0x0000a140, 0x001f0000},
10733 - {0x0000a144, 0x01000101},
10734 - {0x0000a148, 0x011e011f},
10735 - {0x0000a14c, 0x011c011d},
10736 - {0x0000a150, 0x02030204},
10737 - {0x0000a154, 0x02010202},
10738 - {0x0000a158, 0x021f0200},
10739 - {0x0000a15c, 0x0302021e},
10740 - {0x0000a160, 0x03000301},
10741 - {0x0000a164, 0x031e031f},
10742 - {0x0000a168, 0x0402031d},
10743 - {0x0000a16c, 0x04000401},
10744 - {0x0000a170, 0x041e041f},
10745 - {0x0000a174, 0x0502041d},
10746 - {0x0000a178, 0x05000501},
10747 - {0x0000a17c, 0x051e051f},
10748 - {0x0000a180, 0x06010602},
10749 - {0x0000a184, 0x061f0600},
10750 - {0x0000a188, 0x061d061e},
10751 - {0x0000a18c, 0x07020703},
10752 - {0x0000a190, 0x07000701},
10753 - {0x0000a194, 0x00000000},
10754 - {0x0000a198, 0x00000000},
10755 - {0x0000a19c, 0x00000000},
10756 - {0x0000a1a0, 0x00000000},
10757 - {0x0000a1a4, 0x00000000},
10758 - {0x0000a1a8, 0x00000000},
10759 - {0x0000a1ac, 0x00000000},
10760 - {0x0000a1b0, 0x00000000},
10761 - {0x0000a1b4, 0x00000000},
10762 - {0x0000a1b8, 0x00000000},
10763 - {0x0000a1bc, 0x00000000},
10764 - {0x0000a1c0, 0x00000000},
10765 - {0x0000a1c4, 0x00000000},
10766 - {0x0000a1c8, 0x00000000},
10767 - {0x0000a1cc, 0x00000000},
10768 - {0x0000a1d0, 0x00000000},
10769 - {0x0000a1d4, 0x00000000},
10770 - {0x0000a1d8, 0x00000000},
10771 - {0x0000a1dc, 0x00000000},
10772 - {0x0000a1e0, 0x00000000},
10773 - {0x0000a1e4, 0x00000000},
10774 - {0x0000a1e8, 0x00000000},
10775 - {0x0000a1ec, 0x00000000},
10776 - {0x0000a1f0, 0x00000396},
10777 - {0x0000a1f4, 0x00000396},
10778 - {0x0000a1f8, 0x00000396},
10779 - {0x0000a1fc, 0x00000196},
10780 - {0x0000b000, 0x00010000},
10781 - {0x0000b004, 0x00030002},
10782 - {0x0000b008, 0x00050004},
10783 - {0x0000b00c, 0x00810080},
10784 - {0x0000b010, 0x00830082},
10785 - {0x0000b014, 0x01810180},
10786 - {0x0000b018, 0x01830182},
10787 - {0x0000b01c, 0x01850184},
10788 - {0x0000b020, 0x02810280},
10789 - {0x0000b024, 0x02830282},
10790 - {0x0000b028, 0x02850284},
10791 - {0x0000b02c, 0x02890288},
10792 - {0x0000b030, 0x028b028a},
10793 - {0x0000b034, 0x0388028c},
10794 - {0x0000b038, 0x038a0389},
10795 - {0x0000b03c, 0x038c038b},
10796 - {0x0000b040, 0x0390038d},
10797 - {0x0000b044, 0x03920391},
10798 - {0x0000b048, 0x03940393},
10799 - {0x0000b04c, 0x03960395},
10800 - {0x0000b050, 0x00000000},
10801 - {0x0000b054, 0x00000000},
10802 - {0x0000b058, 0x00000000},
10803 - {0x0000b05c, 0x00000000},
10804 - {0x0000b060, 0x00000000},
10805 - {0x0000b064, 0x00000000},
10806 - {0x0000b068, 0x00000000},
10807 - {0x0000b06c, 0x00000000},
10808 - {0x0000b070, 0x00000000},
10809 - {0x0000b074, 0x00000000},
10810 - {0x0000b078, 0x00000000},
10811 - {0x0000b07c, 0x00000000},
10812 - {0x0000b080, 0x23232323},
10813 - {0x0000b084, 0x21232323},
10814 - {0x0000b088, 0x19191c1e},
10815 - {0x0000b08c, 0x12141417},
10816 - {0x0000b090, 0x07070e0e},
10817 - {0x0000b094, 0x03030305},
10818 - {0x0000b098, 0x00000003},
10819 - {0x0000b09c, 0x00000000},
10820 - {0x0000b0a0, 0x00000000},
10821 - {0x0000b0a4, 0x00000000},
10822 - {0x0000b0a8, 0x00000000},
10823 - {0x0000b0ac, 0x00000000},
10824 - {0x0000b0b0, 0x00000000},
10825 - {0x0000b0b4, 0x00000000},
10826 - {0x0000b0b8, 0x00000000},
10827 - {0x0000b0bc, 0x00000000},
10828 - {0x0000b0c0, 0x003f0020},
10829 - {0x0000b0c4, 0x00400041},
10830 - {0x0000b0c8, 0x0140005f},
10831 - {0x0000b0cc, 0x0160015f},
10832 - {0x0000b0d0, 0x017e017f},
10833 - {0x0000b0d4, 0x02410242},
10834 - {0x0000b0d8, 0x025f0240},
10835 - {0x0000b0dc, 0x027f0260},
10836 - {0x0000b0e0, 0x0341027e},
10837 - {0x0000b0e4, 0x035f0340},
10838 - {0x0000b0e8, 0x037f0360},
10839 - {0x0000b0ec, 0x04400441},
10840 - {0x0000b0f0, 0x0460045f},
10841 - {0x0000b0f4, 0x0541047f},
10842 - {0x0000b0f8, 0x055f0540},
10843 - {0x0000b0fc, 0x057f0560},
10844 - {0x0000b100, 0x06400641},
10845 - {0x0000b104, 0x0660065f},
10846 - {0x0000b108, 0x067e067f},
10847 - {0x0000b10c, 0x07410742},
10848 - {0x0000b110, 0x075f0740},
10849 - {0x0000b114, 0x077f0760},
10850 - {0x0000b118, 0x07800781},
10851 - {0x0000b11c, 0x07a0079f},
10852 - {0x0000b120, 0x07c107bf},
10853 - {0x0000b124, 0x000007c0},
10854 - {0x0000b128, 0x00000000},
10855 - {0x0000b12c, 0x00000000},
10856 - {0x0000b130, 0x00000000},
10857 - {0x0000b134, 0x00000000},
10858 - {0x0000b138, 0x00000000},
10859 - {0x0000b13c, 0x00000000},
10860 - {0x0000b140, 0x003f0020},
10861 - {0x0000b144, 0x00400041},
10862 - {0x0000b148, 0x0140005f},
10863 - {0x0000b14c, 0x0160015f},
10864 - {0x0000b150, 0x017e017f},
10865 - {0x0000b154, 0x02410242},
10866 - {0x0000b158, 0x025f0240},
10867 - {0x0000b15c, 0x027f0260},
10868 - {0x0000b160, 0x0341027e},
10869 - {0x0000b164, 0x035f0340},
10870 - {0x0000b168, 0x037f0360},
10871 - {0x0000b16c, 0x04400441},
10872 - {0x0000b170, 0x0460045f},
10873 - {0x0000b174, 0x0541047f},
10874 - {0x0000b178, 0x055f0540},
10875 - {0x0000b17c, 0x057f0560},
10876 - {0x0000b180, 0x06400641},
10877 - {0x0000b184, 0x0660065f},
10878 - {0x0000b188, 0x067e067f},
10879 - {0x0000b18c, 0x07410742},
10880 - {0x0000b190, 0x075f0740},
10881 - {0x0000b194, 0x077f0760},
10882 - {0x0000b198, 0x07800781},
10883 - {0x0000b19c, 0x07a0079f},
10884 - {0x0000b1a0, 0x07c107bf},
10885 - {0x0000b1a4, 0x000007c0},
10886 - {0x0000b1a8, 0x00000000},
10887 - {0x0000b1ac, 0x00000000},
10888 - {0x0000b1b0, 0x00000000},
10889 - {0x0000b1b4, 0x00000000},
10890 - {0x0000b1b8, 0x00000000},
10891 - {0x0000b1bc, 0x00000000},
10892 - {0x0000b1c0, 0x00000000},
10893 - {0x0000b1c4, 0x00000000},
10894 - {0x0000b1c8, 0x00000000},
10895 - {0x0000b1cc, 0x00000000},
10896 - {0x0000b1d0, 0x00000000},
10897 - {0x0000b1d4, 0x00000000},
10898 - {0x0000b1d8, 0x00000000},
10899 - {0x0000b1dc, 0x00000000},
10900 - {0x0000b1e0, 0x00000000},
10901 - {0x0000b1e4, 0x00000000},
10902 - {0x0000b1e8, 0x00000000},
10903 - {0x0000b1ec, 0x00000000},
10904 - {0x0000b1f0, 0x00000396},
10905 - {0x0000b1f4, 0x00000396},
10906 - {0x0000b1f8, 0x00000396},
10907 - {0x0000b1fc, 0x00000196},
10910 static const u32 ar955x_1p0_baseband_core[][2] = {
10911 /* Addr allmodes */
10912 {0x00009800, 0xafe68e30},
10913 @@ -891,266 +632,6 @@ static const u32 ar955x_1p0_baseband_cor
10914 {0x0000c420, 0x00000000},
10917 -static const u32 ar955x_1p0_common_wo_xlna_rx_gain_table[][2] = {
10918 - /* Addr allmodes */
10919 - {0x0000a000, 0x00010000},
10920 - {0x0000a004, 0x00030002},
10921 - {0x0000a008, 0x00050004},
10922 - {0x0000a00c, 0x00810080},
10923 - {0x0000a010, 0x00830082},
10924 - {0x0000a014, 0x01810180},
10925 - {0x0000a018, 0x01830182},
10926 - {0x0000a01c, 0x01850184},
10927 - {0x0000a020, 0x01890188},
10928 - {0x0000a024, 0x018b018a},
10929 - {0x0000a028, 0x018d018c},
10930 - {0x0000a02c, 0x03820190},
10931 - {0x0000a030, 0x03840383},
10932 - {0x0000a034, 0x03880385},
10933 - {0x0000a038, 0x038a0389},
10934 - {0x0000a03c, 0x038c038b},
10935 - {0x0000a040, 0x0390038d},
10936 - {0x0000a044, 0x03920391},
10937 - {0x0000a048, 0x03940393},
10938 - {0x0000a04c, 0x03960395},
10939 - {0x0000a050, 0x00000000},
10940 - {0x0000a054, 0x00000000},
10941 - {0x0000a058, 0x00000000},
10942 - {0x0000a05c, 0x00000000},
10943 - {0x0000a060, 0x00000000},
10944 - {0x0000a064, 0x00000000},
10945 - {0x0000a068, 0x00000000},
10946 - {0x0000a06c, 0x00000000},
10947 - {0x0000a070, 0x00000000},
10948 - {0x0000a074, 0x00000000},
10949 - {0x0000a078, 0x00000000},
10950 - {0x0000a07c, 0x00000000},
10951 - {0x0000a080, 0x29292929},
10952 - {0x0000a084, 0x29292929},
10953 - {0x0000a088, 0x29292929},
10954 - {0x0000a08c, 0x29292929},
10955 - {0x0000a090, 0x22292929},
10956 - {0x0000a094, 0x1d1d2222},
10957 - {0x0000a098, 0x0c111117},
10958 - {0x0000a09c, 0x00030303},
10959 - {0x0000a0a0, 0x00000000},
10960 - {0x0000a0a4, 0x00000000},
10961 - {0x0000a0a8, 0x00000000},
10962 - {0x0000a0ac, 0x00000000},
10963 - {0x0000a0b0, 0x00000000},
10964 - {0x0000a0b4, 0x00000000},
10965 - {0x0000a0b8, 0x00000000},
10966 - {0x0000a0bc, 0x00000000},
10967 - {0x0000a0c0, 0x001f0000},
10968 - {0x0000a0c4, 0x01000101},
10969 - {0x0000a0c8, 0x011e011f},
10970 - {0x0000a0cc, 0x011c011d},
10971 - {0x0000a0d0, 0x02030204},
10972 - {0x0000a0d4, 0x02010202},
10973 - {0x0000a0d8, 0x021f0200},
10974 - {0x0000a0dc, 0x0302021e},
10975 - {0x0000a0e0, 0x03000301},
10976 - {0x0000a0e4, 0x031e031f},
10977 - {0x0000a0e8, 0x0402031d},
10978 - {0x0000a0ec, 0x04000401},
10979 - {0x0000a0f0, 0x041e041f},
10980 - {0x0000a0f4, 0x0502041d},
10981 - {0x0000a0f8, 0x05000501},
10982 - {0x0000a0fc, 0x051e051f},
10983 - {0x0000a100, 0x06010602},
10984 - {0x0000a104, 0x061f0600},
10985 - {0x0000a108, 0x061d061e},
10986 - {0x0000a10c, 0x07020703},
10987 - {0x0000a110, 0x07000701},
10988 - {0x0000a114, 0x00000000},
10989 - {0x0000a118, 0x00000000},
10990 - {0x0000a11c, 0x00000000},
10991 - {0x0000a120, 0x00000000},
10992 - {0x0000a124, 0x00000000},
10993 - {0x0000a128, 0x00000000},
10994 - {0x0000a12c, 0x00000000},
10995 - {0x0000a130, 0x00000000},
10996 - {0x0000a134, 0x00000000},
10997 - {0x0000a138, 0x00000000},
10998 - {0x0000a13c, 0x00000000},
10999 - {0x0000a140, 0x001f0000},
11000 - {0x0000a144, 0x01000101},
11001 - {0x0000a148, 0x011e011f},
11002 - {0x0000a14c, 0x011c011d},
11003 - {0x0000a150, 0x02030204},
11004 - {0x0000a154, 0x02010202},
11005 - {0x0000a158, 0x021f0200},
11006 - {0x0000a15c, 0x0302021e},
11007 - {0x0000a160, 0x03000301},
11008 - {0x0000a164, 0x031e031f},
11009 - {0x0000a168, 0x0402031d},
11010 - {0x0000a16c, 0x04000401},
11011 - {0x0000a170, 0x041e041f},
11012 - {0x0000a174, 0x0502041d},
11013 - {0x0000a178, 0x05000501},
11014 - {0x0000a17c, 0x051e051f},
11015 - {0x0000a180, 0x06010602},
11016 - {0x0000a184, 0x061f0600},
11017 - {0x0000a188, 0x061d061e},
11018 - {0x0000a18c, 0x07020703},
11019 - {0x0000a190, 0x07000701},
11020 - {0x0000a194, 0x00000000},
11021 - {0x0000a198, 0x00000000},
11022 - {0x0000a19c, 0x00000000},
11023 - {0x0000a1a0, 0x00000000},
11024 - {0x0000a1a4, 0x00000000},
11025 - {0x0000a1a8, 0x00000000},
11026 - {0x0000a1ac, 0x00000000},
11027 - {0x0000a1b0, 0x00000000},
11028 - {0x0000a1b4, 0x00000000},
11029 - {0x0000a1b8, 0x00000000},
11030 - {0x0000a1bc, 0x00000000},
11031 - {0x0000a1c0, 0x00000000},
11032 - {0x0000a1c4, 0x00000000},
11033 - {0x0000a1c8, 0x00000000},
11034 - {0x0000a1cc, 0x00000000},
11035 - {0x0000a1d0, 0x00000000},
11036 - {0x0000a1d4, 0x00000000},
11037 - {0x0000a1d8, 0x00000000},
11038 - {0x0000a1dc, 0x00000000},
11039 - {0x0000a1e0, 0x00000000},
11040 - {0x0000a1e4, 0x00000000},
11041 - {0x0000a1e8, 0x00000000},
11042 - {0x0000a1ec, 0x00000000},
11043 - {0x0000a1f0, 0x00000396},
11044 - {0x0000a1f4, 0x00000396},
11045 - {0x0000a1f8, 0x00000396},
11046 - {0x0000a1fc, 0x00000196},
11047 - {0x0000b000, 0x00010000},
11048 - {0x0000b004, 0x00030002},
11049 - {0x0000b008, 0x00050004},
11050 - {0x0000b00c, 0x00810080},
11051 - {0x0000b010, 0x00830082},
11052 - {0x0000b014, 0x01810180},
11053 - {0x0000b018, 0x01830182},
11054 - {0x0000b01c, 0x01850184},
11055 - {0x0000b020, 0x02810280},
11056 - {0x0000b024, 0x02830282},
11057 - {0x0000b028, 0x02850284},
11058 - {0x0000b02c, 0x02890288},
11059 - {0x0000b030, 0x028b028a},
11060 - {0x0000b034, 0x0388028c},
11061 - {0x0000b038, 0x038a0389},
11062 - {0x0000b03c, 0x038c038b},
11063 - {0x0000b040, 0x0390038d},
11064 - {0x0000b044, 0x03920391},
11065 - {0x0000b048, 0x03940393},
11066 - {0x0000b04c, 0x03960395},
11067 - {0x0000b050, 0x00000000},
11068 - {0x0000b054, 0x00000000},
11069 - {0x0000b058, 0x00000000},
11070 - {0x0000b05c, 0x00000000},
11071 - {0x0000b060, 0x00000000},
11072 - {0x0000b064, 0x00000000},
11073 - {0x0000b068, 0x00000000},
11074 - {0x0000b06c, 0x00000000},
11075 - {0x0000b070, 0x00000000},
11076 - {0x0000b074, 0x00000000},
11077 - {0x0000b078, 0x00000000},
11078 - {0x0000b07c, 0x00000000},
11079 - {0x0000b080, 0x32323232},
11080 - {0x0000b084, 0x2f2f3232},
11081 - {0x0000b088, 0x23282a2d},
11082 - {0x0000b08c, 0x1c1e2123},
11083 - {0x0000b090, 0x14171919},
11084 - {0x0000b094, 0x0e0e1214},
11085 - {0x0000b098, 0x03050707},
11086 - {0x0000b09c, 0x00030303},
11087 - {0x0000b0a0, 0x00000000},
11088 - {0x0000b0a4, 0x00000000},
11089 - {0x0000b0a8, 0x00000000},
11090 - {0x0000b0ac, 0x00000000},
11091 - {0x0000b0b0, 0x00000000},
11092 - {0x0000b0b4, 0x00000000},
11093 - {0x0000b0b8, 0x00000000},
11094 - {0x0000b0bc, 0x00000000},
11095 - {0x0000b0c0, 0x003f0020},
11096 - {0x0000b0c4, 0x00400041},
11097 - {0x0000b0c8, 0x0140005f},
11098 - {0x0000b0cc, 0x0160015f},
11099 - {0x0000b0d0, 0x017e017f},
11100 - {0x0000b0d4, 0x02410242},
11101 - {0x0000b0d8, 0x025f0240},
11102 - {0x0000b0dc, 0x027f0260},
11103 - {0x0000b0e0, 0x0341027e},
11104 - {0x0000b0e4, 0x035f0340},
11105 - {0x0000b0e8, 0x037f0360},
11106 - {0x0000b0ec, 0x04400441},
11107 - {0x0000b0f0, 0x0460045f},
11108 - {0x0000b0f4, 0x0541047f},
11109 - {0x0000b0f8, 0x055f0540},
11110 - {0x0000b0fc, 0x057f0560},
11111 - {0x0000b100, 0x06400641},
11112 - {0x0000b104, 0x0660065f},
11113 - {0x0000b108, 0x067e067f},
11114 - {0x0000b10c, 0x07410742},
11115 - {0x0000b110, 0x075f0740},
11116 - {0x0000b114, 0x077f0760},
11117 - {0x0000b118, 0x07800781},
11118 - {0x0000b11c, 0x07a0079f},
11119 - {0x0000b120, 0x07c107bf},
11120 - {0x0000b124, 0x000007c0},
11121 - {0x0000b128, 0x00000000},
11122 - {0x0000b12c, 0x00000000},
11123 - {0x0000b130, 0x00000000},
11124 - {0x0000b134, 0x00000000},
11125 - {0x0000b138, 0x00000000},
11126 - {0x0000b13c, 0x00000000},
11127 - {0x0000b140, 0x003f0020},
11128 - {0x0000b144, 0x00400041},
11129 - {0x0000b148, 0x0140005f},
11130 - {0x0000b14c, 0x0160015f},
11131 - {0x0000b150, 0x017e017f},
11132 - {0x0000b154, 0x02410242},
11133 - {0x0000b158, 0x025f0240},
11134 - {0x0000b15c, 0x027f0260},
11135 - {0x0000b160, 0x0341027e},
11136 - {0x0000b164, 0x035f0340},
11137 - {0x0000b168, 0x037f0360},
11138 - {0x0000b16c, 0x04400441},
11139 - {0x0000b170, 0x0460045f},
11140 - {0x0000b174, 0x0541047f},
11141 - {0x0000b178, 0x055f0540},
11142 - {0x0000b17c, 0x057f0560},
11143 - {0x0000b180, 0x06400641},
11144 - {0x0000b184, 0x0660065f},
11145 - {0x0000b188, 0x067e067f},
11146 - {0x0000b18c, 0x07410742},
11147 - {0x0000b190, 0x075f0740},
11148 - {0x0000b194, 0x077f0760},
11149 - {0x0000b198, 0x07800781},
11150 - {0x0000b19c, 0x07a0079f},
11151 - {0x0000b1a0, 0x07c107bf},
11152 - {0x0000b1a4, 0x000007c0},
11153 - {0x0000b1a8, 0x00000000},
11154 - {0x0000b1ac, 0x00000000},
11155 - {0x0000b1b0, 0x00000000},
11156 - {0x0000b1b4, 0x00000000},
11157 - {0x0000b1b8, 0x00000000},
11158 - {0x0000b1bc, 0x00000000},
11159 - {0x0000b1c0, 0x00000000},
11160 - {0x0000b1c4, 0x00000000},
11161 - {0x0000b1c8, 0x00000000},
11162 - {0x0000b1cc, 0x00000000},
11163 - {0x0000b1d0, 0x00000000},
11164 - {0x0000b1d4, 0x00000000},
11165 - {0x0000b1d8, 0x00000000},
11166 - {0x0000b1dc, 0x00000000},
11167 - {0x0000b1e0, 0x00000000},
11168 - {0x0000b1e4, 0x00000000},
11169 - {0x0000b1e8, 0x00000000},
11170 - {0x0000b1ec, 0x00000000},
11171 - {0x0000b1f0, 0x00000396},
11172 - {0x0000b1f4, 0x00000396},
11173 - {0x0000b1f8, 0x00000396},
11174 - {0x0000b1fc, 0x00000196},
11177 static const u32 ar955x_1p0_soc_preamble[][2] = {
11178 /* Addr allmodes */
11179 {0x00007000, 0x00000000},
11180 @@ -1263,11 +744,6 @@ static const u32 ar955x_1p0_modes_no_xpa
11181 {0x00016848, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401},
11184 -static const u32 ar955x_1p0_soc_postamble[][5] = {
11185 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
11186 - {0x00007010, 0x00000023, 0x00000023, 0x00000023, 0x00000023},
11189 static const u32 ar955x_1p0_modes_fast_clock[][3] = {
11190 /* Addr 5G_HT20 5G_HT40 */
11191 {0x00001030, 0x00000268, 0x000004d0},
11192 --- a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
11193 +++ b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
11198 +#define ar9565_1p0_mac_postamble ar9331_1p1_mac_postamble
11200 +#define ar9565_1p0_Modes_lowest_ob_db_tx_gain_table ar9565_1p0_modes_low_ob_db_tx_gain_table
11202 +#define ar9565_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
11204 static const u32 ar9565_1p0_mac_core[][2] = {
11205 /* Addr allmodes */
11206 {0x00000008, 0x00000000},
11207 @@ -182,18 +188,6 @@ static const u32 ar9565_1p0_mac_core[][2
11208 {0x000083d0, 0x800301ff},
11211 -static const u32 ar9565_1p0_mac_postamble[][5] = {
11212 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
11213 - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
11214 - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
11215 - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
11216 - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
11217 - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
11218 - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
11219 - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
11220 - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
11223 static const u32 ar9565_1p0_baseband_core[][2] = {
11224 /* Addr allmodes */
11225 {0x00009800, 0xafe68e30},
11226 @@ -711,66 +705,6 @@ static const u32 ar9565_1p0_Common_rx_ga
11227 {0x0000b1fc, 0x00000196},
11230 -static const u32 ar9565_1p0_Modes_lowest_ob_db_tx_gain_table[][5] = {
11231 - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
11232 - {0x0000a2dc, 0xfc0a9380, 0xfc0a9380, 0xfdab5b52, 0xfdab5b52},
11233 - {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84},
11234 - {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000},
11235 - {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000},
11236 - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
11237 - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11238 - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
11239 - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
11240 - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
11241 - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
11242 - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
11243 - {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
11244 - {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
11245 - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
11246 - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
11247 - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
11248 - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
11249 - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
11250 - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
11251 - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
11252 - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
11253 - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
11254 - {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
11255 - {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
11256 - {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
11257 - {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
11258 - {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
11259 - {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
11260 - {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
11261 - {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
11262 - {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11263 - {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11264 - {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11265 - {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11266 - {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11267 - {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11268 - {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
11269 - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11270 - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11271 - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11272 - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11273 - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11274 - {0x0000a614, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11275 - {0x0000a618, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11276 - {0x0000a61c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11277 - {0x0000a620, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11278 - {0x0000a624, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11279 - {0x0000a628, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11280 - {0x0000a62c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11281 - {0x0000a630, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11282 - {0x0000a634, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11283 - {0x0000a638, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11284 - {0x0000a63c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11285 - {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
11286 - {0x00016048, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11287 - {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11290 static const u32 ar9565_1p0_pciephy_clkreq_disable_L1[][2] = {
11291 /* Addr allmodes */
11292 {0x00018c00, 0x18212ede},
11293 @@ -1231,11 +1165,4 @@ static const u32 ar9565_1p0_modes_high_p
11294 {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11297 -static const u32 ar9565_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
11298 - /* Addr allmodes */
11299 - {0x0000a398, 0x00000000},
11300 - {0x0000a39c, 0x6f7f0301},
11301 - {0x0000a3a0, 0xca9228ee},
11304 #endif /* INITVALS_9565_1P0_H */
11305 --- a/include/linux/ath9k_platform.h
11306 +++ b/include/linux/ath9k_platform.h
11307 @@ -32,6 +32,8 @@ struct ath9k_platform_data {
11311 + bool tx_gain_buffalo;
11313 int (*get_mac_revision)(void);
11314 int (*external_reset)(void);
11317 +++ b/drivers/net/wireless/ath/ath9k/ar9003_buffalo_initvals.h
11320 + * Copyright (c) 2013 Qualcomm Atheros Inc.
11322 + * Permission to use, copy, modify, and/or distribute this software for any
11323 + * purpose with or without fee is hereby granted, provided that the above
11324 + * copyright notice and this permission notice appear in all copies.
11326 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11327 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11328 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11329 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11330 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11331 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
11332 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
11335 +#ifndef INITVALS_9003_BUFFALO_H
11336 +#define INITVALS_9003_BUFFALO_H
11338 +static const u32 ar9300Modes_high_power_tx_gain_table_buffalo[][5] = {
11339 + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
11340 + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
11341 + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
11342 + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
11343 + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
11344 + {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
11345 + {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
11346 + {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
11347 + {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
11348 + {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
11349 + {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
11350 + {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
11351 + {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
11352 + {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
11353 + {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
11354 + {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
11355 + {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
11356 + {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
11357 + {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
11358 + {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
11359 + {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
11360 + {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
11361 + {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
11362 + {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
11363 + {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
11364 + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
11365 + {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
11366 + {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
11367 + {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
11368 + {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
11369 + {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
11370 + {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11371 + {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11372 + {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11373 + {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11374 + {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11375 + {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11376 + {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
11377 + {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
11378 + {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
11379 + {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
11380 + {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
11381 + {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
11382 + {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
11383 + {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
11384 + {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
11385 + {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
11386 + {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
11387 + {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
11388 + {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
11389 + {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
11390 + {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
11391 + {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
11392 + {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
11393 + {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
11394 + {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
11395 + {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
11396 + {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
11397 + {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
11398 + {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
11399 + {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
11400 + {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
11401 + {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
11402 + {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11403 + {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11404 + {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11405 + {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11406 + {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11407 + {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11408 + {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
11409 + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11410 + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11411 + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11412 + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11413 + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
11414 + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
11415 + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
11416 + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
11417 + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
11418 + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
11419 + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
11420 + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
11421 + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
11422 + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
11423 + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
11424 + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
11425 + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
11426 + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
11427 + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
11428 + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
11429 + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
11430 + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
11431 + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
11432 + {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
11433 + {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
11434 + {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
11435 + {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
11436 + {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
11437 + {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
11438 + {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
11439 + {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
11440 + {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
11441 + {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
11444 +#endif /* INITVALS_9003_BUFFALO_H */