Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225107
b: refs/heads/master
c: d9a2545
h: refs/heads/master
i:
  225105: c2070d2
  225103: 508d228
v: v3
  • Loading branch information
Vasanthakumar Thiagarajan authored and John W. Linville committed Dec 7, 2010
1 parent f6f46e1 commit 47af60a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 272ceba892208013a45847276a00ccae54e2b94a
refs/heads/master: d9a2545ac713e26ab8c8eee741d2da1626cebd6e
35 changes: 32 additions & 3 deletions trunk/drivers/net/wireless/ath/ath9k/ar9003_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,50 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,
static const u32 spur_freq[4] = { 2420, 2440, 2464, 2480 };
int cur_bb_spur, negative = 0, cck_spur_freq;
int i;
int range, max_spur_cnts, synth_freq;
u8 *spur_fbin_ptr = NULL;

/*
* Need to verify range +/- 10 MHz in control channel, otherwise spur
* is out-of-band and can be ignored.
*/

for (i = 0; i < 4; i++) {
if (AR_SREV_9485(ah)) {
spur_fbin_ptr = ar9003_get_spur_chan_ptr(ah,
IS_CHAN_2GHZ(chan));
if (spur_fbin_ptr[0] == 0) /* No spur */
return;
max_spur_cnts = 5;
if (IS_CHAN_HT40(chan)) {
range = 19;
if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL,
AR_PHY_GC_DYN2040_PRI_CH) == 0)
synth_freq = chan->channel + 10;
else
synth_freq = chan->channel - 10;
} else {
range = 10;
synth_freq = chan->channel;
}
} else {
range = 10;
max_spur_cnts = 4;
synth_freq = chan->channel;
}

for (i = 0; i < max_spur_cnts; i++) {
negative = 0;
cur_bb_spur = spur_freq[i] - chan->channel;
if (AR_SREV_9485(ah))
cur_bb_spur = FBIN2FREQ(spur_fbin_ptr[i],
IS_CHAN_2GHZ(chan)) - synth_freq;
else
cur_bb_spur = spur_freq[i] - synth_freq;

if (cur_bb_spur < 0) {
negative = 1;
cur_bb_spur = -cur_bb_spur;
}
if (cur_bb_spur < 10) {
if (cur_bb_spur < range) {
cck_spur_freq = (int)((cur_bb_spur << 19) / 11);

if (negative == 1)
Expand Down

0 comments on commit 47af60a

Please sign in to comment.