Lines Matching full:as
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
29 * or reducing sensitivity as necessary.
51 * Also we regularly check the amount of errors and lower or raise immunity as
215 * @as: The &struct ath5k_ani_state
223 ath5k_ani_raise_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as, in ath5k_ani_raise_immunity() argument
232 if (as->noise_imm_level < ATH5K_ANI_MAX_NOISE_IMM_LVL) { in ath5k_ani_raise_immunity()
233 ath5k_ani_set_noise_immunity_level(ah, as->noise_imm_level + 1); in ath5k_ani_raise_immunity()
239 as->spur_level < ah->ani_state.max_spur_level) { in ath5k_ani_raise_immunity()
240 ath5k_ani_set_spur_immunity_level(ah, as->spur_level + 1); in ath5k_ani_raise_immunity()
246 if (as->firstep_level < ATH5K_ANI_MAX_FIRSTEP_LVL) in ath5k_ani_raise_immunity()
247 ath5k_ani_set_firstep_level(ah, as->firstep_level + 1); in ath5k_ani_raise_immunity()
262 if (ofdm_trigger && as->ofdm_weak_sig) { in ath5k_ani_raise_immunity()
267 /* as a last resort or CCK: raise firstep level */ in ath5k_ani_raise_immunity()
268 if (as->firstep_level < ATH5K_ANI_MAX_FIRSTEP_LVL) { in ath5k_ani_raise_immunity()
269 ath5k_ani_set_firstep_level(ah, as->firstep_level + 1); in ath5k_ani_raise_immunity()
277 if (ofdm_trigger && !as->ofdm_weak_sig) in ath5k_ani_raise_immunity()
279 if (as->firstep_level < ATH5K_ANI_MAX_FIRSTEP_LVL) in ath5k_ani_raise_immunity()
280 ath5k_ani_set_firstep_level(ah, as->firstep_level + 1); in ath5k_ani_raise_immunity()
287 if (ofdm_trigger && as->ofdm_weak_sig) in ath5k_ani_raise_immunity()
289 if (as->firstep_level > 0) in ath5k_ani_raise_immunity()
295 if (as->cck_weak_sig == true) { in ath5k_ani_raise_immunity()
304 * @as: The &struct ath5k_ani_state
310 ath5k_ani_lower_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as) in ath5k_ani_lower_immunity() argument
318 if (as->firstep_level > 0) { in ath5k_ani_lower_immunity()
319 ath5k_ani_set_firstep_level(ah, as->firstep_level - 1); in ath5k_ani_lower_immunity()
331 if (!as->ofdm_weak_sig) { in ath5k_ani_lower_immunity()
336 if (as->firstep_level > 0) { in ath5k_ani_lower_immunity()
338 as->firstep_level - 1); in ath5k_ani_lower_immunity()
343 if (as->firstep_level > 0) { in ath5k_ani_lower_immunity()
345 as->firstep_level - 1); in ath5k_ani_lower_immunity()
352 if (as->spur_level > 0) { in ath5k_ani_lower_immunity()
353 ath5k_ani_set_spur_immunity_level(ah, as->spur_level - 1); in ath5k_ani_lower_immunity()
358 if (as->noise_imm_level > 0) { in ath5k_ani_lower_immunity()
359 ath5k_ani_set_noise_immunity_level(ah, as->noise_imm_level - 1); in ath5k_ani_lower_immunity()
367 * @as: The &struct ath5k_ani_state
374 ath5k_hw_ani_get_listen_time(struct ath5k_hw *ah, struct ath5k_ani_state *as) in ath5k_hw_ani_get_listen_time() argument
382 memcpy(&as->last_cc, &common->cc_ani, sizeof(as->last_cc)); in ath5k_hw_ani_get_listen_time()
395 * @as: The &struct ath5k_ani_state
397 * Clear the PHY error counters as soon as possible, since this might be called
407 struct ath5k_ani_state *as) in ath5k_ani_save_and_clear_phy_errors() argument
433 as->ofdm_errors += ofdm_err; in ath5k_ani_save_and_clear_phy_errors()
434 as->sum_ofdm_errors += ofdm_err; in ath5k_ani_save_and_clear_phy_errors()
437 as->cck_errors += cck_err; in ath5k_ani_save_and_clear_phy_errors()
438 as->sum_cck_errors += cck_err; in ath5k_ani_save_and_clear_phy_errors()
445 * @as: The &struct ath5k_ani_state
450 ath5k_ani_period_restart(struct ath5k_ani_state *as) in ath5k_ani_period_restart() argument
453 as->last_ofdm_errors = as->ofdm_errors; in ath5k_ani_period_restart()
454 as->last_cck_errors = as->cck_errors; in ath5k_ani_period_restart()
455 as->last_listen = as->listen_time; in ath5k_ani_period_restart()
457 as->ofdm_errors = 0; in ath5k_ani_period_restart()
458 as->cck_errors = 0; in ath5k_ani_period_restart()
459 as->listen_time = 0; in ath5k_ani_period_restart()
477 struct ath5k_ani_state *as = &ah->ani_state; in ath5k_ani_calibration() local
483 listen = ath5k_hw_ani_get_listen_time(ah, as); in ath5k_ani_calibration()
484 as->listen_time += listen; in ath5k_ani_calibration()
486 if (as->ani_mode != ATH5K_ANI_MODE_AUTO) in ath5k_ani_calibration()
489 ath5k_ani_save_and_clear_phy_errors(ah, as); in ath5k_ani_calibration()
491 ofdm_high = as->listen_time * ATH5K_ANI_OFDM_TRIG_HIGH / 1000; in ath5k_ani_calibration()
492 cck_high = as->listen_time * ATH5K_ANI_CCK_TRIG_HIGH / 1000; in ath5k_ani_calibration()
493 ofdm_low = as->listen_time * ATH5K_ANI_OFDM_TRIG_LOW / 1000; in ath5k_ani_calibration()
494 cck_low = as->listen_time * ATH5K_ANI_CCK_TRIG_LOW / 1000; in ath5k_ani_calibration()
497 "listen %d (now %d)", as->listen_time, listen); in ath5k_ani_calibration()
500 as->ofdm_errors, ofdm_high, as->cck_errors, cck_high); in ath5k_ani_calibration()
502 if (as->ofdm_errors > ofdm_high || as->cck_errors > cck_high) { in ath5k_ani_calibration()
504 bool ofdm_flag = as->ofdm_errors > ofdm_high; in ath5k_ani_calibration()
505 ath5k_ani_raise_immunity(ah, as, ofdm_flag); in ath5k_ani_calibration()
506 ath5k_ani_period_restart(as); in ath5k_ani_calibration()
508 } else if (as->listen_time > 5 * ATH5K_ANI_LISTEN_PERIOD) { in ath5k_ani_calibration()
513 as->ofdm_errors, ofdm_low, as->cck_errors, cck_low); in ath5k_ani_calibration()
515 if (as->ofdm_errors <= ofdm_low && as->cck_errors <= cck_low) in ath5k_ani_calibration()
516 ath5k_ani_lower_immunity(ah, as); in ath5k_ani_calibration()
518 ath5k_ani_period_restart(as); in ath5k_ani_calibration()
541 struct ath5k_ani_state *as = &ah->ani_state; in ath5k_ani_mib_intr() local
558 if (ath5k_ani_save_and_clear_phy_errors(ah, as) == 0) in ath5k_ani_mib_intr()
561 if (as->ofdm_errors > ATH5K_ANI_OFDM_TRIG_HIGH || in ath5k_ani_mib_intr()
562 as->cck_errors > ATH5K_ANI_CCK_TRIG_HIGH) in ath5k_ani_mib_intr()
579 struct ath5k_ani_state *as = &ah->ani_state; in ath5k_ani_phy_error_report() local
582 as->ofdm_errors++; in ath5k_ani_phy_error_report()
583 if (as->ofdm_errors > ATH5K_ANI_OFDM_TRIG_HIGH) in ath5k_ani_phy_error_report()
586 as->cck_errors++; in ath5k_ani_phy_error_report()
587 if (as->cck_errors > ATH5K_ANI_CCK_TRIG_HIGH) in ath5k_ani_phy_error_report()