68 u16 bMode, fracMode, aModeRefSel = 0;
69 u32 freq, ndiv, channelSel = 0, channelFrac = 0, reg32 = 0;
74 freq = centers.synth_center;
116 else if ((freq % 20) == 0)
118 else if ((freq % 10) == 0)
141 ndiv = (freq * (refDivA >> aModeRefSel)) / 60;
142 channelSel = ndiv & 0x1ff;
143 channelFrac = (ndiv & 0xfffffe00) * 2;
144 channelSel = (channelSel << 17) | channelFrac;
150 (fracMode << 28) | (aModeRefSel << 26) | (channelSel);
167 static void ar9002_hw_spur_mitigate(
struct ath_hw *ah,
173 int bb_spur_off, spur_subchannel_sd;
175 int spur_delta_phase;
177 int upper, lower, cur_vit_mask;
180 static const int pilot_mask_reg[4] = {
184 static const int chan_mask_reg[4] = {
188 static const int inc[4] = { 0, 100, 0, 0 };
202 freq = centers.synth_center;
206 cur_bb_spur = ah->
eep_ops->get_spur_channel(ah, i, is2GHz);
216 cur_bb_spur = cur_bb_spur -
freq;
221 bb_spur = cur_bb_spur;
226 bb_spur = cur_bb_spur;
261 spur_subchannel_sd = 1;
262 bb_spur_off = bb_spur + 10;
264 spur_subchannel_sd = 0;
265 bb_spur_off = bb_spur - 10;
268 spur_subchannel_sd = 0;
269 bb_spur_off = bb_spur;
274 ((bb_spur * 262144) /
278 ((bb_spur * 524288) /
282 spur_freq_sd = ((bb_spur_off * 2048) / denominator) & 0x3ff;
296 for (i = 0; i < 4; i++) {
300 for (bp = 0; bp < 30; bp++) {
301 if ((cur_bin > lower) && (cur_bin < upper)) {
302 pilot_mask = pilot_mask | 0x1 << bp;
303 chan_mask = chan_mask | 0x1 << bp;
308 REG_WRITE(ah, pilot_mask_reg[i], pilot_mask);
309 REG_WRITE(ah, chan_mask_reg[i], chan_mask);
316 for (i = 0; i < 123; i++) {
317 if ((cur_vit_mask > lower) && (cur_vit_mask < upper)) {
320 volatile int tmp_v =
abs(cur_vit_mask - bin);
326 if (cur_vit_mask < 0)
327 mask_m[
abs(cur_vit_mask / 100)] = mask_amt;
329 mask_p[cur_vit_mask / 100] = mask_amt;
334 tmp_mask = (mask_m[46] << 30) | (mask_m[47] << 28)
335 | (mask_m[48] << 26) | (mask_m[49] << 24)
336 | (mask_m[50] << 22) | (mask_m[51] << 20)
337 | (mask_m[52] << 18) | (mask_m[53] << 16)
338 | (mask_m[54] << 14) | (mask_m[55] << 12)
339 | (mask_m[56] << 10) | (mask_m[57] << 8)
340 | (mask_m[58] << 6) | (mask_m[59] << 4)
341 | (mask_m[60] << 2) | (mask_m[61] << 0);
345 tmp_mask = (mask_m[31] << 28)
346 | (mask_m[32] << 26) | (mask_m[33] << 24)
347 | (mask_m[34] << 22) | (mask_m[35] << 20)
348 | (mask_m[36] << 18) | (mask_m[37] << 16)
349 | (mask_m[48] << 14) | (mask_m[39] << 12)
350 | (mask_m[40] << 10) | (mask_m[41] << 8)
351 | (mask_m[42] << 6) | (mask_m[43] << 4)
352 | (mask_m[44] << 2) | (mask_m[45] << 0);
356 tmp_mask = (mask_m[16] << 30) | (mask_m[16] << 28)
357 | (mask_m[18] << 26) | (mask_m[18] << 24)
358 | (mask_m[20] << 22) | (mask_m[20] << 20)
359 | (mask_m[22] << 18) | (mask_m[22] << 16)
360 | (mask_m[24] << 14) | (mask_m[24] << 12)
361 | (mask_m[25] << 10) | (mask_m[26] << 8)
362 | (mask_m[27] << 6) | (mask_m[28] << 4)
363 | (mask_m[29] << 2) | (mask_m[30] << 0);
367 tmp_mask = (mask_m[0] << 30) | (mask_m[1] << 28)
368 | (mask_m[2] << 26) | (mask_m[3] << 24)
369 | (mask_m[4] << 22) | (mask_m[5] << 20)
370 | (mask_m[6] << 18) | (mask_m[7] << 16)
371 | (mask_m[8] << 14) | (mask_m[9] << 12)
372 | (mask_m[10] << 10) | (mask_m[11] << 8)
373 | (mask_m[12] << 6) | (mask_m[13] << 4)
374 | (mask_m[14] << 2) | (mask_m[15] << 0);
378 tmp_mask = (mask_p[15] << 28)
379 | (mask_p[14] << 26) | (mask_p[13] << 24)
380 | (mask_p[12] << 22) | (mask_p[11] << 20)
381 | (mask_p[10] << 18) | (mask_p[9] << 16)
382 | (mask_p[8] << 14) | (mask_p[7] << 12)
383 | (mask_p[6] << 10) | (mask_p[5] << 8)
384 | (mask_p[4] << 6) | (mask_p[3] << 4)
385 | (mask_p[2] << 2) | (mask_p[1] << 0);
389 tmp_mask = (mask_p[30] << 28)
390 | (mask_p[29] << 26) | (mask_p[28] << 24)
391 | (mask_p[27] << 22) | (mask_p[26] << 20)
392 | (mask_p[25] << 18) | (mask_p[24] << 16)
393 | (mask_p[23] << 14) | (mask_p[22] << 12)
394 | (mask_p[21] << 10) | (mask_p[20] << 8)
395 | (mask_p[19] << 6) | (mask_p[18] << 4)
396 | (mask_p[17] << 2) | (mask_p[16] << 0);
400 tmp_mask = (mask_p[45] << 28)
401 | (mask_p[44] << 26) | (mask_p[43] << 24)
402 | (mask_p[42] << 22) | (mask_p[41] << 20)
403 | (mask_p[40] << 18) | (mask_p[39] << 16)
404 | (mask_p[38] << 14) | (mask_p[37] << 12)
405 | (mask_p[36] << 10) | (mask_p[35] << 8)
406 | (mask_p[34] << 6) | (mask_p[33] << 4)
407 | (mask_p[32] << 2) | (mask_p[31] << 0);
411 tmp_mask = (mask_p[61] << 30) | (mask_p[60] << 28)
412 | (mask_p[59] << 26) | (mask_p[58] << 24)
413 | (mask_p[57] << 22) | (mask_p[56] << 20)
414 | (mask_p[55] << 18) | (mask_p[54] << 16)
415 | (mask_p[53] << 14) | (mask_p[52] << 12)
416 | (mask_p[51] << 10) | (mask_p[50] << 8)
417 | (mask_p[49] << 6) | (mask_p[48] << 4)
418 | (mask_p[47] << 2) | (mask_p[46] << 0);
425 static void ar9002_olc_init(
struct ath_hw *ah)
449 static u32 ar9002_hw_compute_pll_control(
struct ath_hw *ah,
476 static void ar9002_hw_do_getnf(
struct ath_hw *ah,
482 nfarray[0] = sign_extend32(nf, 8);
486 nfarray[3] = sign_extend32(nf, 8);
492 nfarray[1] = sign_extend32(nf, 8);
496 nfarray[4] = sign_extend32(nf, 8);
499 static void ar9002_hw_set_nf_limits(
struct ath_hw *ah)
523 static void ar9002_hw_antdiv_comb_conf_get(
struct ath_hw *ah,
539 static void ar9002_hw_antdiv_comb_conf_set(
struct ath_hw *ah,
568 priv_ops->
olc_init = ar9002_olc_init;
570 priv_ops->
do_getnf = ar9002_hw_do_getnf;
575 ar9002_hw_set_nf_limits(ah);