Lines Matching refs:as

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,
232 if (as->noise_imm_level < ATH5K_ANI_MAX_NOISE_IMM_LVL) {
233 ath5k_ani_set_noise_immunity_level(ah, as->noise_imm_level + 1);
239 as->spur_level < ah->ani_state.max_spur_level) {
240 ath5k_ani_set_spur_immunity_level(ah, as->spur_level + 1);
246 if (as->firstep_level < ATH5K_ANI_MAX_FIRSTEP_LVL)
247 ath5k_ani_set_firstep_level(ah, as->firstep_level + 1);
262 if (ofdm_trigger && as->ofdm_weak_sig) {
267 /* as a last resort or CCK: raise firstep level */
268 if (as->firstep_level < ATH5K_ANI_MAX_FIRSTEP_LVL) {
269 ath5k_ani_set_firstep_level(ah, as->firstep_level + 1);
277 if (ofdm_trigger && !as->ofdm_weak_sig)
279 if (as->firstep_level < ATH5K_ANI_MAX_FIRSTEP_LVL)
280 ath5k_ani_set_firstep_level(ah, as->firstep_level + 1);
287 if (ofdm_trigger && as->ofdm_weak_sig)
289 if (as->firstep_level > 0)
295 if (as->cck_weak_sig == true) {
304 * @as: The &struct ath5k_ani_state
310 ath5k_ani_lower_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as)
318 if (as->firstep_level > 0) {
319 ath5k_ani_set_firstep_level(ah, as->firstep_level - 1);
331 if (!as->ofdm_weak_sig) {
336 if (as->firstep_level > 0) {
338 as->firstep_level - 1);
343 if (as->firstep_level > 0) {
345 as->firstep_level - 1);
352 if (as->spur_level > 0) {
353 ath5k_ani_set_spur_immunity_level(ah, as->spur_level - 1);
358 if (as->noise_imm_level > 0) {
359 ath5k_ani_set_noise_immunity_level(ah, as->noise_imm_level - 1);
367 * @as: The &struct ath5k_ani_state
374 ath5k_hw_ani_get_listen_time(struct ath5k_hw *ah, struct ath5k_ani_state *as)
382 memcpy(&as->last_cc, &common->cc_ani, sizeof(as->last_cc));
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)
433 as->ofdm_errors += ofdm_err;
434 as->sum_ofdm_errors += ofdm_err;
437 as->cck_errors += cck_err;
438 as->sum_cck_errors += cck_err;
445 * @as: The &struct ath5k_ani_state
450 ath5k_ani_period_restart(struct ath5k_ani_state *as)
453 as->last_ofdm_errors = as->ofdm_errors;
454 as->last_cck_errors = as->cck_errors;
455 as->last_listen = as->listen_time;
457 as->ofdm_errors = 0;
458 as->cck_errors = 0;
459 as->listen_time = 0;
477 struct ath5k_ani_state *as = &ah->ani_state;
483 listen = ath5k_hw_ani_get_listen_time(ah, as);
484 as->listen_time += listen;
486 if (as->ani_mode != ATH5K_ANI_MODE_AUTO)
489 ath5k_ani_save_and_clear_phy_errors(ah, as);
491 ofdm_high = as->listen_time * ATH5K_ANI_OFDM_TRIG_HIGH / 1000;
492 cck_high = as->listen_time * ATH5K_ANI_CCK_TRIG_HIGH / 1000;
493 ofdm_low = as->listen_time * ATH5K_ANI_OFDM_TRIG_LOW / 1000;
494 cck_low = as->listen_time * ATH5K_ANI_CCK_TRIG_LOW / 1000;
497 "listen %d (now %d)", as->listen_time, listen);
500 as->ofdm_errors, ofdm_high, as->cck_errors, cck_high);
502 if (as->ofdm_errors > ofdm_high || as->cck_errors > cck_high) {
504 bool ofdm_flag = as->ofdm_errors > ofdm_high;
505 ath5k_ani_raise_immunity(ah, as, ofdm_flag);
506 ath5k_ani_period_restart(as);
508 } else if (as->listen_time > 5 * ATH5K_ANI_LISTEN_PERIOD) {
513 as->ofdm_errors, ofdm_low, as->cck_errors, cck_low);
515 if (as->ofdm_errors <= ofdm_low && as->cck_errors <= cck_low)
516 ath5k_ani_lower_immunity(ah, as);
518 ath5k_ani_period_restart(as);
541 struct ath5k_ani_state *as = &ah->ani_state;
558 if (ath5k_ani_save_and_clear_phy_errors(ah, as) == 0)
561 if (as->ofdm_errors > ATH5K_ANI_OFDM_TRIG_HIGH ||
562 as->cck_errors > ATH5K_ANI_CCK_TRIG_HIGH)
579 struct ath5k_ani_state *as = &ah->ani_state;
582 as->ofdm_errors++;
583 if (as->ofdm_errors > ATH5K_ANI_OFDM_TRIG_HIGH)
586 as->cck_errors++;
587 if (as->cck_errors > ATH5K_ANI_CCK_TRIG_HIGH)