aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ar9003_phy.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-12-06 07:27:47 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-07 16:34:56 -0500
commitd9a2545ac713e26ab8c8eee741d2da1626cebd6e (patch)
tree3d5974b959a9bed5235c56a2c3b7edc2a02a29fd /drivers/net/wireless/ath/ath9k/ar9003_phy.c
parent272ceba892208013a45847276a00ccae54e2b94a (diff)
ath9k: Read spur channel information from eeprom for AR9485
Also spur channel count and range is different for AR9485. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_phy.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index bce1fdb1660a..da4a571304da 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -134,21 +134,50 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,
134 static const u32 spur_freq[4] = { 2420, 2440, 2464, 2480 }; 134 static const u32 spur_freq[4] = { 2420, 2440, 2464, 2480 };
135 int cur_bb_spur, negative = 0, cck_spur_freq; 135 int cur_bb_spur, negative = 0, cck_spur_freq;
136 int i; 136 int i;
137 int range, max_spur_cnts, synth_freq;
138 u8 *spur_fbin_ptr = NULL;
137 139
138 /* 140 /*
139 * Need to verify range +/- 10 MHz in control channel, otherwise spur 141 * Need to verify range +/- 10 MHz in control channel, otherwise spur
140 * is out-of-band and can be ignored. 142 * is out-of-band and can be ignored.
141 */ 143 */
142 144
143 for (i = 0; i < 4; i++) { 145 if (AR_SREV_9485(ah)) {
146 spur_fbin_ptr = ar9003_get_spur_chan_ptr(ah,
147 IS_CHAN_2GHZ(chan));
148 if (spur_fbin_ptr[0] == 0) /* No spur */
149 return;
150 max_spur_cnts = 5;
151 if (IS_CHAN_HT40(chan)) {
152 range = 19;
153 if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL,
154 AR_PHY_GC_DYN2040_PRI_CH) == 0)
155 synth_freq = chan->channel + 10;
156 else
157 synth_freq = chan->channel - 10;
158 } else {
159 range = 10;
160 synth_freq = chan->channel;
161 }
162 } else {
163 range = 10;
164 max_spur_cnts = 4;
165 synth_freq = chan->channel;
166 }
167
168 for (i = 0; i < max_spur_cnts; i++) {
144 negative = 0; 169 negative = 0;
145 cur_bb_spur = spur_freq[i] - chan->channel; 170 if (AR_SREV_9485(ah))
171 cur_bb_spur = FBIN2FREQ(spur_fbin_ptr[i],
172 IS_CHAN_2GHZ(chan)) - synth_freq;
173 else
174 cur_bb_spur = spur_freq[i] - synth_freq;
146 175
147 if (cur_bb_spur < 0) { 176 if (cur_bb_spur < 0) {
148 negative = 1; 177 negative = 1;
149 cur_bb_spur = -cur_bb_spur; 178 cur_bb_spur = -cur_bb_spur;
150 } 179 }
151 if (cur_bb_spur < 10) { 180 if (cur_bb_spur < range) {
152 cck_spur_freq = (int)((cur_bb_spur << 19) / 11); 181 cck_spur_freq = (int)((cur_bb_spur << 19) / 11);
153 182
154 if (negative == 1) 183 if (negative == 1)