diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2010-04-15 17:39:15 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-16 15:43:38 -0400 |
commit | 1547da37db9b56eb98eb0f33b84d49ab4e83e01e (patch) | |
tree | 6e31326ef4deb98b0268d630c7e3fe9c6a6978f7 /drivers/net/wireless/ath/ath9k | |
parent | 15c9ee7af8a3527a82013ea447da2d8c491aabfe (diff) |
ath9k_hw: add OFDM spur mitigation for AR9003
We add this now as OFDM spur mitigation required accessing
the EEPROM for the AR9003 devices.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_phy.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 210 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.h | 54 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/phy.h | 3 |
5 files changed, 267 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.h b/drivers/net/wireless/ath/ath9k/ar9002_phy.h index afe48086250d..81bf6e5840e1 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.h | |||
@@ -289,8 +289,6 @@ | |||
289 | #define AR_PHY_TIMING11 0x99a0 | 289 | #define AR_PHY_TIMING11 0x99a0 |
290 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE 0x000FFFFF | 290 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE 0x000FFFFF |
291 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE_S 0 | 291 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE_S 0 |
292 | #define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000 | ||
293 | #define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20 | ||
294 | #define AR_PHY_TIMING11_USE_SPUR_IN_AGC 0x40000000 | 292 | #define AR_PHY_TIMING11_USE_SPUR_IN_AGC 0x40000000 |
295 | #define AR_PHY_TIMING11_USE_SPUR_IN_SELFCOR 0x80000000 | 293 | #define AR_PHY_TIMING11_USE_SPUR_IN_SELFCOR 0x80000000 |
296 | 294 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index fee07fd7a595..137543b2d739 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -103,8 +103,8 @@ static int ar9003_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) | |||
103 | * | 103 | * |
104 | * Spur mitigation for MRC CCK | 104 | * Spur mitigation for MRC CCK |
105 | */ | 105 | */ |
106 | static void ar9003_hw_spur_mitigate(struct ath_hw *ah, | 106 | static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah, |
107 | struct ath9k_channel *chan) | 107 | struct ath9k_channel *chan) |
108 | { | 108 | { |
109 | u32 spur_freq[4] = { 2420, 2440, 2464, 2480 }; | 109 | u32 spur_freq[4] = { 2420, 2440, 2464, 2480 }; |
110 | int cur_bb_spur, negative = 0, cck_spur_freq; | 110 | int cur_bb_spur, negative = 0, cck_spur_freq; |
@@ -157,6 +157,212 @@ static void ar9003_hw_spur_mitigate(struct ath_hw *ah, | |||
157 | AR_PHY_CCK_SPUR_MIT_CCK_SPUR_FREQ, 0x0); | 157 | AR_PHY_CCK_SPUR_MIT_CCK_SPUR_FREQ, 0x0); |
158 | } | 158 | } |
159 | 159 | ||
160 | /* Clean all spur register fields */ | ||
161 | static void ar9003_hw_spur_ofdm_clear(struct ath_hw *ah) | ||
162 | { | ||
163 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
164 | AR_PHY_TIMING4_ENABLE_SPUR_FILTER, 0); | ||
165 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
166 | AR_PHY_TIMING11_SPUR_FREQ_SD, 0); | ||
167 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
168 | AR_PHY_TIMING11_SPUR_DELTA_PHASE, 0); | ||
169 | REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT, | ||
170 | AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD, 0); | ||
171 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
172 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC, 0); | ||
173 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
174 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR, 0); | ||
175 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
176 | AR_PHY_TIMING4_ENABLE_SPUR_RSSI, 0); | ||
177 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
178 | AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 0); | ||
179 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
180 | AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 0); | ||
181 | |||
182 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
183 | AR_PHY_SPUR_REG_ENABLE_MASK_PPM, 0); | ||
184 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
185 | AR_PHY_TIMING4_ENABLE_PILOT_MASK, 0); | ||
186 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
187 | AR_PHY_TIMING4_ENABLE_CHAN_MASK, 0); | ||
188 | REG_RMW_FIELD(ah, AR_PHY_PILOT_SPUR_MASK, | ||
189 | AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A, 0); | ||
190 | REG_RMW_FIELD(ah, AR_PHY_SPUR_MASK_A, | ||
191 | AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A, 0); | ||
192 | REG_RMW_FIELD(ah, AR_PHY_CHAN_SPUR_MASK, | ||
193 | AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A, 0); | ||
194 | REG_RMW_FIELD(ah, AR_PHY_PILOT_SPUR_MASK, | ||
195 | AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A, 0); | ||
196 | REG_RMW_FIELD(ah, AR_PHY_CHAN_SPUR_MASK, | ||
197 | AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A, 0); | ||
198 | REG_RMW_FIELD(ah, AR_PHY_SPUR_MASK_A, | ||
199 | AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A, 0); | ||
200 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
201 | AR_PHY_SPUR_REG_MASK_RATE_CNTL, 0); | ||
202 | } | ||
203 | |||
204 | static void ar9003_hw_spur_ofdm(struct ath_hw *ah, | ||
205 | int freq_offset, | ||
206 | int spur_freq_sd, | ||
207 | int spur_delta_phase, | ||
208 | int spur_subchannel_sd) | ||
209 | { | ||
210 | int mask_index = 0; | ||
211 | |||
212 | /* OFDM Spur mitigation */ | ||
213 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
214 | AR_PHY_TIMING4_ENABLE_SPUR_FILTER, 0x1); | ||
215 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
216 | AR_PHY_TIMING11_SPUR_FREQ_SD, spur_freq_sd); | ||
217 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
218 | AR_PHY_TIMING11_SPUR_DELTA_PHASE, spur_delta_phase); | ||
219 | REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT, | ||
220 | AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD, spur_subchannel_sd); | ||
221 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
222 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC, 0x1); | ||
223 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
224 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR, 0x1); | ||
225 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
226 | AR_PHY_TIMING4_ENABLE_SPUR_RSSI, 0x1); | ||
227 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
228 | AR_PHY_SPUR_REG_SPUR_RSSI_THRESH, 34); | ||
229 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
230 | AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 1); | ||
231 | |||
232 | if (REG_READ_FIELD(ah, AR_PHY_MODE, | ||
233 | AR_PHY_MODE_DYNAMIC) == 0x1) | ||
234 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
235 | AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 1); | ||
236 | |||
237 | mask_index = (freq_offset << 4) / 5; | ||
238 | if (mask_index < 0) | ||
239 | mask_index = mask_index - 1; | ||
240 | |||
241 | mask_index = mask_index & 0x7f; | ||
242 | |||
243 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
244 | AR_PHY_SPUR_REG_ENABLE_MASK_PPM, 0x1); | ||
245 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
246 | AR_PHY_TIMING4_ENABLE_PILOT_MASK, 0x1); | ||
247 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | ||
248 | AR_PHY_TIMING4_ENABLE_CHAN_MASK, 0x1); | ||
249 | REG_RMW_FIELD(ah, AR_PHY_PILOT_SPUR_MASK, | ||
250 | AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A, mask_index); | ||
251 | REG_RMW_FIELD(ah, AR_PHY_SPUR_MASK_A, | ||
252 | AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A, mask_index); | ||
253 | REG_RMW_FIELD(ah, AR_PHY_CHAN_SPUR_MASK, | ||
254 | AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A, mask_index); | ||
255 | REG_RMW_FIELD(ah, AR_PHY_PILOT_SPUR_MASK, | ||
256 | AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A, 0xc); | ||
257 | REG_RMW_FIELD(ah, AR_PHY_CHAN_SPUR_MASK, | ||
258 | AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A, 0xc); | ||
259 | REG_RMW_FIELD(ah, AR_PHY_SPUR_MASK_A, | ||
260 | AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A, 0xa0); | ||
261 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | ||
262 | AR_PHY_SPUR_REG_MASK_RATE_CNTL, 0xff); | ||
263 | } | ||
264 | |||
265 | static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | ||
266 | struct ath9k_channel *chan, | ||
267 | int freq_offset) | ||
268 | { | ||
269 | int spur_freq_sd = 0; | ||
270 | int spur_subchannel_sd = 0; | ||
271 | int spur_delta_phase = 0; | ||
272 | |||
273 | if (IS_CHAN_HT40(chan)) { | ||
274 | if (freq_offset < 0) { | ||
275 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, | ||
276 | AR_PHY_GC_DYN2040_PRI_CH) == 0x0) | ||
277 | spur_subchannel_sd = 1; | ||
278 | else | ||
279 | spur_subchannel_sd = 0; | ||
280 | |||
281 | spur_freq_sd = ((freq_offset + 10) << 9) / 11; | ||
282 | |||
283 | } else { | ||
284 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, | ||
285 | AR_PHY_GC_DYN2040_PRI_CH) == 0x0) | ||
286 | spur_subchannel_sd = 0; | ||
287 | else | ||
288 | spur_subchannel_sd = 1; | ||
289 | |||
290 | spur_freq_sd = ((freq_offset - 10) << 9) / 11; | ||
291 | |||
292 | } | ||
293 | |||
294 | spur_delta_phase = (freq_offset << 17) / 5; | ||
295 | |||
296 | } else { | ||
297 | spur_subchannel_sd = 0; | ||
298 | spur_freq_sd = (freq_offset << 9) /11; | ||
299 | spur_delta_phase = (freq_offset << 18) / 5; | ||
300 | } | ||
301 | |||
302 | spur_freq_sd = spur_freq_sd & 0x3ff; | ||
303 | spur_delta_phase = spur_delta_phase & 0xfffff; | ||
304 | |||
305 | ar9003_hw_spur_ofdm(ah, | ||
306 | freq_offset, | ||
307 | spur_freq_sd, | ||
308 | spur_delta_phase, | ||
309 | spur_subchannel_sd); | ||
310 | } | ||
311 | |||
312 | /* Spur mitigation for OFDM */ | ||
313 | static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah, | ||
314 | struct ath9k_channel *chan) | ||
315 | { | ||
316 | int synth_freq; | ||
317 | int range = 10; | ||
318 | int freq_offset = 0; | ||
319 | int mode; | ||
320 | u8* spurChansPtr; | ||
321 | unsigned int i; | ||
322 | struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; | ||
323 | |||
324 | if (IS_CHAN_5GHZ(chan)) { | ||
325 | spurChansPtr = &(eep->modalHeader5G.spurChans[0]); | ||
326 | mode = 0; | ||
327 | } | ||
328 | else { | ||
329 | spurChansPtr = &(eep->modalHeader2G.spurChans[0]); | ||
330 | mode = 1; | ||
331 | } | ||
332 | |||
333 | if (spurChansPtr[0] == 0) | ||
334 | return; /* No spur in the mode */ | ||
335 | |||
336 | if (IS_CHAN_HT40(chan)) { | ||
337 | range = 19; | ||
338 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, | ||
339 | AR_PHY_GC_DYN2040_PRI_CH) == 0x0) | ||
340 | synth_freq = chan->channel - 10; | ||
341 | else | ||
342 | synth_freq = chan->channel + 10; | ||
343 | } else { | ||
344 | range = 10; | ||
345 | synth_freq = chan->channel; | ||
346 | } | ||
347 | |||
348 | ar9003_hw_spur_ofdm_clear(ah); | ||
349 | |||
350 | for (i = 0; spurChansPtr[i] && i < 5; i++) { | ||
351 | freq_offset = FBIN2FREQ(spurChansPtr[i], mode) - synth_freq; | ||
352 | if (abs(freq_offset) < range) { | ||
353 | ar9003_hw_spur_ofdm_work(ah, chan, freq_offset); | ||
354 | break; | ||
355 | } | ||
356 | } | ||
357 | } | ||
358 | |||
359 | static void ar9003_hw_spur_mitigate(struct ath_hw *ah, | ||
360 | struct ath9k_channel *chan) | ||
361 | { | ||
362 | ar9003_hw_spur_mitigate_mrc_cck(ah, chan); | ||
363 | ar9003_hw_spur_mitigate_ofdm(ah, chan); | ||
364 | } | ||
365 | |||
160 | static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah, | 366 | static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah, |
161 | struct ath9k_channel *chan) | 367 | struct ath9k_channel *chan) |
162 | { | 368 | { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h index 4e1177dc24ac..f08cc8bda005 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h | |||
@@ -33,6 +33,30 @@ | |||
33 | #define AR_PHY_RX_IQCAL_CORR_B0 (AR_CHAN_BASE + 0xdc) | 33 | #define AR_PHY_RX_IQCAL_CORR_B0 (AR_CHAN_BASE + 0xdc) |
34 | #define AR_PHY_TX_IQCAL_CONTROL_3 (AR_CHAN_BASE + 0xb0) | 34 | #define AR_PHY_TX_IQCAL_CONTROL_3 (AR_CHAN_BASE + 0xb0) |
35 | 35 | ||
36 | #define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000 | ||
37 | #define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20 | ||
38 | |||
39 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE 0x000FFFFF | ||
40 | #define AR_PHY_TIMING11_SPUR_DELTA_PHASE_S 0 | ||
41 | |||
42 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC 0x40000000 | ||
43 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC_S 30 | ||
44 | |||
45 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR 0x80000000 | ||
46 | #define AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR_S 31 | ||
47 | |||
48 | #define AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT 0x4000000 | ||
49 | #define AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT_S 26 | ||
50 | |||
51 | #define AR_PHY_SPUR_REG_ENABLE_MASK_PPM 0x20000 /* bins move with freq offset */ | ||
52 | #define AR_PHY_SPUR_REG_ENABLE_MASK_PPM_S 17 | ||
53 | #define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH 0x000000FF | ||
54 | #define AR_PHY_SPUR_REG_SPUR_RSSI_THRESH_S 0 | ||
55 | #define AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI 0x00000100 | ||
56 | #define AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI_S 8 | ||
57 | #define AR_PHY_SPUR_REG_MASK_RATE_CNTL 0x03FC0000 | ||
58 | #define AR_PHY_SPUR_REG_MASK_RATE_CNTL_S 18 | ||
59 | |||
36 | #define AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN 0x20000000 | 60 | #define AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN 0x20000000 |
37 | #define AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN_S 29 | 61 | #define AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN_S 29 |
38 | 62 | ||
@@ -84,6 +108,17 @@ | |||
84 | #define AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX 0xF000 | 108 | #define AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX 0xF000 |
85 | #define AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX_S 12 | 109 | #define AR_PHY_TIMING4_IQCAL_LOG_COUNT_MAX_S 12 |
86 | #define AR_PHY_TIMING4_DO_CAL 0x10000 | 110 | #define AR_PHY_TIMING4_DO_CAL 0x10000 |
111 | |||
112 | #define AR_PHY_TIMING4_ENABLE_PILOT_MASK 0x10000000 | ||
113 | #define AR_PHY_TIMING4_ENABLE_PILOT_MASK_S 28 | ||
114 | #define AR_PHY_TIMING4_ENABLE_CHAN_MASK 0x20000000 | ||
115 | #define AR_PHY_TIMING4_ENABLE_CHAN_MASK_S 29 | ||
116 | |||
117 | #define AR_PHY_TIMING4_ENABLE_SPUR_FILTER 0x40000000 | ||
118 | #define AR_PHY_TIMING4_ENABLE_SPUR_FILTER_S 30 | ||
119 | #define AR_PHY_TIMING4_ENABLE_SPUR_RSSI 0x80000000 | ||
120 | #define AR_PHY_TIMING4_ENABLE_SPUR_RSSI_S 31 | ||
121 | |||
87 | #define AR_PHY_NEW_ADC_GAIN_CORR_ENABLE 0x40000000 | 122 | #define AR_PHY_NEW_ADC_GAIN_CORR_ENABLE 0x40000000 |
88 | #define AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE 0x80000000 | 123 | #define AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE 0x80000000 |
89 | #define AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW 0x00000001 | 124 | #define AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW 0x00000001 |
@@ -107,6 +142,8 @@ | |||
107 | #define AR_PHY_SFCORR_EXT_M1_THRESH_LOW_S 14 | 142 | #define AR_PHY_SFCORR_EXT_M1_THRESH_LOW_S 14 |
108 | #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW 0x0FE00000 | 143 | #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW 0x0FE00000 |
109 | #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW_S 21 | 144 | #define AR_PHY_SFCORR_EXT_M2_THRESH_LOW_S 21 |
145 | #define AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD 0x10000000 | ||
146 | #define AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD_S 28 | ||
110 | #define AR_PHY_SFCORR_SPUR_SUBCHNL_SD_S 28 | 147 | #define AR_PHY_SFCORR_SPUR_SUBCHNL_SD_S 28 |
111 | #define AR_PHY_EXT_CCA_THRESH62 0x007F0000 | 148 | #define AR_PHY_EXT_CCA_THRESH62 0x007F0000 |
112 | #define AR_PHY_EXT_CCA_THRESH62_S 16 | 149 | #define AR_PHY_EXT_CCA_THRESH62_S 16 |
@@ -184,6 +221,16 @@ | |||
184 | #define AR_PHY_ML_CNTL_2 (AR_MRC_BASE + 0x1c) | 221 | #define AR_PHY_ML_CNTL_2 (AR_MRC_BASE + 0x1c) |
185 | #define AR_PHY_TST_ADC (AR_MRC_BASE + 0x20) | 222 | #define AR_PHY_TST_ADC (AR_MRC_BASE + 0x20) |
186 | 223 | ||
224 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A 0x00000FE0 | ||
225 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_S 5 | ||
226 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A 0x1F | ||
227 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A_S 0 | ||
228 | |||
229 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A 0x00000FE0 | ||
230 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_S 5 | ||
231 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A 0x1F | ||
232 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A_S 0 | ||
233 | |||
187 | /* | 234 | /* |
188 | * MRC Feild Definitions | 235 | * MRC Feild Definitions |
189 | */ | 236 | */ |
@@ -372,6 +419,11 @@ | |||
372 | #define AR_PHY_ADDAC_PARA_CTL (AR_SM_BASE + 0x150) | 419 | #define AR_PHY_ADDAC_PARA_CTL (AR_SM_BASE + 0x150) |
373 | #define AR_PHY_XPA_CFG (AR_SM_BASE + 0x158) | 420 | #define AR_PHY_XPA_CFG (AR_SM_BASE + 0x158) |
374 | 421 | ||
422 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A 0x0001FC00 | ||
423 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A_S 10 | ||
424 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A 0x3FF | ||
425 | #define AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A_S 0 | ||
426 | |||
375 | #define AR_PHY_TEST (AR_SM_BASE + 0x160) | 427 | #define AR_PHY_TEST (AR_SM_BASE + 0x160) |
376 | 428 | ||
377 | #define AR_PHY_TEST_BBB_OBS_SEL 0x780000 | 429 | #define AR_PHY_TEST_BBB_OBS_SEL 0x780000 |
@@ -499,6 +551,7 @@ | |||
499 | #define AR_PHY_GC_DYN2040_EN 0x00000004 /* enable dyn 20/40 mode */ | 551 | #define AR_PHY_GC_DYN2040_EN 0x00000004 /* enable dyn 20/40 mode */ |
500 | #define AR_PHY_GC_DYN2040_PRI_ONLY 0x00000008 /* dyn 20/40 - primary only */ | 552 | #define AR_PHY_GC_DYN2040_PRI_ONLY 0x00000008 /* dyn 20/40 - primary only */ |
501 | #define AR_PHY_GC_DYN2040_PRI_CH 0x00000010 /* dyn 20/40 - primary ch offset (0=+10MHz, 1=-10MHz)*/ | 553 | #define AR_PHY_GC_DYN2040_PRI_CH 0x00000010 /* dyn 20/40 - primary ch offset (0=+10MHz, 1=-10MHz)*/ |
554 | #define AR_PHY_GC_DYN2040_PRI_CH_S 4 | ||
502 | #define AR_PHY_GC_DYN2040_EXT_CH 0x00000020 /* dyn 20/40 - ext ch spacing (0=20MHz/ 1=25MHz) */ | 555 | #define AR_PHY_GC_DYN2040_EXT_CH 0x00000020 /* dyn 20/40 - ext ch spacing (0=20MHz/ 1=25MHz) */ |
503 | #define AR_PHY_GC_HT_EN 0x00000040 /* ht enable */ | 556 | #define AR_PHY_GC_HT_EN 0x00000040 /* ht enable */ |
504 | #define AR_PHY_GC_SHORT_GI_40 0x00000080 /* allow short GI for HT 40 */ | 557 | #define AR_PHY_GC_SHORT_GI_40 0x00000080 /* allow short GI for HT 40 */ |
@@ -516,6 +569,7 @@ | |||
516 | #define AR_PHY_MODE_OFDM 0x00000000 | 569 | #define AR_PHY_MODE_OFDM 0x00000000 |
517 | #define AR_PHY_MODE_CCK 0x00000001 | 570 | #define AR_PHY_MODE_CCK 0x00000001 |
518 | #define AR_PHY_MODE_DYNAMIC 0x00000004 | 571 | #define AR_PHY_MODE_DYNAMIC 0x00000004 |
572 | #define AR_PHY_MODE_DYNAMIC_S 2 | ||
519 | #define AR_PHY_MODE_HALF 0x00000020 | 573 | #define AR_PHY_MODE_HALF 0x00000020 |
520 | #define AR_PHY_MODE_QUARTER 0x00000040 | 574 | #define AR_PHY_MODE_QUARTER 0x00000040 |
521 | #define AR_PHY_MAC_CLK_MODE 0x00000080 | 575 | #define AR_PHY_MAC_CLK_MODE 0x00000080 |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index d1b9940b2ae5..25713beb8e71 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -76,6 +76,8 @@ | |||
76 | #define REG_RMW_FIELD(_a, _r, _f, _v) \ | 76 | #define REG_RMW_FIELD(_a, _r, _f, _v) \ |
77 | REG_WRITE(_a, _r, \ | 77 | REG_WRITE(_a, _r, \ |
78 | (REG_READ(_a, _r) & ~_f) | (((_v) << _f##_S) & _f)) | 78 | (REG_READ(_a, _r) & ~_f) | (((_v) << _f##_S) & _f)) |
79 | #define REG_READ_FIELD(_a, _r, _f) \ | ||
80 | (((REG_READ(_a, _r) & _f) >> _f##_S)) | ||
79 | #define REG_SET_BIT(_a, _r, _f) \ | 81 | #define REG_SET_BIT(_a, _r, _f) \ |
80 | REG_WRITE(_a, _r, REG_READ(_a, _r) | _f) | 82 | REG_WRITE(_a, _r, REG_READ(_a, _r) | _f) |
81 | #define REG_CLR_BIT(_a, _r, _f) \ | 83 | #define REG_CLR_BIT(_a, _r, _f) \ |
diff --git a/drivers/net/wireless/ath/ath9k/phy.h b/drivers/net/wireless/ath/ath9k/phy.h index 7d397fd7bd18..e724c2c1ae2a 100644 --- a/drivers/net/wireless/ath/ath9k/phy.h +++ b/drivers/net/wireless/ath/ath9k/phy.h | |||
@@ -59,4 +59,7 @@ | |||
59 | (_bank)[i] = INI_RA((_iniarray), i, _col);; \ | 59 | (_bank)[i] = INI_RA((_iniarray), i, _col);; \ |
60 | } while (0) | 60 | } while (0) |
61 | 61 | ||
62 | #define AR_PHY_TIMING11_SPUR_FREQ_SD 0x3FF00000 | ||
63 | #define AR_PHY_TIMING11_SPUR_FREQ_SD_S 20 | ||
64 | |||
62 | #endif | 65 | #endif |