1 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
3 @@ -1579,6 +1579,37 @@ static void ar5008_hw_set_nf_limits(stru
4 ah->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_5416_5GHZ;
7 +static void ar5008_hw_set_radar_params(struct ath_hw *ah,
8 + struct ath_hw_radar_conf *conf)
10 + u32 radar_0 = 0, radar_1 = 0;
13 + REG_CLR_BIT(ah, AR_PHY_RADAR_0, AR_PHY_RADAR_0_ENA);
17 + radar_0 |= AR_PHY_RADAR_0_ENA | AR_PHY_RADAR_0_FFT_ENA;
18 + radar_0 |= SM(conf->fir_power, AR_PHY_RADAR_0_FIRPWR);
19 + radar_0 |= SM(conf->radar_rssi, AR_PHY_RADAR_0_RRSSI);
20 + radar_0 |= SM(conf->pulse_height, AR_PHY_RADAR_0_HEIGHT);
21 + radar_0 |= SM(conf->pulse_rssi, AR_PHY_RADAR_0_PRSSI);
22 + radar_0 |= SM(conf->pulse_inband, AR_PHY_RADAR_0_INBAND);
24 + radar_1 |= AR_PHY_RADAR_1_MAX_RRSSI;
25 + radar_1 |= AR_PHY_RADAR_1_BLOCK_CHECK;
26 + radar_1 |= SM(conf->pulse_maxlen, AR_PHY_RADAR_1_MAXLEN);
27 + radar_1 |= SM(conf->pulse_inband_step, AR_PHY_RADAR_1_RELSTEP_THRESH);
28 + radar_1 |= SM(conf->radar_inband, AR_PHY_RADAR_1_RELPWR_THRESH);
30 + REG_WRITE(ah, AR_PHY_RADAR_0, radar_0);
31 + REG_WRITE(ah, AR_PHY_RADAR_1, radar_1);
32 + if (conf->ext_channel)
33 + REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
35 + REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
38 void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
40 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
41 @@ -1609,6 +1640,7 @@ void ar5008_hw_attach_phy_ops(struct ath
42 priv_ops->restore_chainmask = ar5008_restore_chainmask;
43 priv_ops->set_diversity = ar5008_set_diversity;
44 priv_ops->do_getnf = ar5008_hw_do_getnf;
45 + priv_ops->set_radar_params = ar5008_hw_set_radar_params;
47 if (modparam_force_new_ani) {
48 priv_ops->ani_control = ar5008_hw_ani_control_new;
49 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
50 +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
51 @@ -718,12 +718,19 @@ static bool ar9003_hw_init_cal(struct at
52 struct ath9k_channel *chan)
54 struct ath_common *common = ath9k_hw_common(ah);
58 - * 0x7 = 0b111 , AR9003 needs to be configured for 3-chain mode before
59 - * running AGC/TxIQ cals
61 - ar9003_hw_set_chain_masks(ah, 0x7, 0x7);
62 + val = REG_READ(ah, AR_ENT_OTP);
63 + ath_print(common, ATH_DBG_CALIBRATE, "ath9k: AR_ENT_OTP 0x%x\n", val);
65 + if (val & AR_ENT_OTP_CHAIN2_DISABLE)
66 + ar9003_hw_set_chain_masks(ah, 0x3, 0x3);
69 + * 0x7 = 0b111 , AR9003 needs to be configured for 3-chain
70 + * mode before running AGC/TxIQ cals
72 + ar9003_hw_set_chain_masks(ah, 0x7, 0x7);
74 /* Do Tx IQ Calibration */
75 ar9003_hw_tx_iq_cal(ah);
76 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
77 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
79 #define COMP_CKSUM_LEN 2
81 #define AR_CH0_TOP (0x00016288)
82 -#define AR_CH0_TOP_XPABIASLVL (0x3)
83 +#define AR_CH0_TOP_XPABIASLVL (0x300)
84 #define AR_CH0_TOP_XPABIASLVL_S (8)
86 #define AR_CH0_THERM (0x00016290)
87 -#define AR_CH0_THERM_SPARE (0x3f)
88 -#define AR_CH0_THERM_SPARE_S (0)
89 +#define AR_CH0_THERM_XPABIASLVL_MSB 0x3
90 +#define AR_CH0_THERM_XPABIASLVL_MSB_S 0
91 +#define AR_CH0_THERM_XPASHORT2GND 0x4
92 +#define AR_CH0_THERM_XPASHORT2GND_S 2
94 #define AR_SWITCH_TABLE_COM_ALL (0xffff)
95 #define AR_SWITCH_TABLE_COM_ALL_S (0)
97 #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */
98 #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */
100 +static int ar9003_hw_power_interpolate(int32_t x,
101 + int32_t *px, int32_t *py, u_int16_t np);
102 static const struct ar9300_eeprom ar9300_default = {
104 - .templateVersion = 2,
105 - .macAddr = {1, 2, 3, 4, 5, 6},
106 - .custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
107 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
108 + .templateVersion = 2,
109 + .macAddr = {1, 2, 3, 4, 5, 6},
110 + .custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
113 + .regDmn = { LE16(0), LE16(0x1f) },
114 + .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
116 + .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
120 + .blueToothOptions = 0,
122 + .deviceType = 5, /* takes lower byte in eeprom location */
123 + .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
124 + .params_for_tuning_caps = {0, 0},
125 + .featureEnable = 0x0c,
127 + * bit0 - enable tx temp comp - disabled
128 + * bit1 - enable tx volt comp - disabled
129 + * bit2 - enable fastClock - enabled
130 + * bit3 - enable doubling - enabled
131 + * bit4 - enable internal regulator - disabled
132 + * bit5 - enable pa predistortion - disabled
134 + .miscConfiguration = 0, /* bit0 - turn down drivestrength */
135 + .eepromWriteEnableGpio = 3,
136 + .wlanDisableGpio = 0,
138 + .rxBandSelectGpio = 0xff,
143 + /* ar9300_modal_eep_header 2g */
144 + /* 4 idle,t1,t2,b(4 bits per setting) */
145 + .antCtrlCommon = LE32(0x110),
146 + /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
147 + .antCtrlCommon2 = LE32(0x22222),
150 + * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
151 + * rx1, rx12, b (2 bits each)
153 + .antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
156 + * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
157 + * for ar9280 (0xa20c/b20c 5:0)
159 + .xatten1DB = {0, 0, 0},
162 + * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
163 + * for ar9280 (0xa20c/b20c 16:12
165 + .xatten1Margin = {0, 0, 0},
170 + * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
171 + * channels in usual fbin coding format
173 + .spurChans = {0, 0, 0, 0, 0},
176 + * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
177 + * if the register is per chain
179 + .noiseFloorThreshCh = {-1, 0, 0},
180 + .ob = {1, 1, 1},/* 3 chain */
181 + .db_stage2 = {1, 1, 1}, /* 3 chain */
182 + .db_stage3 = {0, 0, 0},
183 + .db_stage4 = {0, 0, 0},
185 + .txFrameToDataStart = 0x0e,
186 + .txFrameToPaOn = 0x0e,
187 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
189 + .switchSettling = 0x2c,
190 + .adcDesiredSize = -30,
191 + .txEndToXpaOff = 0,
192 + .txEndToRxOn = 0x2,
193 + .txFrameToXpaOn = 0xe,
195 + .papdRateMaskHt20 = LE32(0x0cf0e0e0),
196 + .papdRateMaskHt40 = LE32(0x6cf0e0e0),
198 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
202 + .ant_div_control = 0,
203 + .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
206 + FREQ2FBIN(2412, 1),
207 + FREQ2FBIN(2437, 1),
208 + FREQ2FBIN(2472, 1),
210 + /* ar9300_cal_data_per_freq_op_loop 2g */
212 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
213 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
214 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
216 + .calTarget_freqbin_Cck = {
217 + FREQ2FBIN(2412, 1),
218 + FREQ2FBIN(2484, 1),
220 + .calTarget_freqbin_2G = {
221 + FREQ2FBIN(2412, 1),
222 + FREQ2FBIN(2437, 1),
225 + .calTarget_freqbin_2GHT20 = {
226 + FREQ2FBIN(2412, 1),
227 + FREQ2FBIN(2437, 1),
230 + .calTarget_freqbin_2GHT40 = {
231 + FREQ2FBIN(2412, 1),
232 + FREQ2FBIN(2437, 1),
235 + .calTargetPowerCck = {
236 + /* 1L-5L,5S,11L,11S */
237 + { {36, 36, 36, 36} },
238 + { {36, 36, 36, 36} },
240 + .calTargetPower2G = {
241 + /* 6-24,36,48,54 */
242 + { {32, 32, 28, 24} },
243 + { {32, 32, 28, 24} },
244 + { {32, 32, 28, 24} },
246 + .calTargetPower2GHT20 = {
247 + { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
248 + { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
249 + { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
251 + .calTargetPower2GHT40 = {
252 + { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
253 + { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
254 + { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
257 + 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
258 + 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
260 + .ctl_freqbin_2G = {
262 + FREQ2FBIN(2412, 1),
263 + FREQ2FBIN(2417, 1),
264 + FREQ2FBIN(2457, 1),
268 + FREQ2FBIN(2412, 1),
269 + FREQ2FBIN(2417, 1),
270 + FREQ2FBIN(2462, 1),
275 + FREQ2FBIN(2412, 1),
276 + FREQ2FBIN(2417, 1),
277 + FREQ2FBIN(2462, 1),
281 + FREQ2FBIN(2422, 1),
282 + FREQ2FBIN(2427, 1),
283 + FREQ2FBIN(2447, 1),
288 + /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
289 + /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
290 + /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
291 + /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
295 + /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
296 + /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
297 + /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
302 + /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
303 + /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
304 + FREQ2FBIN(2472, 1),
309 + /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
310 + /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
311 + /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
312 + /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
316 + /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
317 + /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
318 + /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
322 + /* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
323 + /* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
324 + /* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
329 + /* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
330 + /* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
331 + /* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
336 + /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
337 + /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
338 + /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
339 + /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
342 + .ctlPowerData_2G = {
343 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
344 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
345 + { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
347 + { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
348 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
349 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
351 + { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
352 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
353 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
355 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
356 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
357 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
360 + /* 4 idle,t1,t2,b (4 bits per setting) */
361 + .antCtrlCommon = LE32(0x110),
362 + /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
363 + .antCtrlCommon2 = LE32(0x22222),
364 + /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
366 + LE16(0x000), LE16(0x000), LE16(0x000),
368 + /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
369 + .xatten1DB = {0, 0, 0},
372 + * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
373 + * for merlin (0xa20c/b20c 16:12
375 + .xatten1Margin = {0, 0, 0},
378 + /* spurChans spur channels in usual fbin coding format */
379 + .spurChans = {0, 0, 0, 0, 0},
380 + /* noiseFloorThreshCh Check if the register is per chain */
381 + .noiseFloorThreshCh = {-1, 0, 0},
382 + .ob = {3, 3, 3}, /* 3 chain */
383 + .db_stage2 = {3, 3, 3}, /* 3 chain */
384 + .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
385 + .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
387 + .txFrameToDataStart = 0x0e,
388 + .txFrameToPaOn = 0x0e,
389 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
391 + .switchSettling = 0x2d,
392 + .adcDesiredSize = -30,
393 + .txEndToXpaOff = 0,
394 + .txEndToRxOn = 0x2,
395 + .txFrameToXpaOn = 0xe,
397 + .papdRateMaskHt20 = LE32(0x0c80c080),
398 + .papdRateMaskHt40 = LE32(0x0080c080),
400 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
405 + .tempSlopeHigh = 0,
406 + .xatten1DBLow = {0, 0, 0},
407 + .xatten1MarginLow = {0, 0, 0},
408 + .xatten1DBHigh = {0, 0, 0},
409 + .xatten1MarginHigh = {0, 0, 0}
412 + FREQ2FBIN(5180, 0),
413 + FREQ2FBIN(5220, 0),
414 + FREQ2FBIN(5320, 0),
415 + FREQ2FBIN(5400, 0),
416 + FREQ2FBIN(5500, 0),
417 + FREQ2FBIN(5600, 0),
418 + FREQ2FBIN(5725, 0),
454 + .calTarget_freqbin_5G = {
455 + FREQ2FBIN(5180, 0),
456 + FREQ2FBIN(5220, 0),
457 + FREQ2FBIN(5320, 0),
458 + FREQ2FBIN(5400, 0),
459 + FREQ2FBIN(5500, 0),
460 + FREQ2FBIN(5600, 0),
461 + FREQ2FBIN(5725, 0),
464 + .calTarget_freqbin_5GHT20 = {
465 + FREQ2FBIN(5180, 0),
466 + FREQ2FBIN(5240, 0),
467 + FREQ2FBIN(5320, 0),
468 + FREQ2FBIN(5500, 0),
469 + FREQ2FBIN(5700, 0),
470 + FREQ2FBIN(5745, 0),
471 + FREQ2FBIN(5725, 0),
474 + .calTarget_freqbin_5GHT40 = {
475 + FREQ2FBIN(5180, 0),
476 + FREQ2FBIN(5240, 0),
477 + FREQ2FBIN(5320, 0),
478 + FREQ2FBIN(5500, 0),
479 + FREQ2FBIN(5700, 0),
480 + FREQ2FBIN(5745, 0),
481 + FREQ2FBIN(5725, 0),
484 + .calTargetPower5G = {
485 + /* 6-24,36,48,54 */
486 + { {20, 20, 20, 10} },
487 + { {20, 20, 20, 10} },
488 + { {20, 20, 20, 10} },
489 + { {20, 20, 20, 10} },
490 + { {20, 20, 20, 10} },
491 + { {20, 20, 20, 10} },
492 + { {20, 20, 20, 10} },
493 + { {20, 20, 20, 10} },
495 + .calTargetPower5GHT20 = {
497 + * 0_8_16,1-3_9-11_17-19,
498 + * 4,5,6,7,12,13,14,15,20,21,22,23
500 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
501 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
502 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
503 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
504 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
505 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
506 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
507 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
509 + .calTargetPower5GHT40 = {
511 + * 0_8_16,1-3_9-11_17-19,
512 + * 4,5,6,7,12,13,14,15,20,21,22,23
514 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
515 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
516 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
517 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
518 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
519 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
520 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
521 + { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
524 + 0x10, 0x16, 0x18, 0x40, 0x46,
525 + 0x48, 0x30, 0x36, 0x38
527 + .ctl_freqbin_5G = {
529 + /* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
530 + /* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
531 + /* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
532 + /* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
533 + /* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
534 + /* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
535 + /* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
536 + /* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
539 + /* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
540 + /* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
541 + /* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
542 + /* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
543 + /* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
544 + /* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
545 + /* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
546 + /* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
550 + /* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
551 + /* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
552 + /* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
553 + /* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
554 + /* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
555 + /* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
556 + /* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
557 + /* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
561 + /* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
562 + /* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
563 + /* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
564 + /* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
565 + /* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
566 + /* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
567 + /* Data[3].ctlEdges[6].bChannel */ 0xFF,
568 + /* Data[3].ctlEdges[7].bChannel */ 0xFF,
572 + /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
573 + /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
574 + /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
575 + /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
576 + /* Data[4].ctlEdges[4].bChannel */ 0xFF,
577 + /* Data[4].ctlEdges[5].bChannel */ 0xFF,
578 + /* Data[4].ctlEdges[6].bChannel */ 0xFF,
579 + /* Data[4].ctlEdges[7].bChannel */ 0xFF,
583 + /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
584 + /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
585 + /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
586 + /* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
587 + /* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
588 + /* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
589 + /* Data[5].ctlEdges[6].bChannel */ 0xFF,
590 + /* Data[5].ctlEdges[7].bChannel */ 0xFF
594 + /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
595 + /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
596 + /* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
597 + /* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
598 + /* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
599 + /* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
600 + /* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
601 + /* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
605 + /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
606 + /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
607 + /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
608 + /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
609 + /* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
610 + /* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
611 + /* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
612 + /* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
616 + /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
617 + /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
618 + /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
619 + /* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
620 + /* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
621 + /* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
622 + /* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
623 + /* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
626 + .ctlPowerData_5G = {
629 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
630 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
635 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
636 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
641 + {60, 0}, {60, 1}, {60, 0}, {60, 1},
642 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
647 + {60, 0}, {60, 1}, {60, 1}, {60, 0},
648 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
653 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
654 + {60, 0}, {60, 0}, {60, 0}, {60, 0},
659 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
660 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
665 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
666 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
671 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
672 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
677 + {60, 1}, {60, 0}, {60, 1}, {60, 1},
678 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
684 +static const struct ar9300_eeprom ar9300_x113 = {
685 + .eepromVersion = 2,
686 + .templateVersion = 6,
687 + .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
688 + .custData = {"x113-023-f0000"},
690 + .regDmn = { LE16(0), LE16(0x1f) },
691 + .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
693 + .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
697 + .blueToothOptions = 0,
699 + .deviceType = 5, /* takes lower byte in eeprom location */
700 + .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
701 + .params_for_tuning_caps = {0, 0},
702 + .featureEnable = 0x0d,
704 + * bit0 - enable tx temp comp - disabled
705 + * bit1 - enable tx volt comp - disabled
706 + * bit2 - enable fastClock - enabled
707 + * bit3 - enable doubling - enabled
708 + * bit4 - enable internal regulator - disabled
709 + * bit5 - enable pa predistortion - disabled
711 + .miscConfiguration = 0, /* bit0 - turn down drivestrength */
712 + .eepromWriteEnableGpio = 6,
713 + .wlanDisableGpio = 0,
715 + .rxBandSelectGpio = 0xff,
720 + /* ar9300_modal_eep_header 2g */
721 + /* 4 idle,t1,t2,b(4 bits per setting) */
722 + .antCtrlCommon = LE32(0x110),
723 + /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
724 + .antCtrlCommon2 = LE32(0x44444),
727 + * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
728 + * rx1, rx12, b (2 bits each)
730 + .antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
733 + * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
734 + * for ar9280 (0xa20c/b20c 5:0)
736 + .xatten1DB = {0, 0, 0},
739 + * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
740 + * for ar9280 (0xa20c/b20c 16:12
742 + .xatten1Margin = {0, 0, 0},
747 + * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
748 + * channels in usual fbin coding format
750 + .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
753 + * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
754 + * if the register is per chain
756 + .noiseFloorThreshCh = {-1, 0, 0},
757 + .ob = {1, 1, 1},/* 3 chain */
758 + .db_stage2 = {1, 1, 1}, /* 3 chain */
759 + .db_stage3 = {0, 0, 0},
760 + .db_stage4 = {0, 0, 0},
762 + .txFrameToDataStart = 0x0e,
763 + .txFrameToPaOn = 0x0e,
764 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
766 + .switchSettling = 0x2c,
767 + .adcDesiredSize = -30,
768 + .txEndToXpaOff = 0,
769 + .txEndToRxOn = 0x2,
770 + .txFrameToXpaOn = 0xe,
772 + .papdRateMaskHt20 = LE32(0x0c80c080),
773 + .papdRateMaskHt40 = LE32(0x0080c080),
775 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
779 + .ant_div_control = 0,
780 + .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
783 + FREQ2FBIN(2412, 1),
784 + FREQ2FBIN(2437, 1),
785 + FREQ2FBIN(2472, 1),
787 + /* ar9300_cal_data_per_freq_op_loop 2g */
789 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
790 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
791 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
793 + .calTarget_freqbin_Cck = {
794 + FREQ2FBIN(2412, 1),
795 + FREQ2FBIN(2472, 1),
797 + .calTarget_freqbin_2G = {
798 + FREQ2FBIN(2412, 1),
799 + FREQ2FBIN(2437, 1),
802 + .calTarget_freqbin_2GHT20 = {
803 + FREQ2FBIN(2412, 1),
804 + FREQ2FBIN(2437, 1),
807 + .calTarget_freqbin_2GHT40 = {
808 + FREQ2FBIN(2412, 1),
809 + FREQ2FBIN(2437, 1),
812 + .calTargetPowerCck = {
813 + /* 1L-5L,5S,11L,11S */
814 + { {34, 34, 34, 34} },
815 + { {34, 34, 34, 34} },
817 + .calTargetPower2G = {
818 + /* 6-24,36,48,54 */
819 + { {34, 34, 32, 32} },
820 + { {34, 34, 32, 32} },
821 + { {34, 34, 32, 32} },
823 + .calTargetPower2GHT20 = {
824 + { {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
825 + { {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
826 + { {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
828 + .calTargetPower2GHT40 = {
829 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
830 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
831 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
834 + 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
835 + 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
837 + .ctl_freqbin_2G = {
839 + FREQ2FBIN(2412, 1),
840 + FREQ2FBIN(2417, 1),
841 + FREQ2FBIN(2457, 1),
845 + FREQ2FBIN(2412, 1),
846 + FREQ2FBIN(2417, 1),
847 + FREQ2FBIN(2462, 1),
852 + FREQ2FBIN(2412, 1),
853 + FREQ2FBIN(2417, 1),
854 + FREQ2FBIN(2462, 1),
858 + FREQ2FBIN(2422, 1),
859 + FREQ2FBIN(2427, 1),
860 + FREQ2FBIN(2447, 1),
865 + /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
866 + /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
867 + /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
868 + /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
872 + /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
873 + /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
874 + /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
879 + /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
880 + /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
881 + FREQ2FBIN(2472, 1),
886 + /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
887 + /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
888 + /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
889 + /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
893 + /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
894 + /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
895 + /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
899 + /* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
900 + /* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
901 + /* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
906 + /* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
907 + /* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
908 + /* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
913 + /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
914 + /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
915 + /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
916 + /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
919 + .ctlPowerData_2G = {
920 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
921 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
922 + { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
924 + { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
925 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
926 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
928 + { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
929 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
930 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
932 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
933 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
934 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
937 + /* 4 idle,t1,t2,b (4 bits per setting) */
938 + .antCtrlCommon = LE32(0x220),
939 + /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
940 + .antCtrlCommon2 = LE32(0x11111),
941 + /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
943 + LE16(0x150), LE16(0x150), LE16(0x150),
945 + /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
946 + .xatten1DB = {0, 0, 0},
949 + * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
950 + * for merlin (0xa20c/b20c 16:12
952 + .xatten1Margin = {0, 0, 0},
955 + /* spurChans spur channels in usual fbin coding format */
956 + .spurChans = {FREQ2FBIN(5500, 0), 0, 0, 0, 0},
957 + /* noiseFloorThreshCh Check if the register is per chain */
958 + .noiseFloorThreshCh = {-1, 0, 0},
959 + .ob = {3, 3, 3}, /* 3 chain */
960 + .db_stage2 = {3, 3, 3}, /* 3 chain */
961 + .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
962 + .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
964 + .txFrameToDataStart = 0x0e,
965 + .txFrameToPaOn = 0x0e,
966 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
968 + .switchSettling = 0x2d,
969 + .adcDesiredSize = -30,
970 + .txEndToXpaOff = 0,
971 + .txEndToRxOn = 0x2,
972 + .txFrameToXpaOn = 0xe,
974 + .papdRateMaskHt20 = LE32(0x0cf0e0e0),
975 + .papdRateMaskHt40 = LE32(0x6cf0e0e0),
977 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
981 + .tempSlopeLow = 72,
982 + .tempSlopeHigh = 105,
983 + .xatten1DBLow = {0, 0, 0},
984 + .xatten1MarginLow = {0, 0, 0},
985 + .xatten1DBHigh = {0, 0, 0},
986 + .xatten1MarginHigh = {0, 0, 0}
989 + FREQ2FBIN(5180, 0),
990 + FREQ2FBIN(5240, 0),
991 + FREQ2FBIN(5320, 0),
992 + FREQ2FBIN(5400, 0),
993 + FREQ2FBIN(5500, 0),
994 + FREQ2FBIN(5600, 0),
995 + FREQ2FBIN(5745, 0),
1031 + .calTarget_freqbin_5G = {
1032 + FREQ2FBIN(5180, 0),
1033 + FREQ2FBIN(5220, 0),
1034 + FREQ2FBIN(5320, 0),
1035 + FREQ2FBIN(5400, 0),
1036 + FREQ2FBIN(5500, 0),
1037 + FREQ2FBIN(5600, 0),
1038 + FREQ2FBIN(5745, 0),
1039 + FREQ2FBIN(5785, 0)
1041 + .calTarget_freqbin_5GHT20 = {
1042 + FREQ2FBIN(5180, 0),
1043 + FREQ2FBIN(5240, 0),
1044 + FREQ2FBIN(5320, 0),
1045 + FREQ2FBIN(5400, 0),
1046 + FREQ2FBIN(5500, 0),
1047 + FREQ2FBIN(5700, 0),
1048 + FREQ2FBIN(5745, 0),
1049 + FREQ2FBIN(5825, 0)
1051 + .calTarget_freqbin_5GHT40 = {
1052 + FREQ2FBIN(5190, 0),
1053 + FREQ2FBIN(5230, 0),
1054 + FREQ2FBIN(5320, 0),
1055 + FREQ2FBIN(5410, 0),
1056 + FREQ2FBIN(5510, 0),
1057 + FREQ2FBIN(5670, 0),
1058 + FREQ2FBIN(5755, 0),
1059 + FREQ2FBIN(5825, 0)
1061 + .calTargetPower5G = {
1062 + /* 6-24,36,48,54 */
1063 + { {42, 40, 40, 34} },
1064 + { {42, 40, 40, 34} },
1065 + { {42, 40, 40, 34} },
1066 + { {42, 40, 40, 34} },
1067 + { {42, 40, 40, 34} },
1068 + { {42, 40, 40, 34} },
1069 + { {42, 40, 40, 34} },
1070 + { {42, 40, 40, 34} },
1072 + .calTargetPower5GHT20 = {
1074 + * 0_8_16,1-3_9-11_17-19,
1075 + * 4,5,6,7,12,13,14,15,20,21,22,23
1077 + { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1078 + { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1079 + { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1080 + { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1081 + { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1082 + { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1083 + { {38, 38, 38, 38, 32, 28, 38, 38, 32, 28, 38, 38, 32, 26} },
1084 + { {36, 36, 36, 36, 32, 28, 36, 36, 32, 28, 36, 36, 32, 26} },
1086 + .calTargetPower5GHT40 = {
1088 + * 0_8_16,1-3_9-11_17-19,
1089 + * 4,5,6,7,12,13,14,15,20,21,22,23
1091 + { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1092 + { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1093 + { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1094 + { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1095 + { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1096 + { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1097 + { {36, 36, 36, 36, 30, 26, 36, 36, 30, 26, 36, 36, 30, 24} },
1098 + { {34, 34, 34, 34, 30, 26, 34, 34, 30, 26, 34, 34, 30, 24} },
1101 + 0x10, 0x16, 0x18, 0x40, 0x46,
1102 + 0x48, 0x30, 0x36, 0x38
1104 + .ctl_freqbin_5G = {
1106 + /* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1107 + /* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1108 + /* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1109 + /* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1110 + /* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
1111 + /* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1112 + /* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1113 + /* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1116 + /* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1117 + /* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1118 + /* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1119 + /* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1120 + /* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
1121 + /* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1122 + /* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1123 + /* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1127 + /* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1128 + /* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1129 + /* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1130 + /* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
1131 + /* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
1132 + /* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
1133 + /* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
1134 + /* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
1138 + /* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1139 + /* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1140 + /* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
1141 + /* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
1142 + /* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1143 + /* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1144 + /* Data[3].ctlEdges[6].bChannel */ 0xFF,
1145 + /* Data[3].ctlEdges[7].bChannel */ 0xFF,
1149 + /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1150 + /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1151 + /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
1152 + /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
1153 + /* Data[4].ctlEdges[4].bChannel */ 0xFF,
1154 + /* Data[4].ctlEdges[5].bChannel */ 0xFF,
1155 + /* Data[4].ctlEdges[6].bChannel */ 0xFF,
1156 + /* Data[4].ctlEdges[7].bChannel */ 0xFF,
1160 + /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1161 + /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
1162 + /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
1163 + /* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1164 + /* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
1165 + /* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1166 + /* Data[5].ctlEdges[6].bChannel */ 0xFF,
1167 + /* Data[5].ctlEdges[7].bChannel */ 0xFF
1171 + /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1172 + /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1173 + /* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
1174 + /* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
1175 + /* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1176 + /* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
1177 + /* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
1178 + /* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
1182 + /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1183 + /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1184 + /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
1185 + /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1186 + /* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
1187 + /* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1188 + /* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1189 + /* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1193 + /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1194 + /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1195 + /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1196 + /* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1197 + /* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
1198 + /* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1199 + /* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
1200 + /* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
1203 + .ctlPowerData_5G = {
1206 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1207 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1212 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1213 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1218 + {60, 0}, {60, 1}, {60, 0}, {60, 1},
1219 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1224 + {60, 0}, {60, 1}, {60, 1}, {60, 0},
1225 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
1230 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1231 + {60, 0}, {60, 0}, {60, 0}, {60, 0},
1236 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1237 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
1242 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1243 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1248 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
1249 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1254 + {60, 1}, {60, 0}, {60, 1}, {60, 1},
1255 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
1262 +static const struct ar9300_eeprom ar9300_h112 = {
1263 + .eepromVersion = 2,
1264 + .templateVersion = 3,
1265 + .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
1266 + .custData = {"h112-241-f0000"},
1267 + .baseEepHeader = {
1268 + .regDmn = { LE16(0), LE16(0x1f) },
1269 + .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
1271 + .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
1275 + .blueToothOptions = 0,
1277 + .deviceType = 5, /* takes lower byte in eeprom location */
1278 + .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
1279 + .params_for_tuning_caps = {0, 0},
1280 + .featureEnable = 0x0d,
1282 + * bit0 - enable tx temp comp - disabled
1283 + * bit1 - enable tx volt comp - disabled
1284 + * bit2 - enable fastClock - enabled
1285 + * bit3 - enable doubling - enabled
1286 + * bit4 - enable internal regulator - disabled
1287 + * bit5 - enable pa predistortion - disabled
1289 + .miscConfiguration = 0, /* bit0 - turn down drivestrength */
1290 + .eepromWriteEnableGpio = 6,
1291 + .wlanDisableGpio = 0,
1293 + .rxBandSelectGpio = 0xff,
1297 + .modalHeader2G = {
1298 + /* ar9300_modal_eep_header 2g */
1299 + /* 4 idle,t1,t2,b(4 bits per setting) */
1300 + .antCtrlCommon = LE32(0x110),
1301 + /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
1302 + .antCtrlCommon2 = LE32(0x44444),
1305 + * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
1306 + * rx1, rx12, b (2 bits each)
1308 + .antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
1311 + * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
1312 + * for ar9280 (0xa20c/b20c 5:0)
1314 + .xatten1DB = {0, 0, 0},
1317 + * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
1318 + * for ar9280 (0xa20c/b20c 16:12
1320 + .xatten1Margin = {0, 0, 0},
1325 + * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
1326 + * channels in usual fbin coding format
1328 + .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
1331 + * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
1332 + * if the register is per chain
1334 + .noiseFloorThreshCh = {-1, 0, 0},
1335 + .ob = {1, 1, 1},/* 3 chain */
1336 + .db_stage2 = {1, 1, 1}, /* 3 chain */
1337 + .db_stage3 = {0, 0, 0},
1338 + .db_stage4 = {0, 0, 0},
1340 + .txFrameToDataStart = 0x0e,
1341 + .txFrameToPaOn = 0x0e,
1342 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
1344 + .switchSettling = 0x2c,
1345 + .adcDesiredSize = -30,
1346 + .txEndToXpaOff = 0,
1347 + .txEndToRxOn = 0x2,
1348 + .txFrameToXpaOn = 0xe,
1350 + .papdRateMaskHt20 = LE32(0x80c080),
1351 + .papdRateMaskHt40 = LE32(0x80c080),
1353 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1357 + .ant_div_control = 0,
1358 + .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
1360 + .calFreqPier2G = {
1361 + FREQ2FBIN(2412, 1),
1362 + FREQ2FBIN(2437, 1),
1363 + FREQ2FBIN(2472, 1),
1365 + /* ar9300_cal_data_per_freq_op_loop 2g */
1366 + .calPierData2G = {
1367 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1368 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1369 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1371 + .calTarget_freqbin_Cck = {
1372 + FREQ2FBIN(2412, 1),
1373 + FREQ2FBIN(2484, 1),
1375 + .calTarget_freqbin_2G = {
1376 + FREQ2FBIN(2412, 1),
1377 + FREQ2FBIN(2437, 1),
1378 + FREQ2FBIN(2472, 1)
1380 + .calTarget_freqbin_2GHT20 = {
1381 + FREQ2FBIN(2412, 1),
1382 + FREQ2FBIN(2437, 1),
1383 + FREQ2FBIN(2472, 1)
1385 + .calTarget_freqbin_2GHT40 = {
1386 + FREQ2FBIN(2412, 1),
1387 + FREQ2FBIN(2437, 1),
1388 + FREQ2FBIN(2472, 1)
1390 + .calTargetPowerCck = {
1391 + /* 1L-5L,5S,11L,11S */
1392 + { {34, 34, 34, 34} },
1393 + { {34, 34, 34, 34} },
1395 + .calTargetPower2G = {
1396 + /* 6-24,36,48,54 */
1397 + { {34, 34, 32, 32} },
1398 + { {34, 34, 32, 32} },
1399 + { {34, 34, 32, 32} },
1401 + .calTargetPower2GHT20 = {
1402 + { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
1403 + { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
1404 + { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
1406 + .calTargetPower2GHT40 = {
1407 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
1408 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
1409 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
1412 + 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
1413 + 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
1415 + .ctl_freqbin_2G = {
1417 + FREQ2FBIN(2412, 1),
1418 + FREQ2FBIN(2417, 1),
1419 + FREQ2FBIN(2457, 1),
1420 + FREQ2FBIN(2462, 1)
1423 + FREQ2FBIN(2412, 1),
1424 + FREQ2FBIN(2417, 1),
1425 + FREQ2FBIN(2462, 1),
1430 + FREQ2FBIN(2412, 1),
1431 + FREQ2FBIN(2417, 1),
1432 + FREQ2FBIN(2462, 1),
1436 + FREQ2FBIN(2422, 1),
1437 + FREQ2FBIN(2427, 1),
1438 + FREQ2FBIN(2447, 1),
1439 + FREQ2FBIN(2452, 1)
1443 + /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1444 + /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1445 + /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1446 + /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
1450 + /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1451 + /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1452 + /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1457 + /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1458 + /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1459 + FREQ2FBIN(2472, 1),
1464 + /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
1465 + /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
1466 + /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
1467 + /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
1471 + /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1472 + /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1473 + /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1477 + /* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1478 + /* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1479 + /* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1484 + /* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1485 + /* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1486 + /* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1491 + /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
1492 + /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
1493 + /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
1494 + /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
1497 + .ctlPowerData_2G = {
1498 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1499 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1500 + { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
1502 + { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
1503 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1504 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1506 + { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
1507 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1508 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1510 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1511 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
1512 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
1514 + .modalHeader5G = {
1515 + /* 4 idle,t1,t2,b (4 bits per setting) */
1516 + .antCtrlCommon = LE32(0x220),
1517 + /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
1518 + .antCtrlCommon2 = LE32(0x44444),
1519 + /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
1521 + LE16(0x150), LE16(0x150), LE16(0x150),
1523 + /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
1524 + .xatten1DB = {0, 0, 0},
1527 + * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
1528 + * for merlin (0xa20c/b20c 16:12
1530 + .xatten1Margin = {0, 0, 0},
1533 + /* spurChans spur channels in usual fbin coding format */
1534 + .spurChans = {0, 0, 0, 0, 0},
1535 + /* noiseFloorThreshCh Check if the register is per chain */
1536 + .noiseFloorThreshCh = {-1, 0, 0},
1537 + .ob = {3, 3, 3}, /* 3 chain */
1538 + .db_stage2 = {3, 3, 3}, /* 3 chain */
1539 + .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
1540 + .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
1542 + .txFrameToDataStart = 0x0e,
1543 + .txFrameToPaOn = 0x0e,
1544 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
1546 + .switchSettling = 0x2d,
1547 + .adcDesiredSize = -30,
1548 + .txEndToXpaOff = 0,
1549 + .txEndToRxOn = 0x2,
1550 + .txFrameToXpaOn = 0xe,
1552 + .papdRateMaskHt20 = LE32(0x0cf0e0e0),
1553 + .papdRateMaskHt40 = LE32(0x6cf0e0e0),
1555 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1559 + .tempSlopeLow = 40,
1560 + .tempSlopeHigh = 50,
1561 + .xatten1DBLow = {0, 0, 0},
1562 + .xatten1MarginLow = {0, 0, 0},
1563 + .xatten1DBHigh = {0, 0, 0},
1564 + .xatten1MarginHigh = {0, 0, 0}
1566 + .calFreqPier5G = {
1567 + FREQ2FBIN(5180, 0),
1568 + FREQ2FBIN(5220, 0),
1569 + FREQ2FBIN(5320, 0),
1570 + FREQ2FBIN(5400, 0),
1571 + FREQ2FBIN(5500, 0),
1572 + FREQ2FBIN(5600, 0),
1573 + FREQ2FBIN(5700, 0),
1574 + FREQ2FBIN(5825, 0)
1576 + .calPierData5G = {
1609 + .calTarget_freqbin_5G = {
1610 + FREQ2FBIN(5180, 0),
1611 + FREQ2FBIN(5240, 0),
1612 + FREQ2FBIN(5320, 0),
1613 + FREQ2FBIN(5400, 0),
1614 + FREQ2FBIN(5500, 0),
1615 + FREQ2FBIN(5600, 0),
1616 + FREQ2FBIN(5700, 0),
1617 + FREQ2FBIN(5825, 0)
1619 + .calTarget_freqbin_5GHT20 = {
1620 + FREQ2FBIN(5180, 0),
1621 + FREQ2FBIN(5240, 0),
1622 + FREQ2FBIN(5320, 0),
1623 + FREQ2FBIN(5400, 0),
1624 + FREQ2FBIN(5500, 0),
1625 + FREQ2FBIN(5700, 0),
1626 + FREQ2FBIN(5745, 0),
1627 + FREQ2FBIN(5825, 0)
1629 + .calTarget_freqbin_5GHT40 = {
1630 + FREQ2FBIN(5180, 0),
1631 + FREQ2FBIN(5240, 0),
1632 + FREQ2FBIN(5320, 0),
1633 + FREQ2FBIN(5400, 0),
1634 + FREQ2FBIN(5500, 0),
1635 + FREQ2FBIN(5700, 0),
1636 + FREQ2FBIN(5745, 0),
1637 + FREQ2FBIN(5825, 0)
1639 + .calTargetPower5G = {
1640 + /* 6-24,36,48,54 */
1641 + { {30, 30, 28, 24} },
1642 + { {30, 30, 28, 24} },
1643 + { {30, 30, 28, 24} },
1644 + { {30, 30, 28, 24} },
1645 + { {30, 30, 28, 24} },
1646 + { {30, 30, 28, 24} },
1647 + { {30, 30, 28, 24} },
1648 + { {30, 30, 28, 24} },
1650 + .calTargetPower5GHT20 = {
1652 + * 0_8_16,1-3_9-11_17-19,
1653 + * 4,5,6,7,12,13,14,15,20,21,22,23
1655 + { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 20, 20, 20, 16} },
1656 + { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 20, 20, 20, 16} },
1657 + { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 18, 18, 18, 16} },
1658 + { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 18, 18, 18, 16} },
1659 + { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 16, 16, 16, 14} },
1660 + { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 16, 16, 16, 14} },
1661 + { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 14, 14, 14, 12} },
1662 + { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 14, 14, 14, 12} },
1664 + .calTargetPower5GHT40 = {
1666 + * 0_8_16,1-3_9-11_17-19,
1667 + * 4,5,6,7,12,13,14,15,20,21,22,23
1669 + { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 18, 18, 18, 14} },
1670 + { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 18, 18, 18, 14} },
1671 + { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 16, 16, 16, 12} },
1672 + { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 16, 16, 16, 12} },
1673 + { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 14, 14, 14, 10} },
1674 + { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 14, 14, 14, 10} },
1675 + { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 12, 12, 12, 8} },
1676 + { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 12, 12, 12, 8} },
1679 + 0x10, 0x16, 0x18, 0x40, 0x46,
1680 + 0x48, 0x30, 0x36, 0x38
1682 + .ctl_freqbin_5G = {
1684 + /* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1685 + /* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1686 + /* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1687 + /* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1688 + /* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
1689 + /* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1690 + /* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1691 + /* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1694 + /* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1695 + /* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1696 + /* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1697 + /* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1698 + /* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
1699 + /* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1700 + /* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1701 + /* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1705 + /* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1706 + /* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1707 + /* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1708 + /* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
1709 + /* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
1710 + /* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
1711 + /* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
1712 + /* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
1716 + /* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1717 + /* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1718 + /* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
1719 + /* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
1720 + /* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1721 + /* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1722 + /* Data[3].ctlEdges[6].bChannel */ 0xFF,
1723 + /* Data[3].ctlEdges[7].bChannel */ 0xFF,
1727 + /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1728 + /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1729 + /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
1730 + /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
1731 + /* Data[4].ctlEdges[4].bChannel */ 0xFF,
1732 + /* Data[4].ctlEdges[5].bChannel */ 0xFF,
1733 + /* Data[4].ctlEdges[6].bChannel */ 0xFF,
1734 + /* Data[4].ctlEdges[7].bChannel */ 0xFF,
1738 + /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1739 + /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
1740 + /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
1741 + /* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1742 + /* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
1743 + /* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1744 + /* Data[5].ctlEdges[6].bChannel */ 0xFF,
1745 + /* Data[5].ctlEdges[7].bChannel */ 0xFF
1749 + /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1750 + /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1751 + /* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
1752 + /* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
1753 + /* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1754 + /* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
1755 + /* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
1756 + /* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
1760 + /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1761 + /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1762 + /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
1763 + /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1764 + /* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
1765 + /* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1766 + /* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1767 + /* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1771 + /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1772 + /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1773 + /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1774 + /* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1775 + /* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
1776 + /* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1777 + /* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
1778 + /* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
1781 + .ctlPowerData_5G = {
1784 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1785 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1790 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1791 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1796 + {60, 0}, {60, 1}, {60, 0}, {60, 1},
1797 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1802 + {60, 0}, {60, 1}, {60, 1}, {60, 0},
1803 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
1808 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1809 + {60, 0}, {60, 0}, {60, 0}, {60, 0},
1814 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1815 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
1820 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1821 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
1826 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
1827 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
1832 + {60, 1}, {60, 0}, {60, 1}, {60, 1},
1833 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
1840 +static const struct ar9300_eeprom ar9300_x112 = {
1841 + .eepromVersion = 2,
1842 + .templateVersion = 5,
1843 + .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
1844 + .custData = {"x112-041-f0000"},
1845 + .baseEepHeader = {
1846 + .regDmn = { LE16(0), LE16(0x1f) },
1847 + .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
1849 + .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
1853 + .blueToothOptions = 0,
1855 + .deviceType = 5, /* takes lower byte in eeprom location */
1856 + .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
1857 + .params_for_tuning_caps = {0, 0},
1858 + .featureEnable = 0x0d,
1860 + * bit0 - enable tx temp comp - disabled
1861 + * bit1 - enable tx volt comp - disabled
1862 + * bit2 - enable fastclock - enabled
1863 + * bit3 - enable doubling - enabled
1864 + * bit4 - enable internal regulator - disabled
1865 + * bit5 - enable pa predistortion - disabled
1867 + .miscConfiguration = 0, /* bit0 - turn down drivestrength */
1868 + .eepromWriteEnableGpio = 6,
1869 + .wlanDisableGpio = 0,
1871 + .rxBandSelectGpio = 0xff,
1875 + .modalHeader2G = {
1876 + /* ar9300_modal_eep_header 2g */
1877 + /* 4 idle,t1,t2,b(4 bits per setting) */
1878 + .antCtrlCommon = LE32(0x110),
1879 + /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
1880 + .antCtrlCommon2 = LE32(0x22222),
1883 + * antCtrlChain[ar9300_max_chains]; 6 idle, t, r,
1884 + * rx1, rx12, b (2 bits each)
1886 + .antCtrlChain = { LE16(0x10), LE16(0x10), LE16(0x10) },
1889 + * xatten1DB[AR9300_max_chains]; 3 xatten1_db
1890 + * for ar9280 (0xa20c/b20c 5:0)
1892 + .xatten1DB = {0x1b, 0x1b, 0x1b},
1895 + * xatten1Margin[ar9300_max_chains]; 3 xatten1_margin
1896 + * for ar9280 (0xa20c/b20c 16:12
1898 + .xatten1Margin = {0x15, 0x15, 0x15},
1903 + * spurChans[OSPrey_eeprom_modal_sPURS]; spur
1904 + * channels in usual fbin coding format
1906 + .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
1909 + * noiseFloorThreshch[ar9300_max_cHAINS]; 3 Check
1910 + * if the register is per chain
1912 + .noiseFloorThreshCh = {-1, 0, 0},
1913 + .ob = {1, 1, 1},/* 3 chain */
1914 + .db_stage2 = {1, 1, 1}, /* 3 chain */
1915 + .db_stage3 = {0, 0, 0},
1916 + .db_stage4 = {0, 0, 0},
1918 + .txFrameToDataStart = 0x0e,
1919 + .txFrameToPaOn = 0x0e,
1920 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
1922 + .switchSettling = 0x2c,
1923 + .adcDesiredSize = -30,
1924 + .txEndToXpaOff = 0,
1925 + .txEndToRxOn = 0x2,
1926 + .txFrameToXpaOn = 0xe,
1928 + .papdRateMaskHt20 = LE32(0x0c80c080),
1929 + .papdRateMaskHt40 = LE32(0x0080c080),
1931 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1935 + .ant_div_control = 0,
1936 + .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
1938 + .calFreqPier2G = {
1939 + FREQ2FBIN(2412, 1),
1940 + FREQ2FBIN(2437, 1),
1941 + FREQ2FBIN(2472, 1),
1943 + /* ar9300_cal_data_per_freq_op_loop 2g */
1944 + .calPierData2G = {
1945 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1946 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1947 + { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1949 + .calTarget_freqbin_Cck = {
1950 + FREQ2FBIN(2412, 1),
1951 + FREQ2FBIN(2472, 1),
1953 + .calTarget_freqbin_2G = {
1954 + FREQ2FBIN(2412, 1),
1955 + FREQ2FBIN(2437, 1),
1956 + FREQ2FBIN(2472, 1)
1958 + .calTarget_freqbin_2GHT20 = {
1959 + FREQ2FBIN(2412, 1),
1960 + FREQ2FBIN(2437, 1),
1961 + FREQ2FBIN(2472, 1)
1963 + .calTarget_freqbin_2GHT40 = {
1964 + FREQ2FBIN(2412, 1),
1965 + FREQ2FBIN(2437, 1),
1966 + FREQ2FBIN(2472, 1)
1968 + .calTargetPowerCck = {
1969 + /* 1L-5L,5S,11L,11s */
1970 + { {38, 38, 38, 38} },
1971 + { {38, 38, 38, 38} },
1973 + .calTargetPower2G = {
1974 + /* 6-24,36,48,54 */
1975 + { {38, 38, 36, 34} },
1976 + { {38, 38, 36, 34} },
1977 + { {38, 38, 34, 32} },
1979 + .calTargetPower2GHT20 = {
1980 + { {36, 36, 36, 36, 36, 34, 34, 32, 30, 28, 28, 28, 28, 26} },
1981 + { {36, 36, 36, 36, 36, 34, 36, 34, 32, 30, 30, 30, 28, 26} },
1982 + { {36, 36, 36, 36, 36, 34, 34, 32, 30, 28, 28, 28, 28, 26} },
1984 + .calTargetPower2GHT40 = {
1985 + { {36, 36, 36, 36, 34, 32, 32, 30, 28, 26, 26, 26, 26, 24} },
1986 + { {36, 36, 36, 36, 34, 32, 34, 32, 30, 28, 28, 28, 28, 24} },
1987 + { {36, 36, 36, 36, 34, 32, 32, 30, 28, 26, 26, 26, 26, 24} },
1990 + 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
1991 + 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
1993 + .ctl_freqbin_2G = {
1995 + FREQ2FBIN(2412, 1),
1996 + FREQ2FBIN(2417, 1),
1997 + FREQ2FBIN(2457, 1),
1998 + FREQ2FBIN(2462, 1)
2001 + FREQ2FBIN(2412, 1),
2002 + FREQ2FBIN(2417, 1),
2003 + FREQ2FBIN(2462, 1),
2008 + FREQ2FBIN(2412, 1),
2009 + FREQ2FBIN(2417, 1),
2010 + FREQ2FBIN(2462, 1),
2014 + FREQ2FBIN(2422, 1),
2015 + FREQ2FBIN(2427, 1),
2016 + FREQ2FBIN(2447, 1),
2017 + FREQ2FBIN(2452, 1)
2021 + /* Data[4].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2022 + /* Data[4].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2023 + /* Data[4].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2024 + /* Data[4].ctledges[3].bchannel */ FREQ2FBIN(2484, 1),
2028 + /* Data[5].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2029 + /* Data[5].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2030 + /* Data[5].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2035 + /* Data[6].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2036 + /* Data[6].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2037 + FREQ2FBIN(2472, 1),
2042 + /* Data[7].ctledges[0].bchannel */ FREQ2FBIN(2422, 1),
2043 + /* Data[7].ctledges[1].bchannel */ FREQ2FBIN(2427, 1),
2044 + /* Data[7].ctledges[2].bchannel */ FREQ2FBIN(2447, 1),
2045 + /* Data[7].ctledges[3].bchannel */ FREQ2FBIN(2462, 1),
2049 + /* Data[8].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2050 + /* Data[8].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2051 + /* Data[8].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2055 + /* Data[9].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2056 + /* Data[9].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2057 + /* Data[9].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2062 + /* Data[10].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2063 + /* Data[10].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2064 + /* Data[10].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2069 + /* Data[11].ctledges[0].bchannel */ FREQ2FBIN(2422, 1),
2070 + /* Data[11].ctledges[1].bchannel */ FREQ2FBIN(2427, 1),
2071 + /* Data[11].ctledges[2].bchannel */ FREQ2FBIN(2447, 1),
2072 + /* Data[11].ctledges[3].bchannel */ FREQ2FBIN(2462, 1),
2075 + .ctlPowerData_2G = {
2076 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2077 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2078 + { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
2080 + { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
2081 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2082 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2084 + { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
2085 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2086 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2088 + { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2089 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2090 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2092 + .modalHeader5G = {
2093 + /* 4 idle,t1,t2,b (4 bits per setting) */
2094 + .antCtrlCommon = LE32(0x110),
2095 + /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
2096 + .antCtrlCommon2 = LE32(0x22222),
2097 + /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
2099 + LE16(0x0), LE16(0x0), LE16(0x0),
2101 + /* xatten1DB 3 xatten1_db for ar9280 (0xa20c/b20c 5:0) */
2102 + .xatten1DB = {0x13, 0x19, 0x17},
2105 + * xatten1Margin[ar9300_max_chains]; 3 xatten1_margin
2106 + * for merlin (0xa20c/b20c 16:12
2108 + .xatten1Margin = {0x19, 0x19, 0x19},
2111 + /* spurChans spur channels in usual fbin coding format */
2112 + .spurChans = {0, 0, 0, 0, 0},
2113 + /* noiseFloorThreshch check if the register is per chain */
2114 + .noiseFloorThreshCh = {-1, 0, 0},
2115 + .ob = {3, 3, 3}, /* 3 chain */
2116 + .db_stage2 = {3, 3, 3}, /* 3 chain */
2117 + .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
2118 + .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
2120 + .txFrameToDataStart = 0x0e,
2121 + .txFrameToPaOn = 0x0e,
2122 + .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
2124 + .switchSettling = 0x2d,
2125 + .adcDesiredSize = -30,
2126 + .txEndToXpaOff = 0,
2127 + .txEndToRxOn = 0x2,
2128 + .txFrameToXpaOn = 0xe,
2130 + .papdRateMaskHt20 = LE32(0x0cf0e0e0),
2131 + .papdRateMaskHt40 = LE32(0x6cf0e0e0),
2133 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2137 + .tempSlopeLow = 72,
2138 + .tempSlopeHigh = 105,
2139 + .xatten1DBLow = {0x10, 0x14, 0x10},
2140 + .xatten1MarginLow = {0x19, 0x19 , 0x19},
2141 + .xatten1DBHigh = {0x1d, 0x20, 0x24},
2142 + .xatten1MarginHigh = {0x10, 0x10, 0x10}
2144 + .calFreqPier5G = {
2145 + FREQ2FBIN(5180, 0),
2146 + FREQ2FBIN(5220, 0),
2147 + FREQ2FBIN(5320, 0),
2148 + FREQ2FBIN(5400, 0),
2149 + FREQ2FBIN(5500, 0),
2150 + FREQ2FBIN(5600, 0),
2151 + FREQ2FBIN(5700, 0),
2152 + FREQ2FBIN(5785, 0)
2154 + .calPierData5G = {
2187 + .calTarget_freqbin_5G = {
2188 + FREQ2FBIN(5180, 0),
2189 + FREQ2FBIN(5220, 0),
2190 + FREQ2FBIN(5320, 0),
2191 + FREQ2FBIN(5400, 0),
2192 + FREQ2FBIN(5500, 0),
2193 + FREQ2FBIN(5600, 0),
2194 + FREQ2FBIN(5725, 0),
2195 + FREQ2FBIN(5825, 0)
2197 + .calTarget_freqbin_5GHT20 = {
2198 + FREQ2FBIN(5180, 0),
2199 + FREQ2FBIN(5220, 0),
2200 + FREQ2FBIN(5320, 0),
2201 + FREQ2FBIN(5400, 0),
2202 + FREQ2FBIN(5500, 0),
2203 + FREQ2FBIN(5600, 0),
2204 + FREQ2FBIN(5725, 0),
2205 + FREQ2FBIN(5825, 0)
2207 + .calTarget_freqbin_5GHT40 = {
2208 + FREQ2FBIN(5180, 0),
2209 + FREQ2FBIN(5220, 0),
2210 + FREQ2FBIN(5320, 0),
2211 + FREQ2FBIN(5400, 0),
2212 + FREQ2FBIN(5500, 0),
2213 + FREQ2FBIN(5600, 0),
2214 + FREQ2FBIN(5725, 0),
2215 + FREQ2FBIN(5825, 0)
2217 + .calTargetPower5G = {
2218 + /* 6-24,36,48,54 */
2219 + { {32, 32, 28, 26} },
2220 + { {32, 32, 28, 26} },
2221 + { {32, 32, 28, 26} },
2222 + { {32, 32, 26, 24} },
2223 + { {32, 32, 26, 24} },
2224 + { {32, 32, 24, 22} },
2225 + { {30, 30, 24, 22} },
2226 + { {30, 30, 24, 22} },
2228 + .calTargetPower5GHT20 = {
2230 + * 0_8_16,1-3_9-11_17-19,
2231 + * 4,5,6,7,12,13,14,15,20,21,22,23
2233 + { {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
2234 + { {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
2235 + { {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
2236 + { {32, 32, 32, 32, 28, 26, 32, 26, 24, 22, 22, 22, 20, 20} },
2237 + { {32, 32, 32, 32, 28, 26, 32, 26, 24, 22, 20, 18, 16, 16} },
2238 + { {32, 32, 32, 32, 28, 26, 32, 24, 20, 16, 18, 16, 14, 14} },
2239 + { {30, 30, 30, 30, 28, 26, 30, 24, 20, 16, 18, 16, 14, 14} },
2240 + { {30, 30, 30, 30, 28, 26, 30, 24, 20, 16, 18, 16, 14, 14} },
2242 + .calTargetPower5GHT40 = {
2244 + * 0_8_16,1-3_9-11_17-19,
2245 + * 4,5,6,7,12,13,14,15,20,21,22,23
2247 + { {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
2248 + { {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
2249 + { {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
2250 + { {32, 32, 32, 30, 28, 26, 30, 26, 24, 22, 22, 22, 20, 20} },
2251 + { {32, 32, 32, 30, 28, 26, 30, 26, 24, 22, 20, 18, 16, 16} },
2252 + { {32, 32, 32, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
2253 + { {30, 30, 30, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
2254 + { {30, 30, 30, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
2257 + 0x10, 0x16, 0x18, 0x40, 0x46,
2258 + 0x48, 0x30, 0x36, 0x38
2260 + .ctl_freqbin_5G = {
2262 + /* Data[0].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2263 + /* Data[0].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2264 + /* Data[0].ctledges[2].bchannel */ FREQ2FBIN(5280, 0),
2265 + /* Data[0].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
2266 + /* Data[0].ctledges[4].bchannel */ FREQ2FBIN(5600, 0),
2267 + /* Data[0].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2268 + /* Data[0].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
2269 + /* Data[0].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
2272 + /* Data[1].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2273 + /* Data[1].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2274 + /* Data[1].ctledges[2].bchannel */ FREQ2FBIN(5280, 0),
2275 + /* Data[1].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
2276 + /* Data[1].ctledges[4].bchannel */ FREQ2FBIN(5520, 0),
2277 + /* Data[1].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2278 + /* Data[1].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
2279 + /* Data[1].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
2283 + /* Data[2].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
2284 + /* Data[2].ctledges[1].bchannel */ FREQ2FBIN(5230, 0),
2285 + /* Data[2].ctledges[2].bchannel */ FREQ2FBIN(5270, 0),
2286 + /* Data[2].ctledges[3].bchannel */ FREQ2FBIN(5310, 0),
2287 + /* Data[2].ctledges[4].bchannel */ FREQ2FBIN(5510, 0),
2288 + /* Data[2].ctledges[5].bchannel */ FREQ2FBIN(5550, 0),
2289 + /* Data[2].ctledges[6].bchannel */ FREQ2FBIN(5670, 0),
2290 + /* Data[2].ctledges[7].bchannel */ FREQ2FBIN(5755, 0)
2294 + /* Data[3].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2295 + /* Data[3].ctledges[1].bchannel */ FREQ2FBIN(5200, 0),
2296 + /* Data[3].ctledges[2].bchannel */ FREQ2FBIN(5260, 0),
2297 + /* Data[3].ctledges[3].bchannel */ FREQ2FBIN(5320, 0),
2298 + /* Data[3].ctledges[4].bchannel */ FREQ2FBIN(5500, 0),
2299 + /* Data[3].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2300 + /* Data[3].ctledges[6].bchannel */ 0xFF,
2301 + /* Data[3].ctledges[7].bchannel */ 0xFF,
2305 + /* Data[4].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2306 + /* Data[4].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2307 + /* Data[4].ctledges[2].bchannel */ FREQ2FBIN(5500, 0),
2308 + /* Data[4].ctledges[3].bchannel */ FREQ2FBIN(5700, 0),
2309 + /* Data[4].ctledges[4].bchannel */ 0xFF,
2310 + /* Data[4].ctledges[5].bchannel */ 0xFF,
2311 + /* Data[4].ctledges[6].bchannel */ 0xFF,
2312 + /* Data[4].ctledges[7].bchannel */ 0xFF,
2316 + /* Data[5].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
2317 + /* Data[5].ctledges[1].bchannel */ FREQ2FBIN(5270, 0),
2318 + /* Data[5].ctledges[2].bchannel */ FREQ2FBIN(5310, 0),
2319 + /* Data[5].ctledges[3].bchannel */ FREQ2FBIN(5510, 0),
2320 + /* Data[5].ctledges[4].bchannel */ FREQ2FBIN(5590, 0),
2321 + /* Data[5].ctledges[5].bchannel */ FREQ2FBIN(5670, 0),
2322 + /* Data[5].ctledges[6].bchannel */ 0xFF,
2323 + /* Data[5].ctledges[7].bchannel */ 0xFF
2327 + /* Data[6].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2328 + /* Data[6].ctledges[1].bchannel */ FREQ2FBIN(5200, 0),
2329 + /* Data[6].ctledges[2].bchannel */ FREQ2FBIN(5220, 0),
2330 + /* Data[6].ctledges[3].bchannel */ FREQ2FBIN(5260, 0),
2331 + /* Data[6].ctledges[4].bchannel */ FREQ2FBIN(5500, 0),
2332 + /* Data[6].ctledges[5].bchannel */ FREQ2FBIN(5600, 0),
2333 + /* Data[6].ctledges[6].bchannel */ FREQ2FBIN(5700, 0),
2334 + /* Data[6].ctledges[7].bchannel */ FREQ2FBIN(5745, 0)
2338 + /* Data[7].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2339 + /* Data[7].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2340 + /* Data[7].ctledges[2].bchannel */ FREQ2FBIN(5320, 0),
2341 + /* Data[7].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
2342 + /* Data[7].ctledges[4].bchannel */ FREQ2FBIN(5560, 0),
2343 + /* Data[7].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2344 + /* Data[7].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
2345 + /* Data[7].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
2349 + /* Data[8].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
2350 + /* Data[8].ctledges[1].bchannel */ FREQ2FBIN(5230, 0),
2351 + /* Data[8].ctledges[2].bchannel */ FREQ2FBIN(5270, 0),
2352 + /* Data[8].ctledges[3].bchannel */ FREQ2FBIN(5510, 0),
2353 + /* Data[8].ctledges[4].bchannel */ FREQ2FBIN(5550, 0),
2354 + /* Data[8].ctledges[5].bchannel */ FREQ2FBIN(5670, 0),
2355 + /* Data[8].ctledges[6].bchannel */ FREQ2FBIN(5755, 0),
2356 + /* Data[8].ctledges[7].bchannel */ FREQ2FBIN(5795, 0)
2359 + .ctlPowerData_5G = {
2362 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
2363 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
2368 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
2369 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
2374 + {60, 0}, {60, 1}, {60, 0}, {60, 1},
2375 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
2380 + {60, 0}, {60, 1}, {60, 1}, {60, 0},
2381 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
2386 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
2387 + {60, 0}, {60, 0}, {60, 0}, {60, 0},
2392 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
2393 + {60, 1}, {60, 0}, {60, 0}, {60, 0},
2398 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
2399 + {60, 1}, {60, 1}, {60, 1}, {60, 1},
2404 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
2405 + {60, 1}, {60, 1}, {60, 1}, {60, 0},
2410 + {60, 1}, {60, 0}, {60, 1}, {60, 1},
2411 + {60, 1}, {60, 1}, {60, 0}, {60, 1},
2417 +static const struct ar9300_eeprom ar9300_h116 = {
2418 + .eepromVersion = 2,
2419 + .templateVersion = 4,
2420 + .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
2421 + .custData = {"h116-041-f0000"},
2423 .regDmn = { LE16(0), LE16(0x1f) },
2424 - .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
2425 + .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */
2427 .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
2429 @@ -74,7 +2388,7 @@ static const struct ar9300_eeprom ar9300
2430 .deviceType = 5, /* takes lower byte in eeprom location */
2431 .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
2432 .params_for_tuning_caps = {0, 0},
2433 - .featureEnable = 0x0c,
2434 + .featureEnable = 0x0d,
2436 * bit0 - enable tx temp comp - disabled
2437 * bit1 - enable tx volt comp - disabled
2438 @@ -84,11 +2398,11 @@ static const struct ar9300_eeprom ar9300
2439 * bit5 - enable pa predistortion - disabled
2441 .miscConfiguration = 0, /* bit0 - turn down drivestrength */
2442 - .eepromWriteEnableGpio = 3,
2443 + .eepromWriteEnableGpio = 6,
2444 .wlanDisableGpio = 0,
2446 .rxBandSelectGpio = 0xff,
2452 @@ -96,33 +2410,33 @@ static const struct ar9300_eeprom ar9300
2453 /* 4 idle,t1,t2,b(4 bits per setting) */
2454 .antCtrlCommon = LE32(0x110),
2455 /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
2456 - .antCtrlCommon2 = LE32(0x22222),
2457 + .antCtrlCommon2 = LE32(0x44444),
2460 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
2461 * rx1, rx12, b (2 bits each)
2463 - .antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
2464 + .antCtrlChain = { LE16(0x10), LE16(0x10), LE16(0x10) },
2467 * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
2468 * for ar9280 (0xa20c/b20c 5:0)
2470 - .xatten1DB = {0, 0, 0},
2471 + .xatten1DB = {0x1f, 0x1f, 0x1f},
2474 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
2475 * for ar9280 (0xa20c/b20c 16:12
2477 - .xatten1Margin = {0, 0, 0},
2479 + .xatten1Margin = {0x12, 0x12, 0x12},
2484 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
2485 * channels in usual fbin coding format
2487 - .spurChans = {0, 0, 0, 0, 0},
2488 + .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
2491 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
2492 @@ -144,13 +2458,16 @@ static const struct ar9300_eeprom ar9300
2494 .txFrameToXpaOn = 0xe,
2496 - .papdRateMaskHt20 = LE32(0x80c080),
2497 - .papdRateMaskHt40 = LE32(0x80c080),
2498 + .papdRateMaskHt20 = LE32(0x0c80C080),
2499 + .papdRateMaskHt40 = LE32(0x0080C080),
2501 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2502 - 0, 0, 0, 0, 0, 0, 0, 0
2503 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2507 + .ant_div_control = 0,
2508 + .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
2513 @@ -164,7 +2481,7 @@ static const struct ar9300_eeprom ar9300
2515 .calTarget_freqbin_Cck = {
2517 - FREQ2FBIN(2484, 1),
2518 + FREQ2FBIN(2472, 1),
2520 .calTarget_freqbin_2G = {
2522 @@ -183,24 +2500,24 @@ static const struct ar9300_eeprom ar9300
2524 .calTargetPowerCck = {
2525 /* 1L-5L,5S,11L,11S */
2526 - { {36, 36, 36, 36} },
2527 - { {36, 36, 36, 36} },
2528 + { {34, 34, 34, 34} },
2529 + { {34, 34, 34, 34} },
2531 .calTargetPower2G = {
2533 - { {32, 32, 28, 24} },
2534 - { {32, 32, 28, 24} },
2535 - { {32, 32, 28, 24} },
2536 + { {34, 34, 32, 32} },
2537 + { {34, 34, 32, 32} },
2538 + { {34, 34, 32, 32} },
2540 .calTargetPower2GHT20 = {
2541 - { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
2542 - { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
2543 - { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
2544 + { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 0, 0, 0, 0} },
2545 + { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 0, 0, 0, 0} },
2546 + { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 0, 0, 0, 0} },
2548 .calTargetPower2GHT40 = {
2549 - { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
2550 - { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
2551 - { {32, 32, 32, 32, 28, 20, 32, 32, 28, 20, 32, 32, 28, 20} },
2552 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
2553 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
2554 + { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
2557 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
2558 @@ -285,8 +2602,7 @@ static const struct ar9300_eeprom ar9300
2559 /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
2560 /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
2561 /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
2562 - /* Data[11].ctlEdges[3].bChannel */
2563 - FREQ2FBIN(2462, 1),
2564 + /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
2567 .ctlPowerData_2G = {
2568 @@ -304,25 +2620,26 @@ static const struct ar9300_eeprom ar9300
2570 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2571 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2572 + { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2575 /* 4 idle,t1,t2,b (4 bits per setting) */
2576 - .antCtrlCommon = LE32(0x110),
2577 + .antCtrlCommon = LE32(0x220),
2578 /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
2579 - .antCtrlCommon2 = LE32(0x22222),
2580 + .antCtrlCommon2 = LE32(0x44444),
2581 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
2583 - LE16(0x000), LE16(0x000), LE16(0x000),
2584 + LE16(0x150), LE16(0x150), LE16(0x150),
2586 /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
2587 - .xatten1DB = {0, 0, 0},
2588 + .xatten1DB = {0x19, 0x19, 0x19},
2591 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
2592 * for merlin (0xa20c/b20c 16:12
2594 - .xatten1Margin = {0, 0, 0},
2596 + .xatten1Margin = {0x14, 0x14, 0x14},
2599 /* spurChans spur channels in usual fbin coding format */
2600 .spurChans = {0, 0, 0, 0, 0},
2601 @@ -343,13 +2660,20 @@ static const struct ar9300_eeprom ar9300
2603 .txFrameToXpaOn = 0xe,
2605 - .papdRateMaskHt20 = LE32(0xf0e0e0),
2606 - .papdRateMaskHt40 = LE32(0xf0e0e0),
2607 + .papdRateMaskHt20 = LE32(0x0cf0e0e0),
2608 + .papdRateMaskHt40 = LE32(0x6cf0e0e0),
2610 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2611 - 0, 0, 0, 0, 0, 0, 0, 0
2612 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2616 + .tempSlopeLow = 35,
2617 + .tempSlopeHigh = 50,
2618 + .xatten1DBLow = {0, 0, 0},
2619 + .xatten1MarginLow = {0, 0, 0},
2620 + .xatten1DBHigh = {0, 0, 0},
2621 + .xatten1MarginHigh = {0, 0, 0}
2626 @@ -357,8 +2681,8 @@ static const struct ar9300_eeprom ar9300
2630 - FREQ2FBIN(5725, 0),
2631 - FREQ2FBIN(5825, 0)
2632 + FREQ2FBIN(5700, 0),
2633 + FREQ2FBIN(5785, 0)
2637 @@ -395,72 +2719,72 @@ static const struct ar9300_eeprom ar9300
2639 .calTarget_freqbin_5G = {
2641 - FREQ2FBIN(5220, 0),
2642 + FREQ2FBIN(5240, 0),
2647 - FREQ2FBIN(5725, 0),
2648 + FREQ2FBIN(5700, 0),
2651 .calTarget_freqbin_5GHT20 = {
2655 + FREQ2FBIN(5400, 0),
2659 - FREQ2FBIN(5725, 0),
2662 .calTarget_freqbin_5GHT40 = {
2666 + FREQ2FBIN(5400, 0),
2670 - FREQ2FBIN(5725, 0),
2673 .calTargetPower5G = {
2675 - { {20, 20, 20, 10} },
2676 - { {20, 20, 20, 10} },
2677 - { {20, 20, 20, 10} },
2678 - { {20, 20, 20, 10} },
2679 - { {20, 20, 20, 10} },
2680 - { {20, 20, 20, 10} },
2681 - { {20, 20, 20, 10} },
2682 - { {20, 20, 20, 10} },
2683 + { {30, 30, 28, 24} },
2684 + { {30, 30, 28, 24} },
2685 + { {30, 30, 28, 24} },
2686 + { {30, 30, 28, 24} },
2687 + { {30, 30, 28, 24} },
2688 + { {30, 30, 28, 24} },
2689 + { {30, 30, 28, 24} },
2690 + { {30, 30, 28, 24} },
2692 .calTargetPower5GHT20 = {
2694 * 0_8_16,1-3_9-11_17-19,
2695 * 4,5,6,7,12,13,14,15,20,21,22,23
2697 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2698 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2699 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2700 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2701 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2702 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2703 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2704 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2705 + { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 0, 0, 0, 0} },
2706 + { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 0, 0, 0, 0} },
2707 + { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 0, 0, 0, 0} },
2708 + { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 0, 0, 0, 0} },
2709 + { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 0, 0, 0, 0} },
2710 + { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 0, 0, 0, 0} },
2711 + { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 0, 0, 0, 0} },
2712 + { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 0, 0, 0, 0} },
2714 .calTargetPower5GHT40 = {
2716 * 0_8_16,1-3_9-11_17-19,
2717 * 4,5,6,7,12,13,14,15,20,21,22,23
2719 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2720 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2721 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2722 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2723 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2724 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2725 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2726 - { {20, 20, 10, 10, 0, 0, 10, 10, 0, 0, 10, 10, 0, 0} },
2727 + { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 0, 0, 0, 0} },
2728 + { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 0, 0, 0, 0} },
2729 + { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 0, 0, 0, 0} },
2730 + { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 0, 0, 0, 0} },
2731 + { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 0, 0, 0, 0} },
2732 + { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 0, 0, 0, 0} },
2733 + { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 0, 0, 0, 0} },
2734 + { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 0, 0, 0, 0} },
2737 0x10, 0x16, 0x18, 0x40, 0x46,
2738 @@ -623,6 +2947,28 @@ static const struct ar9300_eeprom ar9300
2743 +static const struct ar9300_eeprom *ar9300_eep_templates[] = {
2751 +static const struct ar9300_eeprom *ar9003_eeprom_struct_find_by_id(int id)
2753 +#define N_LOOP (sizeof(ar9300_eep_templates) / sizeof(ar9300_eep_templates[0]))
2756 + for (it = 0; it < N_LOOP; it++)
2757 + if (ar9300_eep_templates[it]->templateVersion == id)
2758 + return ar9300_eep_templates[it];
2764 static u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
2766 if (fbin == AR9300_BCHAN_UNUSED)
2767 @@ -636,6 +2982,16 @@ static int ath9k_hw_ar9300_check_eeprom(
2771 +static int interpolate(int x, int xa, int xb, int ya, int yb)
2773 + int bf, factor, plus;
2775 + bf = 2 * (yb - ya) * (x - xa) / (xb - xa);
2778 + return ya + factor + plus;
2781 static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah,
2782 enum eeprom_param param)
2784 @@ -824,6 +3180,7 @@ static int ar9300_compress_decision(stru
2786 struct ath_common *common = ath9k_hw_common(ah);
2788 + const struct ar9300_eeprom *eep = NULL;
2792 @@ -841,13 +3198,14 @@ static int ar9300_compress_decision(stru
2793 if (reference == 0) {
2796 - if (reference != 2) {
2797 + eep = ar9003_eeprom_struct_find_by_id(reference);
2798 + if (eep == NULL) {
2799 ath_print(common, ATH_DBG_EEPROM,
2800 "cant find reference eeprom"
2801 "struct %d\n", reference);
2804 - memcpy(mptr, &ar9300_default, mdata_size);
2805 + memcpy(mptr, eep, mdata_size);
2807 ath_print(common, ATH_DBG_EEPROM,
2808 "restore eeprom %d: block, reference %d,"
2809 @@ -992,9 +3350,9 @@ static s32 ar9003_hw_xpa_bias_level_get(
2810 static void ar9003_hw_xpa_bias_level_apply(struct ath_hw *ah, bool is2ghz)
2812 int bias = ar9003_hw_xpa_bias_level_get(ah, is2ghz);
2813 - REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, (bias & 0x3));
2814 - REG_RMW_FIELD(ah, AR_CH0_THERM, AR_CH0_THERM_SPARE,
2815 - ((bias >> 2) & 0x3));
2816 + REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias);
2817 + REG_RMW_FIELD(ah, AR_CH0_THERM, AR_CH0_THERM_XPABIASLVL_MSB, bias >> 2);
2818 + REG_RMW_FIELD(ah, AR_CH0_THERM, AR_CH0_THERM_XPASHORT2GND, 1);
2821 static u32 ar9003_hw_ant_ctrl_common_get(struct ath_hw *ah, bool is2ghz)
2822 @@ -1097,6 +3455,82 @@ static void ar9003_hw_drive_strength_app
2823 REG_WRITE(ah, AR_PHY_65NM_CH0_BIAS4, reg);
2826 +static u16 ar9003_hw_atten_chain_get(struct ath_hw *ah, int chain,
2827 + struct ath9k_channel *chan)
2831 + struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
2833 + if (chain >= 0 && chain < 3) {
2834 + if (IS_CHAN_2GHZ(chan))
2835 + return eep->modalHeader2G.xatten1DB[chain];
2836 + else if (eep->base_ext2.xatten1DBLow[chain] != 0) {
2837 + t[0] = eep->base_ext2.xatten1DBLow[chain];
2839 + t[1] = eep->modalHeader5G.xatten1DB[chain];
2841 + t[2] = eep->base_ext2.xatten1DBHigh[chain];
2843 + value = ar9003_hw_power_interpolate((s32) chan->channel,
2847 + return eep->modalHeader5G.xatten1DB[chain];
2854 +static u16 ar9003_hw_atten_chain_get_margin(struct ath_hw *ah, int chain,
2855 + struct ath9k_channel *chan)
2859 + struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
2861 + if (chain >= 0 && chain < 3) {
2862 + if (IS_CHAN_2GHZ(chan))
2863 + return eep->modalHeader2G.xatten1Margin[chain];
2864 + else if (eep->base_ext2.xatten1MarginLow[chain] != 0) {
2865 + t[0] = eep->base_ext2.xatten1MarginLow[chain];
2867 + t[1] = eep->modalHeader5G.xatten1Margin[chain];
2869 + t[2] = eep->base_ext2.xatten1MarginHigh[chain];
2871 + value = ar9003_hw_power_interpolate((s32) chan->channel,
2875 + return eep->modalHeader5G.xatten1Margin[chain];
2881 +static void ar9003_hw_atten_apply(struct ath_hw *ah, struct ath9k_channel *chan)
2885 + unsigned long ext_atten_reg[3] = {AR_PHY_EXT_ATTEN_CTL_0,
2886 + AR_PHY_EXT_ATTEN_CTL_1,
2887 + AR_PHY_EXT_ATTEN_CTL_2,
2890 + /* Test value. if 0 then attenuation is unused. Don't load anything. */
2891 + for (i = 0; i < 3; i++) {
2892 + value = ar9003_hw_atten_chain_get(ah, i, chan);
2893 + REG_RMW_FIELD(ah, ext_atten_reg[i],
2894 + AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB, value);
2896 + value = ar9003_hw_atten_chain_get_margin(ah, i, chan);
2897 + REG_RMW_FIELD(ah, ext_atten_reg[i],
2898 + AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN, value);
2902 static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
2904 int internal_regulator =
2905 @@ -1128,6 +3562,7 @@ static void ath9k_hw_ar9300_set_board_va
2906 ar9003_hw_xpa_bias_level_apply(ah, IS_CHAN_2GHZ(chan));
2907 ar9003_hw_ant_ctrl_apply(ah, IS_CHAN_2GHZ(chan));
2908 ar9003_hw_drive_strength_apply(ah);
2909 + ar9003_hw_atten_apply(ah, chan);
2910 ar9003_hw_internal_regulator_apply(ah);
2913 @@ -1189,7 +3624,7 @@ static int ar9003_hw_power_interpolate(i
2916 else /* interpolate */
2917 - y = ly + (((x - lx) * (hy - ly)) / (hx - lx));
2918 + y = interpolate(x, lx, hx, ly, hy);
2919 } else /* only low is good, use it */
2921 } else if (hhave) /* only high is good, use it */
2922 @@ -1637,6 +4072,7 @@ static int ar9003_hw_power_control_overr
2925 struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
2928 REG_RMW(ah, AR_PHY_TPC_11_B0,
2929 (correction[0] << AR_PHY_TPC_OLPC_GAIN_DELTA_S),
2930 @@ -1665,7 +4101,16 @@ static int ar9003_hw_power_control_overr
2932 if (frequency < 4000)
2933 tempSlope = eep->modalHeader2G.tempSlope;
2935 + else if (eep->base_ext2.tempSlopeLow != 0) {
2936 + t[0] = eep->base_ext2.tempSlopeLow;
2938 + t[1] = eep->modalHeader5G.tempSlope;
2940 + t[2] = eep->base_ext2.tempSlopeHigh;
2942 + tempSlope = ar9003_hw_power_interpolate((s32) frequency,
2945 tempSlope = eep->modalHeader5G.tempSlope;
2947 REG_RMW_FIELD(ah, AR_PHY_TPC_19, AR_PHY_TPC_19_ALPHA_THERM, tempSlope);
2948 @@ -1769,25 +4214,23 @@ static int ar9003_hw_calibration_apply(s
2949 /* so is the high frequency, interpolate */
2950 if (hfrequency[ichain] - frequency < 1000) {
2952 - correction[ichain] = lcorrection[ichain] +
2953 - (((frequency - lfrequency[ichain]) *
2954 - (hcorrection[ichain] -
2955 - lcorrection[ichain])) /
2956 - (hfrequency[ichain] - lfrequency[ichain]));
2958 - temperature[ichain] = ltemperature[ichain] +
2959 - (((frequency - lfrequency[ichain]) *
2960 - (htemperature[ichain] -
2961 - ltemperature[ichain])) /
2962 - (hfrequency[ichain] - lfrequency[ichain]));
2965 - lvoltage[ichain] +
2967 - lfrequency[ichain]) * (hvoltage[ichain] -
2968 - lvoltage[ichain]))
2969 - / (hfrequency[ichain] -
2970 - lfrequency[ichain]));
2971 + correction[ichain] = interpolate(frequency,
2972 + lfrequency[ichain],
2973 + hfrequency[ichain],
2974 + lcorrection[ichain],
2975 + hcorrection[ichain]);
2977 + temperature[ichain] = interpolate(frequency,
2978 + lfrequency[ichain],
2979 + hfrequency[ichain],
2980 + ltemperature[ichain],
2981 + htemperature[ichain]);
2983 + voltage[ichain] = interpolate(frequency,
2984 + lfrequency[ichain],
2985 + hfrequency[ichain],
2987 + hvoltage[ichain]);
2989 /* only low is good, use it */
2991 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
2992 +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
2993 @@ -236,7 +236,7 @@ struct ar9300_modal_eep_header {
2995 __le32 papdRateMaskHt20;
2996 __le32 papdRateMaskHt40;
2997 - u8 futureModal[24];
2998 + u8 futureModal[10];
3001 struct ar9300_cal_data_per_freq_op_loop {
3002 @@ -274,6 +274,20 @@ struct cal_ctl_data_5g {
3003 struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G];
3006 +struct ar9300_BaseExtension_1 {
3007 + u8 ant_div_control;
3011 +struct ar9300_BaseExtension_2 {
3012 + int8_t tempSlopeLow;
3013 + int8_t tempSlopeHigh;
3014 + u8 xatten1DBLow[AR9300_MAX_CHAINS];
3015 + u8 xatten1MarginLow[AR9300_MAX_CHAINS];
3016 + u8 xatten1DBHigh[AR9300_MAX_CHAINS];
3017 + u8 xatten1MarginHigh[AR9300_MAX_CHAINS];
3020 struct ar9300_eeprom {
3023 @@ -283,6 +297,7 @@ struct ar9300_eeprom {
3024 struct ar9300_base_eep_hdr baseEepHeader;
3026 struct ar9300_modal_eep_header modalHeader2G;
3027 + struct ar9300_BaseExtension_1 base_ext1;
3028 u8 calFreqPier2G[AR9300_NUM_2G_CAL_PIERS];
3029 struct ar9300_cal_data_per_freq_op_loop
3030 calPierData2G[AR9300_MAX_CHAINS][AR9300_NUM_2G_CAL_PIERS];
3031 @@ -302,6 +317,7 @@ struct ar9300_eeprom {
3032 u8 ctl_freqbin_2G[AR9300_NUM_CTLS_2G][AR9300_NUM_BAND_EDGES_2G];
3033 struct cal_ctl_data_2g ctlPowerData_2G[AR9300_NUM_CTLS_2G];
3034 struct ar9300_modal_eep_header modalHeader5G;
3035 + struct ar9300_BaseExtension_2 base_ext2;
3036 u8 calFreqPier5G[AR9300_NUM_5G_CAL_PIERS];
3037 struct ar9300_cal_data_per_freq_op_loop
3038 calPierData5G[AR9300_MAX_CHAINS][AR9300_NUM_5G_CAL_PIERS];
3039 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
3040 +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
3041 @@ -410,12 +410,36 @@ static void ar9003_hw_set11n_ratescenari
3042 static void ar9003_hw_set11n_aggr_first(struct ath_hw *ah, void *ds,
3045 +#define FIRST_DESC_NDELIMS 60
3046 struct ar9003_txc *ads = (struct ar9003_txc *) ds;
3048 ads->ctl12 |= (AR_IsAggr | AR_MoreAggr);
3050 - ads->ctl17 &= ~AR_AggrLen;
3051 - ads->ctl17 |= SM(aggrLen, AR_AggrLen);
3052 + if (ah->ent_mode & AR_ENT_OTP_MPSD) {
3053 + u32 ctl17, ndelim;
3055 + * Add delimiter when using RTS/CTS with aggregation
3056 + * and non enterprise AR9003 card
3058 + ctl17 = ads->ctl17;
3059 + ndelim = MS(ctl17, AR_PadDelim);
3061 + if (ndelim < FIRST_DESC_NDELIMS) {
3062 + aggrLen += (FIRST_DESC_NDELIMS - ndelim) * 4;
3063 + ndelim = FIRST_DESC_NDELIMS;
3066 + ctl17 &= ~AR_AggrLen;
3067 + ctl17 |= SM(aggrLen, AR_AggrLen);
3069 + ctl17 &= ~AR_PadDelim;
3070 + ctl17 |= SM(ndelim, AR_PadDelim);
3072 + ads->ctl17 = ctl17;
3074 + ads->ctl17 &= ~AR_AggrLen;
3075 + ads->ctl17 |= SM(aggrLen, AR_AggrLen);
3079 static void ar9003_hw_set11n_aggr_middle(struct ath_hw *ah, void *ds,
3080 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
3081 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
3082 @@ -1113,6 +1113,37 @@ static void ar9003_hw_ani_cache_ini_regs
3083 aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK;
3086 +static void ar9003_hw_set_radar_params(struct ath_hw *ah,
3087 + struct ath_hw_radar_conf *conf)
3089 + u32 radar_0 = 0, radar_1 = 0;
3092 + REG_CLR_BIT(ah, AR_PHY_RADAR_0, AR_PHY_RADAR_0_ENA);
3096 + radar_0 |= AR_PHY_RADAR_0_ENA | AR_PHY_RADAR_0_FFT_ENA;
3097 + radar_0 |= SM(conf->fir_power, AR_PHY_RADAR_0_FIRPWR);
3098 + radar_0 |= SM(conf->radar_rssi, AR_PHY_RADAR_0_RRSSI);
3099 + radar_0 |= SM(conf->pulse_height, AR_PHY_RADAR_0_HEIGHT);
3100 + radar_0 |= SM(conf->pulse_rssi, AR_PHY_RADAR_0_PRSSI);
3101 + radar_0 |= SM(conf->pulse_inband, AR_PHY_RADAR_0_INBAND);
3103 + radar_1 |= AR_PHY_RADAR_1_MAX_RRSSI;
3104 + radar_1 |= AR_PHY_RADAR_1_BLOCK_CHECK;
3105 + radar_1 |= SM(conf->pulse_maxlen, AR_PHY_RADAR_1_MAXLEN);
3106 + radar_1 |= SM(conf->pulse_inband_step, AR_PHY_RADAR_1_RELSTEP_THRESH);
3107 + radar_1 |= SM(conf->radar_inband, AR_PHY_RADAR_1_RELPWR_THRESH);
3109 + REG_WRITE(ah, AR_PHY_RADAR_0, radar_0);
3110 + REG_WRITE(ah, AR_PHY_RADAR_1, radar_1);
3111 + if (conf->ext_channel)
3112 + REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
3114 + REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
3117 void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
3119 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
3120 @@ -1141,6 +1172,7 @@ void ar9003_hw_attach_phy_ops(struct ath
3121 priv_ops->ani_control = ar9003_hw_ani_control;
3122 priv_ops->do_getnf = ar9003_hw_do_getnf;
3123 priv_ops->ani_cache_ini_regs = ar9003_hw_ani_cache_ini_regs;
3124 + priv_ops->set_radar_params = ar9003_hw_set_radar_params;
3126 ar9003_hw_set_nf_limits(ah);
3127 memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs));
3128 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
3129 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3130 @@ -177,8 +177,8 @@ void ath_descdma_cleanup(struct ath_soft
3132 /* returns delimiter padding required given the packet length */
3133 #define ATH_AGGR_GET_NDELIM(_len) \
3134 - (((((_len) + ATH_AGGR_DELIM_SZ) < ATH_AGGR_MINPLEN) ? \
3135 - (ATH_AGGR_MINPLEN - (_len) - ATH_AGGR_DELIM_SZ) : 0) >> 2)
3136 + (((_len) >= ATH_AGGR_MINPLEN) ? 0 : \
3137 + DIV_ROUND_UP(ATH_AGGR_MINPLEN - (_len), ATH_AGGR_DELIM_SZ))
3139 #define BAW_WITHIN(_start, _bawsz, _seqno) \
3140 ((((_seqno) - (_start)) & 4095) < (_bawsz))
3141 @@ -229,6 +229,7 @@ struct ath_buf_state {
3142 unsigned long bfs_paprd_timestamp;
3144 enum ath9k_key_type bfs_keytype;
3145 + enum ath9k_internal_frame_type bfs_ftype;
3149 @@ -712,7 +713,7 @@ void ath9k_ps_restore(struct ath_softc *
3150 void ath9k_set_bssid_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
3151 int ath9k_wiphy_add(struct ath_softc *sc);
3152 int ath9k_wiphy_del(struct ath_wiphy *aphy);
3153 -void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb);
3154 +void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, int ftype);
3155 int ath9k_wiphy_pause(struct ath_wiphy *aphy);
3156 int ath9k_wiphy_unpause(struct ath_wiphy *aphy);
3157 int ath9k_wiphy_select(struct ath_wiphy *aphy);
3158 --- a/drivers/net/wireless/ath/ath9k/hw.c
3159 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3160 @@ -1991,6 +1991,9 @@ int ath9k_hw_fill_cap_info(struct ath_hw
3161 if (AR_SREV_9300_20_OR_LATER(ah))
3162 pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED;
3164 + if (AR_SREV_9300_20_OR_LATER(ah))
3165 + ah->ent_mode = REG_READ(ah, AR_ENT_OTP);
3167 if (AR_SREV_9287_11_OR_LATER(ah) || AR_SREV_9271(ah))
3168 pCap->hw_caps |= ATH9K_HW_CAP_SGI_20;
3170 --- a/drivers/net/wireless/ath/ath9k/hw.h
3171 +++ b/drivers/net/wireless/ath/ath9k/hw.h
3172 @@ -485,6 +485,40 @@ struct ath_hw_antcomb_conf {
3176 + * struct ath_hw_radar_conf - radar detection initialization parameters
3178 + * @pulse_inband: threshold for checking the ratio of in-band power
3179 + * to total power for short radar pulses (half dB steps)
3180 + * @pulse_inband_step: threshold for checking an in-band power to total
3181 + * power ratio increase for short radar pulses (half dB steps)
3182 + * @pulse_height: threshold for detecting the beginning of a short
3183 + * radar pulse (dB step)
3184 + * @pulse_rssi: threshold for detecting if a short radar pulse is
3186 + * @pulse_maxlen: maximum pulse length (0.8 us steps)
3188 + * @radar_rssi: RSSI threshold for starting long radar detection (dB steps)
3189 + * @radar_inband: threshold for checking the ratio of in-band power
3190 + * to total power for long radar pulses (half dB steps)
3191 + * @fir_power: threshold for detecting the end of a long radar pulse (dB)
3193 + * @ext_channel: enable extension channel radar detection
3195 +struct ath_hw_radar_conf {
3196 + unsigned int pulse_inband;
3197 + unsigned int pulse_inband_step;
3198 + unsigned int pulse_height;
3199 + unsigned int pulse_rssi;
3200 + unsigned int pulse_maxlen;
3202 + unsigned int radar_rssi;
3203 + unsigned int radar_inband;
3210 * struct ath_hw_private_ops - callbacks used internally by hardware code
3212 * This structure contains private callbacks designed to only be used internally
3213 @@ -549,6 +583,8 @@ struct ath_hw_private_ops {
3214 bool (*ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd,
3216 void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]);
3217 + void (*set_radar_params)(struct ath_hw *ah,
3218 + struct ath_hw_radar_conf *conf);
3221 void (*ani_cache_ini_regs)(struct ath_hw *ah);
3222 @@ -806,6 +842,9 @@ struct ath_hw {
3223 * this register when in sleep states.
3227 + /* Enterprise mode cap */
3231 static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)
3232 --- a/drivers/net/wireless/ath/ath9k/rc.c
3233 +++ b/drivers/net/wireless/ath/ath9k/rc.c
3234 @@ -1354,23 +1354,7 @@ static void ath_tx_status(void *priv, st
3235 tx_info->status.ampdu_len = 1;
3239 - * If an underrun error is seen assume it as an excessive retry only
3240 - * if max frame trigger level has been reached (2 KB for singel stream,
3241 - * and 4 KB for dual stream). Adjust the long retry as if the frame was
3242 - * tried hw->max_rate_tries times to affect how ratectrl updates PER for
3243 - * the failed rate. In case of congestion on the bus penalizing these
3244 - * type of underruns should help hardware actually transmit new frames
3245 - * successfully by eventually preferring slower rates. This itself
3246 - * should also alleviate congestion on the bus.
3248 - if ((tx_info->pad[0] & ATH_TX_INFO_UNDERRUN) &&
3249 - (sc->sc_ah->tx_trig_level >= ath_rc_priv->tx_triglevel_max)) {
3254 - if (tx_info->pad[0] & ATH_TX_INFO_XRETRY)
3255 + if (!(tx_info->flags & IEEE80211_TX_STAT_ACK))
3258 ath_rc_tx_status(sc, ath_rc_priv, tx_info, final_ts_idx, tx_status,
3259 @@ -1596,8 +1580,6 @@ static void *ath_rate_alloc_sta(void *pr
3263 - rate_priv->tx_triglevel_max = sc->sc_ah->caps.tx_triglevel_max;
3268 --- a/drivers/net/wireless/ath/ath9k/rc.h
3269 +++ b/drivers/net/wireless/ath/ath9k/rc.h
3270 @@ -215,7 +215,6 @@ struct ath_rate_priv {
3274 - u32 tx_triglevel_max;
3275 struct ath_rateset neg_rates;
3276 struct ath_rateset neg_ht_rates;
3277 struct ath_rate_softc *asc;
3278 @@ -225,11 +224,6 @@ struct ath_rate_priv {
3279 struct ath_rc_stats rcstats[RATE_TABLE_SIZE];
3282 -#define ATH_TX_INFO_FRAME_TYPE_INTERNAL (1 << 0)
3283 -#define ATH_TX_INFO_FRAME_TYPE_PAUSE (1 << 1)
3284 -#define ATH_TX_INFO_XRETRY (1 << 3)
3285 -#define ATH_TX_INFO_UNDERRUN (1 << 4)
3287 enum ath9k_internal_frame_type {
3288 ATH9K_IFT_NOT_INTERNAL,
3290 --- a/drivers/net/wireless/ath/ath9k/reg.h
3291 +++ b/drivers/net/wireless/ath/ath9k/reg.h
3292 @@ -1066,6 +1066,9 @@ enum {
3293 #define AR_INTR_PRIO_ASYNC_MASK 0x40c8
3294 #define AR_INTR_PRIO_SYNC_MASK 0x40cc
3295 #define AR_INTR_PRIO_ASYNC_ENABLE 0x40d4
3296 +#define AR_ENT_OTP 0x40d8
3297 +#define AR_ENT_OTP_CHAIN2_DISABLE 0x00020000
3298 +#define AR_ENT_OTP_MPSD 0x00800000
3300 #define AR_RTC_9300_PLL_DIV 0x000003ff
3301 #define AR_RTC_9300_PLL_DIV_S 0
3302 --- a/drivers/net/wireless/ath/ath9k/virtual.c
3303 +++ b/drivers/net/wireless/ath/ath9k/virtual.c
3304 @@ -305,13 +305,12 @@ void ath9k_wiphy_chan_work(struct work_s
3305 * ath9k version of ieee80211_tx_status() for TX frames that are generated
3306 * internally in the driver.
3308 -void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
3309 +void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, int ftype)
3311 struct ath_wiphy *aphy = hw->priv;
3312 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
3314 - if ((tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_PAUSE) &&
3315 - aphy->state == ATH_WIPHY_PAUSING) {
3316 + if (ftype == ATH9K_IFT_PAUSE && aphy->state == ATH_WIPHY_PAUSING) {
3317 if (!(tx_info->flags & IEEE80211_TX_STAT_ACK)) {
3318 printk(KERN_DEBUG "ath9k: %s: no ACK for pause "
3319 "frame\n", wiphy_name(hw->wiphy));
3320 --- a/drivers/net/wireless/ath/ath9k/xmit.c
3321 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3322 @@ -48,9 +48,9 @@ static u16 bits_per_symbol[][2] = {
3324 #define IS_HT_RATE(_rate) ((_rate) & 0x80)
3326 -static void ath_tx_send_ht_normal(struct ath_softc *sc, struct ath_txq *txq,
3327 - struct ath_atx_tid *tid,
3328 - struct list_head *bf_head);
3329 +static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
3330 + struct ath_atx_tid *tid,
3331 + struct list_head *bf_head);
3332 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
3333 struct ath_txq *txq, struct list_head *bf_q,
3334 struct ath_tx_status *ts, int txok, int sendbar);
3335 @@ -160,7 +160,7 @@ static void ath_tx_flush_tid(struct ath_
3336 ath_tx_update_baw(sc, tid, bf->bf_seqno);
3337 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
3339 - ath_tx_send_ht_normal(sc, txq, tid, &bf_head);
3340 + ath_tx_send_normal(sc, txq, tid, &bf_head);
3344 @@ -1322,9 +1322,9 @@ static void ath_tx_send_ampdu(struct ath
3345 ath_tx_txqaddbuf(sc, txctl->txq, bf_head);
3348 -static void ath_tx_send_ht_normal(struct ath_softc *sc, struct ath_txq *txq,
3349 - struct ath_atx_tid *tid,
3350 - struct list_head *bf_head)
3351 +static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
3352 + struct ath_atx_tid *tid,
3353 + struct list_head *bf_head)
3357 @@ -1332,7 +1332,8 @@ static void ath_tx_send_ht_normal(struct
3358 bf->bf_state.bf_type &= ~BUF_AMPDU;
3360 /* update starting sequence number for subsequent ADDBA request */
3361 - INCR(tid->seq_start, IEEE80211_SEQ_MAX);
3363 + INCR(tid->seq_start, IEEE80211_SEQ_MAX);
3367 @@ -1341,20 +1342,6 @@ static void ath_tx_send_ht_normal(struct
3368 TX_STAT_INC(txq->axq_qnum, queued);
3371 -static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
3372 - struct list_head *bf_head)
3374 - struct ath_buf *bf;
3376 - bf = list_first_entry(bf_head, struct ath_buf, list);
3378 - bf->bf_lastbf = bf;
3379 - bf->bf_nframes = 1;
3380 - ath_buf_set_rate(sc, bf);
3381 - ath_tx_txqaddbuf(sc, txq, bf_head);
3382 - TX_STAT_INC(txq->axq_qnum, queued);
3385 static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb)
3387 struct ieee80211_hdr *hdr;
3388 @@ -1411,7 +1398,7 @@ static void assign_aggr_tid_seqno(struct
3389 INCR(tid->seq_next, IEEE80211_SEQ_MAX);
3392 -static int setup_tx_flags(struct sk_buff *skb, bool use_ldpc)
3393 +static int setup_tx_flags(struct sk_buff *skb)
3395 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
3397 @@ -1422,7 +1409,7 @@ static int setup_tx_flags(struct sk_buff
3398 if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK)
3399 flags |= ATH9K_TXDESC_NOACK;
3402 + if (tx_info->flags & IEEE80211_TX_CTL_LDPC)
3403 flags |= ATH9K_TXDESC_LDPC;
3406 @@ -1567,30 +1554,25 @@ static void ath_buf_set_rate(struct ath_
3407 ath9k_hw_set11n_burstduration(sc->sc_ah, bf->bf_desc, 8192);
3410 -static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
3411 - struct sk_buff *skb,
3412 - struct ath_tx_control *txctl)
3413 +static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw,
3414 + struct sk_buff *skb)
3416 struct ath_wiphy *aphy = hw->priv;
3417 struct ath_softc *sc = aphy->sc;
3418 + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
3419 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
3420 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
3421 + struct ath_buf *bf;
3424 int padpos, padsize;
3425 - bool use_ldpc = false;
3427 - tx_info->pad[0] = 0;
3428 - switch (txctl->frame_type) {
3429 - case ATH9K_IFT_NOT_INTERNAL:
3431 - case ATH9K_IFT_PAUSE:
3432 - tx_info->pad[0] |= ATH_TX_INFO_FRAME_TYPE_PAUSE;
3433 - /* fall through */
3434 - case ATH9K_IFT_UNPAUSE:
3435 - tx_info->pad[0] |= ATH_TX_INFO_FRAME_TYPE_INTERNAL;
3437 + bf = ath_tx_get_buffer(sc);
3439 + ath_print(common, ATH_DBG_XMIT, "TX buffers are full\n");
3443 hdrlen = ieee80211_get_hdrlen_from_skb(skb);
3444 fc = hdr->frame_control;
3446 @@ -1605,16 +1587,13 @@ static int ath_tx_setup_buffer(struct ie
3447 bf->bf_frmlen -= padsize;
3450 - if (!txctl->paprd && conf_is_ht(&hw->conf)) {
3451 + if (ieee80211_is_data_qos(fc) && conf_is_ht(&hw->conf)) {
3452 bf->bf_state.bf_type |= BUF_HT;
3453 - if (tx_info->flags & IEEE80211_TX_CTL_LDPC)
3455 + if (sc->sc_flags & SC_OP_TXAGGR)
3456 + assign_aggr_tid_seqno(skb, bf);
3459 - bf->bf_state.bfs_paprd = txctl->paprd;
3461 - bf->bf_state.bfs_paprd_timestamp = jiffies;
3462 - bf->bf_flags = setup_tx_flags(skb, use_ldpc);
3463 + bf->bf_flags = setup_tx_flags(skb);
3465 bf->bf_keytype = ath9k_cmn_get_hw_crypto_keytype(skb);
3466 if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR) {
3467 @@ -1624,10 +1603,6 @@ static int ath_tx_setup_buffer(struct ie
3468 bf->bf_keyix = ATH9K_TXKEYIX_INVALID;
3471 - if (ieee80211_is_data_qos(fc) && bf_isht(bf) &&
3472 - (sc->sc_flags & SC_OP_TXAGGR))
3473 - assign_aggr_tid_seqno(skb, bf);
3477 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data,
3478 @@ -1637,12 +1612,13 @@ static int ath_tx_setup_buffer(struct ie
3479 bf->bf_buf_addr = 0;
3480 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
3481 "dma_mapping_error() on TX\n");
3483 + ath_tx_return_buffer(sc, bf);
3487 bf->bf_tx_aborted = false;
3493 /* FIXME: tx power */
3494 @@ -1690,11 +1666,6 @@ static void ath_tx_start_dma(struct ath_
3495 an = (struct ath_node *)tx_info->control.sta->drv_priv;
3496 tid = ATH_AN_2_TID(an, bf->bf_tidno);
3498 - if (!ieee80211_is_data_qos(fc)) {
3499 - ath_tx_send_normal(sc, txctl->txq, &bf_head);
3503 WARN_ON(tid->ac->txq != txctl->txq);
3504 if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
3506 @@ -1707,14 +1678,18 @@ static void ath_tx_start_dma(struct ath_
3507 * Send this frame as regular when ADDBA
3508 * exchange is neither complete nor pending.
3510 - ath_tx_send_ht_normal(sc, txctl->txq,
3512 + ath_tx_send_normal(sc, txctl->txq, tid, &bf_head);
3515 - ath_tx_send_normal(sc, txctl->txq, &bf_head);
3516 + bf->bf_state.bfs_ftype = txctl->frame_type;
3517 + bf->bf_state.bfs_paprd = txctl->paprd;
3520 + bf->bf_state.bfs_paprd_timestamp = jiffies;
3522 + ath_tx_send_normal(sc, txctl->txq, NULL, &bf_head);
3526 spin_unlock_bh(&txctl->txq->axq_lock);
3529 @@ -1724,39 +1699,15 @@ int ath_tx_start(struct ieee80211_hw *hw
3531 struct ath_wiphy *aphy = hw->priv;
3532 struct ath_softc *sc = aphy->sc;
3533 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
3534 struct ath_txq *txq = txctl->txq;
3539 - bf = ath_tx_get_buffer(sc);
3541 - ath_print(common, ATH_DBG_XMIT, "TX buffers are full\n");
3544 + bf = ath_tx_setup_buffer(hw, skb);
3545 + if (unlikely(!bf))
3548 q = skb_get_queue_mapping(skb);
3549 - r = ath_tx_setup_buffer(hw, bf, skb, txctl);
3550 - if (unlikely(r)) {
3551 - ath_print(common, ATH_DBG_FATAL, "TX mem alloc failure\n");
3553 - /* upon ath_tx_processq() this TX queue will be resumed, we
3554 - * guarantee this will happen by knowing beforehand that
3555 - * we will at least have to run TX completionon one buffer
3557 - spin_lock_bh(&txq->axq_lock);
3558 - if (txq == sc->tx.txq_map[q] && !txq->stopped &&
3559 - txq->axq_depth > 1) {
3560 - ath_mac80211_stop_queue(sc, q);
3563 - spin_unlock_bh(&txq->axq_lock);
3565 - ath_tx_return_buffer(sc, bf);
3570 spin_lock_bh(&txq->axq_lock);
3571 if (txq == sc->tx.txq_map[q] &&
3572 ++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
3573 @@ -1828,7 +1779,7 @@ exit:
3576 static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
3577 - struct ath_wiphy *aphy, int tx_flags,
3578 + struct ath_wiphy *aphy, int tx_flags, int ftype,
3579 struct ath_txq *txq)
3581 struct ieee80211_hw *hw = sc->hw;
3582 @@ -1872,8 +1823,8 @@ static void ath_tx_complete(struct ath_s
3583 PS_WAIT_FOR_TX_ACK));
3586 - if (unlikely(tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_INTERNAL))
3587 - ath9k_tx_status(hw, skb);
3588 + if (unlikely(ftype))
3589 + ath9k_tx_status(hw, skb, ftype);
3591 q = skb_get_queue_mapping(skb);
3592 if (txq == sc->tx.txq_map[q]) {
3593 @@ -1917,7 +1868,8 @@ static void ath_tx_complete_buf(struct a
3594 complete(&sc->paprd_complete);
3596 ath_debug_stat_tx(sc, bf, ts);
3597 - ath_tx_complete(sc, skb, bf->aphy, tx_flags, txq);
3598 + ath_tx_complete(sc, skb, bf->aphy, tx_flags,
3599 + bf->bf_state.bfs_ftype, txq);
3601 /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
3602 * accidentally reference it later.
3603 @@ -1968,6 +1920,8 @@ static void ath_tx_rc_status(struct ath_
3604 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
3605 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
3606 struct ieee80211_hw *hw = bf->aphy->hw;
3607 + struct ath_softc *sc = bf->aphy->sc;
3608 + struct ath_hw *ah = sc->sc_ah;
3612 @@ -1989,14 +1943,24 @@ static void ath_tx_rc_status(struct ath_
3614 if ((ts->ts_status & ATH9K_TXERR_FILT) == 0 &&
3615 (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0 && update_rc) {
3616 - if (ieee80211_is_data(hdr->frame_control)) {
3617 - if (ts->ts_flags &
3618 - (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN))
3619 - tx_info->pad[0] |= ATH_TX_INFO_UNDERRUN;
3620 - if ((ts->ts_status & ATH9K_TXERR_XRETRY) ||
3621 - (ts->ts_status & ATH9K_TXERR_FIFO))
3622 - tx_info->pad[0] |= ATH_TX_INFO_XRETRY;
3625 + * If an underrun error is seen assume it as an excessive
3626 + * retry only if max frame trigger level has been reached
3627 + * (2 KB for single stream, and 4 KB for dual stream).
3628 + * Adjust the long retry as if the frame was tried
3629 + * hw->max_rate_tries times to affect how rate control updates
3630 + * PER for the failed rate.
3631 + * In case of congestion on the bus penalizing this type of
3632 + * underruns should help hardware actually transmit new frames
3633 + * successfully by eventually preferring slower rates.
3634 + * This itself should also alleviate congestion on the bus.
3636 + if (ieee80211_is_data(hdr->frame_control) &&
3637 + (ts->ts_flags & (ATH9K_TX_DATA_UNDERRUN |
3638 + ATH9K_TX_DELIM_UNDERRUN)) &&
3639 + ah->tx_trig_level >= sc->sc_ah->caps.tx_triglevel_max)
3640 + tx_info->status.rates[tx_rateindex].count =
3641 + hw->max_rate_tries;
3644 for (i = tx_rateindex + 1; i < hw->max_rates; i++) {