73 u16 bMode, fracMode, aModeRefSel = 0;
74 u32 freq, ndiv, channelSel = 0, channelFrac = 0, reg32 = 0;
86 unsigned int regWrites = 0;
119 if ((freq % 20) == 0)
121 else if ((freq % 10) == 0)
144 ndiv = (freq * (refDivA >> aModeRefSel)) / 60;
145 channelSel = ndiv & 0x1ff;
146 channelFrac = (ndiv & 0xfffffe00) * 2;
147 channelSel = (channelSel << 17) | channelFrac;
153 (fracMode << 28) | (aModeRefSel << 26) | (channelSel);
158 ah->curchan_rad_index = -1;
177 int bb_spur_off, spur_subchannel_sd;
179 int spur_delta_phase;
181 int upper, lower, cur_vit_mask;
184 static const int pilot_mask_reg[4] = {
188 static const int chan_mask_reg[4] = {
192 static const int inc[4] = { 0, 100, 0, 0 };
210 cur_bb_spur =
ah->eep_ops->get_spur_channel(
ah, i, is2GHz);
220 cur_bb_spur = cur_bb_spur - freq;
225 bb_spur = cur_bb_spur;
230 bb_spur = cur_bb_spur;
265 spur_subchannel_sd = 1;
266 bb_spur_off = bb_spur + 10;
268 spur_subchannel_sd = 0;
269 bb_spur_off = bb_spur - 10;
272 spur_subchannel_sd = 0;
273 bb_spur_off = bb_spur;
278 ((bb_spur * 262144) /
282 ((bb_spur * 524288) /
286 spur_freq_sd = ((bb_spur_off * 2048) / denominator) & 0x3ff;
300 for (i = 0; i < 4; i++) {
304 for (
bp = 0;
bp < 30;
bp++) {
305 if ((cur_bin > lower) && (cur_bin < upper)) {
306 pilot_mask = pilot_mask | 0x1 <<
bp;
307 chan_mask = chan_mask | 0x1 <<
bp;
320 for (i = 0; i < 123; i++) {
321 if ((cur_vit_mask > lower) && (cur_vit_mask < upper)) {
324 volatile int tmp_v =
abs(cur_vit_mask - bin);
330 if (cur_vit_mask < 0)
331 mask_m[
abs(cur_vit_mask / 100)] = mask_amt;
333 mask_p[cur_vit_mask / 100] = mask_amt;
338 tmp_mask = (mask_m[46] << 30) | (mask_m[47] << 28)
339 | (mask_m[48] << 26) | (mask_m[49] << 24)
340 | (mask_m[50] << 22) | (mask_m[51] << 20)
341 | (mask_m[52] << 18) | (mask_m[53] << 16)
342 | (mask_m[54] << 14) | (mask_m[55] << 12)
343 | (mask_m[56] << 10) | (mask_m[57] << 8)
344 | (mask_m[58] << 6) | (mask_m[59] << 4)
345 | (mask_m[60] << 2) | (mask_m[61] << 0);
349 tmp_mask = (mask_m[31] << 28)
350 | (mask_m[32] << 26) | (mask_m[33] << 24)
351 | (mask_m[34] << 22) | (mask_m[35] << 20)
352 | (mask_m[36] << 18) | (mask_m[37] << 16)
353 | (mask_m[48] << 14) | (mask_m[39] << 12)
354 | (mask_m[40] << 10) | (mask_m[41] << 8)
355 | (mask_m[42] << 6) | (mask_m[43] << 4)
356 | (mask_m[44] << 2) | (mask_m[45] << 0);
360 tmp_mask = (mask_m[16] << 30) | (mask_m[16] << 28)
361 | (mask_m[18] << 26) | (mask_m[18] << 24)
362 | (mask_m[20] << 22) | (mask_m[20] << 20)
363 | (mask_m[22] << 18) | (mask_m[22] << 16)
364 | (mask_m[24] << 14) | (mask_m[24] << 12)
365 | (mask_m[25] << 10) | (mask_m[26] << 8)
366 | (mask_m[27] << 6) | (mask_m[28] << 4)
367 | (mask_m[29] << 2) | (mask_m[30] << 0);
371 tmp_mask = (mask_m[0] << 30) | (mask_m[1] << 28)
372 | (mask_m[2] << 26) | (mask_m[3] << 24)
373 | (mask_m[4] << 22) | (mask_m[5] << 20)
374 | (mask_m[6] << 18) | (mask_m[7] << 16)
375 | (mask_m[8] << 14) | (mask_m[9] << 12)
376 | (mask_m[10] << 10) | (mask_m[11] << 8)
377 | (mask_m[12] << 6) | (mask_m[13] << 4)
378 | (mask_m[14] << 2) | (mask_m[15] << 0);
382 tmp_mask = (mask_p[15] << 28)
383 | (mask_p[14] << 26) | (mask_p[13] << 24)
384 | (mask_p[12] << 22) | (mask_p[11] << 20)
385 | (mask_p[10] << 18) | (mask_p[9] << 16)
386 | (mask_p[8] << 14) | (mask_p[7] << 12)
387 | (mask_p[6] << 10) | (mask_p[5] << 8)
388 | (mask_p[4] << 6) | (mask_p[3] << 4)
389 | (mask_p[2] << 2) | (mask_p[1] << 0);
393 tmp_mask = (mask_p[30] << 28)
394 | (mask_p[29] << 26) | (mask_p[28] << 24)
395 | (mask_p[27] << 22) | (mask_p[26] << 20)
396 | (mask_p[25] << 18) | (mask_p[24] << 16)
397 | (mask_p[23] << 14) | (mask_p[22] << 12)
398 | (mask_p[21] << 10) | (mask_p[20] << 8)
399 | (mask_p[19] << 6) | (mask_p[18] << 4)
400 | (mask_p[17] << 2) | (mask_p[16] << 0);
404 tmp_mask = (mask_p[45] << 28)
405 | (mask_p[44] << 26) | (mask_p[43] << 24)
406 | (mask_p[42] << 22) | (mask_p[41] << 20)
407 | (mask_p[40] << 18) | (mask_p[39] << 16)
408 | (mask_p[38] << 14) | (mask_p[37] << 12)
409 | (mask_p[36] << 10) | (mask_p[35] << 8)
410 | (mask_p[34] << 6) | (mask_p[33] << 4)
411 | (mask_p[32] << 2) | (mask_p[31] << 0);
415 tmp_mask = (mask_p[61] << 30) | (mask_p[60] << 28)
416 | (mask_p[59] << 26) | (mask_p[58] << 24)
417 | (mask_p[57] << 22) | (mask_p[56] << 20)
418 | (mask_p[55] << 18) | (mask_p[54] << 16)
419 | (mask_p[53] << 14) | (mask_p[52] << 12)
420 | (mask_p[51] << 10) | (mask_p[50] << 8)
421 | (mask_p[49] << 6) | (mask_p[48] << 4)
422 | (mask_p[47] << 2) | (mask_p[46] << 0);
446 ah->originalGain[i] =
#define AR_SPUR_FEEQ_BOUND_HT40
#define AR9280_PHY_MINCCA_PWR
#define AR_RTC_9160_PLL_REFDIV
#define AR_PHY_MASK2_M_16_30
#define AR_SREV_9287_11_OR_LATER(_ah)
#define AR_PHY_CCK_TX_CTRL_JAPAN
#define AR9287_AN_TXPC0_TXPCMODE_TEMPSENSE
#define AR_PHY_CCA_NOM_VAL_9285_2GHZ
#define AR_PHY_FORCE_CLKEN_CCK_MRC_MUX
#define AR_PHY_MASK2_M_31_45
#define AR_PHY_TX_PWRCTRL9
#define AR9280_TX_GAIN_TABLE_SIZE
#define AR_PHY_TX_GAIN_TBL1
#define AR_PHY_TIMING_CTRL4_ENABLE_SPUR_RSSI
void(* rf_free_ext_banks)(struct ath_hw *ah)
#define AR_EEPROM_MODAL_SPURS
#define AR9280_PHY_EXT_MINCCA_PWR
#define REG_CLR_BIT(_a, _r, _f)
#define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL
#define CHANSEL_5G(_freq)
#define AR_PHY_BIN_MASK_1
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
#define REGWRITE_BUFFER_FLUSH(_ah)
static int32_t sign_extend32(uint32_t value, int index)
int(* rf_alloc_ext_banks)(struct ath_hw *ah)
static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah, struct ath9k_channel *chan)
void(* olc_init)(struct ath_hw *ah)
#define AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ
#define IS_CHAN_HALF_RATE(_c)
#define AR_PHY_FORCE_CLKEN_CCK
#define AR_PHY_SPUR_REG_ENABLE_VIT_SPUR_RSSI
#define AR_PHY_TIMING11_SPUR_FREQ_SD
#define AR_PHY_CCA_MAX_GOOD_VAL_9271_2GHZ
#define AR_PHY_9285_ANT_DIV_MAIN_LNACONF
struct ath_hw_private_ops - callbacks used internally by hardware code
#define AR_PHY_9285_FAST_DIV_BIAS_S
#define AR_PHY_CHANNEL_MASK_01_30
#define AR_SPUR_FEEQ_BOUND_HT20
#define CHANSEL_2G(_freq)
#define AR_PHY_CCA_MIN_GOOD_VAL_9271_2GHZ
#define AR_SREV_9285(_ah)
#define AR_PHY_CCA_MAX_GOOD_VAL_9280_2GHZ
#define AR_PHY_MULTICHAIN_GAIN_CTL
#define AR_PHY_SPUR_REG_ENABLE_MASK_PPM
#define AR_PHY_CHANNEL_MASK_31_60
#define AR_PHY_CCA_MIN_GOOD_VAL_9285_2GHZ
#define AR_PHY_BIN_MASK2_3
#define AR_PHY_MASK2_P_61_45
#define OLC_FOR_AR9287_10_LATER
#define AR_PHY_TIMING_CTRL4_ENABLE_SPUR_FILTER
#define REG_RMW_FIELD(_a, _r, _f, _v)
void(* antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
#define AR_SREV_9280_20(_ah)
static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
DOC: Programming Atheros 802.11n analog front end radios.
#define IS_CHAN_QUARTER_RATE(_c)
#define AR_BASE_FREQ_5GHZ
#define AR_SREV_9287(_ah)
#define AR_PHY_MASK2_P_45_31
#define AR_PHY_SFCORR_SPUR_SUBCHNL_SD_S
#define AR_PHY_TIMING_CTRL4_ENABLE_CHAN_MASK
#define AR_PHY_CCA_MAX_GOOD_VAL_9285_2GHZ
#define AR_RTC_9160_PLL_DIV
static void ar9002_hw_set_nf_limits(struct ath_hw *ah)
#define AR_PHY_CCK_TX_CTRL
#define AR_PHY_TIMING_CTRL4(_i)
#define AR9280_PHY_CH1_EXT_MINCCA_PWR
static void ar9002_hw_do_getnf(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
int(* set_rf_regs)(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
#define AR_PHY_CCA_NOM_VAL_9287_2GHZ
#define AR_PHY_TIMING_CTRL4_ENABLE_PILOT_MASK
#define AR_PHY_CCA_MIN_GOOD_VAL_9280_5GHZ
#define SPUR_ENABLE_EEPROM
#define AR_AN_SYNTH9_REFDIVA
#define AR_PHY_MASK2_P_30_16
#define AR_PHY_9285_ANT_DIV_ALT_LNACONF_S
#define AR_PHY_CCA_NOM_VAL_9280_2GHZ
static void ar9002_hw_spur_mitigate(struct ath_hw *ah, struct ath9k_channel *chan)
ar9002_hw_spur_mitigate - convert baseband spur frequency @ah: atheros hardware structure @chan:
#define AR9287_AN_TXPC0_TXPCMODE_S
#define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH
#define AR_PHY_SPUR_REG_MASK_RATE_CNTL
#define AR_RTC_9160_PLL_CLKSEL
#define AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S
#define AR_PHY_CH1_EXT_CCA
#define AR_PHY_TIMING11_SPUR_DELTA_PHASE
struct ath_hw_ops - callbacks used by hardware code and driver code
#define AR9280_PHY_CH1_MINCCA_PWR
#define AR9287_AN_TXPC0_TXPCMODE
#define AR_PHY_BIN_MASK2_4
#define AR_PHY_MASK2_M_00_15
#define OLC_FOR_AR9280_20_LATER
void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, u32 shift, u32 val)
#define AR_PHY_CCA_NOM_VAL_9280_5GHZ
#define AR_PHY_SPUR_REG_MASK_RATE_SELECT
#define REG_READ(_ah, _reg)
#define AR_PHY_MASK2_P_15_01
static void ar9002_olc_init(struct ath_hw *ah)
#define REG_SET_BIT(_a, _r, _f)
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
#define AR_PHY_BIN_MASK_2
#define REG_WRITE_ARRAY(iniarray, column, regWr)
#define AR_PHY_PILOT_MASK_31_60
static void ar9002_hw_antdiv_comb_conf_set(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
#define AR_PHY_SFCORR_EXT
#define REG_WRITE(_ah, _reg, _val)
#define AR_PHY_PILOT_MASK_01_30
#define AR_PHY_9285_FAST_DIV_BIAS
#define AR_PHY_CCA_MAX_GOOD_VAL_9280_5GHZ
#define AR_SREV_9271(_ah)
#define AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ
void(* antdiv_comb_conf_get)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
static void ar9002_hw_antdiv_comb_conf_get(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
void ath9k_hw_get_channel_centers(struct ath_hw *ah __unused, struct ath9k_channel *chan, struct chan_centers *centers)
#define AR_PHY_CCA_MIN_GOOD_VAL_9280_2GHZ
u32(* compute_pll_control)(struct ath_hw *ah, struct ath9k_channel *chan)
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
#define AR_PHY_CCA_NOM_VAL_9271_2GHZ
#define IS_CHAN_A_FAST_CLOCK(_ah, _c)
#define AR_PHY_BIN_MASK2_1
#define AR_PHY_BIN_MASK2_2
#define NULL
NULL pointer (VOID *)
#define AR_PHY_9285_ANT_DIV_ALT_LNACONF
#define AR_PHY_BIN_MASK_3
void ar9002_hw_attach_phy_ops(struct ath_hw *ah)
#define AR_PHY_TIMING11_USE_SPUR_IN_AGC
#define ENABLE_REGWRITE_BUFFER(_ah)
void * memset(void *dest, int character, size_t len) __nonnull
#define AR_BASE_FREQ_2GHZ
#define AR_PHY_VIT_MASK2_M_46_61
#define AR_PHY_SYNTH_CONTROL