aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c29
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.h1
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 7ebc3465f22d..ff007f500feb 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -140,7 +140,8 @@ static void ath9k_ani_restart(struct ath_hw *ah)
140} 140}
141 141
142/* Adjust the OFDM Noise Immunity Level */ 142/* Adjust the OFDM Noise Immunity Level */
143static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel) 143static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel,
144 bool scan)
144{ 145{
145 struct ar5416AniState *aniState = &ah->curchan->ani; 146 struct ar5416AniState *aniState = &ah->curchan->ani;
146 struct ath_common *common = ath9k_hw_common(ah); 147 struct ath_common *common = ath9k_hw_common(ah);
@@ -153,7 +154,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
153 immunityLevel, BEACON_RSSI(ah), 154 immunityLevel, BEACON_RSSI(ah),
154 aniState->rssiThrLow, aniState->rssiThrHigh); 155 aniState->rssiThrLow, aniState->rssiThrHigh);
155 156
156 if (aniState->update_ani) 157 if (!scan)
157 aniState->ofdmNoiseImmunityLevel = immunityLevel; 158 aniState->ofdmNoiseImmunityLevel = immunityLevel;
158 159
159 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; 160 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel];
@@ -199,13 +200,14 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hw *ah)
199 aniState = &ah->curchan->ani; 200 aniState = &ah->curchan->ani;
200 201
201 if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL) 202 if (aniState->ofdmNoiseImmunityLevel < ATH9K_ANI_OFDM_MAX_LEVEL)
202 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1); 203 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel + 1, false);
203} 204}
204 205
205/* 206/*
206 * Set the ANI settings to match an CCK level. 207 * Set the ANI settings to match an CCK level.
207 */ 208 */
208static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel) 209static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel,
210 bool scan)
209{ 211{
210 struct ar5416AniState *aniState = &ah->curchan->ani; 212 struct ar5416AniState *aniState = &ah->curchan->ani;
211 struct ath_common *common = ath9k_hw_common(ah); 213 struct ath_common *common = ath9k_hw_common(ah);
@@ -222,7 +224,7 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel)
222 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) 224 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
223 immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; 225 immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI;
224 226
225 if (aniState->update_ani) 227 if (!scan)
226 aniState->cckNoiseImmunityLevel = immunityLevel; 228 aniState->cckNoiseImmunityLevel = immunityLevel;
227 229
228 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel]; 230 entry_ofdm = &ofdm_level_table[aniState->ofdmNoiseImmunityLevel];
@@ -254,7 +256,8 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hw *ah)
254 aniState = &ah->curchan->ani; 256 aniState = &ah->curchan->ani;
255 257
256 if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL) 258 if (aniState->cckNoiseImmunityLevel < ATH9K_ANI_CCK_MAX_LEVEL)
257 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1); 259 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel + 1,
260 false);
258} 261}
259 262
260/* 263/*
@@ -270,13 +273,15 @@ static void ath9k_hw_ani_lower_immunity(struct ath_hw *ah)
270 /* lower OFDM noise immunity */ 273 /* lower OFDM noise immunity */
271 if (aniState->ofdmNoiseImmunityLevel > 0 && 274 if (aniState->ofdmNoiseImmunityLevel > 0 &&
272 (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) { 275 (aniState->ofdmsTurn || aniState->cckNoiseImmunityLevel == 0)) {
273 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel - 1); 276 ath9k_hw_set_ofdm_nil(ah, aniState->ofdmNoiseImmunityLevel - 1,
277 false);
274 return; 278 return;
275 } 279 }
276 280
277 /* lower CCK noise immunity */ 281 /* lower CCK noise immunity */
278 if (aniState->cckNoiseImmunityLevel > 0) 282 if (aniState->cckNoiseImmunityLevel > 0)
279 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel - 1); 283 ath9k_hw_set_cck_nil(ah, aniState->cckNoiseImmunityLevel - 1,
284 false);
280} 285}
281 286
282/* 287/*
@@ -338,7 +343,6 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
338 aniState->ofdmNoiseImmunityLevel, 343 aniState->ofdmNoiseImmunityLevel,
339 aniState->cckNoiseImmunityLevel); 344 aniState->cckNoiseImmunityLevel);
340 345
341 aniState->update_ani = false;
342 ofdm_nil = ATH9K_ANI_OFDM_DEF_LEVEL; 346 ofdm_nil = ATH9K_ANI_OFDM_DEF_LEVEL;
343 cck_nil = ATH9K_ANI_CCK_DEF_LEVEL; 347 cck_nil = ATH9K_ANI_CCK_DEF_LEVEL;
344 } 348 }
@@ -354,11 +358,9 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning)
354 is_scanning, 358 is_scanning,
355 aniState->ofdmNoiseImmunityLevel, 359 aniState->ofdmNoiseImmunityLevel,
356 aniState->cckNoiseImmunityLevel); 360 aniState->cckNoiseImmunityLevel);
357
358 aniState->update_ani = true;
359 } 361 }
360 ath9k_hw_set_ofdm_nil(ah, ofdm_nil); 362 ath9k_hw_set_ofdm_nil(ah, ofdm_nil, is_scanning);
361 ath9k_hw_set_cck_nil(ah, cck_nil); 363 ath9k_hw_set_cck_nil(ah, cck_nil, is_scanning);
362 364
363 /* 365 /*
364 * enable phy counters if hw supports or if not, enable phy 366 * enable phy counters if hw supports or if not, enable phy
@@ -534,7 +536,6 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
534 ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; 536 ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG;
535 ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; 537 ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
536 ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; 538 ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
537 ani->update_ani = false;
538 } 539 }
539 540
540 /* 541 /*
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index e9d841bbe86f..1485bf5e3518 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -114,7 +114,6 @@ struct ar5416AniState {
114 u8 firstepLevel; 114 u8 firstepLevel;
115 u8 ofdmWeakSigDetect; 115 u8 ofdmWeakSigDetect;
116 u8 cckWeakSigThreshold; 116 u8 cckWeakSigThreshold;
117 bool update_ani;
118 u32 listenTime; 117 u32 listenTime;
119 int32_t rssiThrLow; 118 int32_t rssiThrLow;
120 int32_t rssiThrHigh; 119 int32_t rssiThrHigh;