Lines Matching refs:ah_gain
426 ah->ah_gain.g_step_idx = rfgain_opt_5111.go_default; in ath5k_hw_rfgain_opt_init()
427 ah->ah_gain.g_low = 20; in ath5k_hw_rfgain_opt_init()
428 ah->ah_gain.g_high = 35; in ath5k_hw_rfgain_opt_init()
429 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE; in ath5k_hw_rfgain_opt_init()
432 ah->ah_gain.g_step_idx = rfgain_opt_5112.go_default; in ath5k_hw_rfgain_opt_init()
433 ah->ah_gain.g_low = 20; in ath5k_hw_rfgain_opt_init()
434 ah->ah_gain.g_high = 85; in ath5k_hw_rfgain_opt_init()
435 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE; in ath5k_hw_rfgain_opt_init()
463 if (ah->ah_gain.g_state != AR5K_RFGAIN_ACTIVE) in ath5k_hw_request_rfgain_probe()
472 ah->ah_gain.g_state = AR5K_RFGAIN_READ_REQUESTED; in ath5k_hw_request_rfgain_probe()
500 g_step = &go->go_step[ah->ah_gain.g_step_idx]; in ath5k_hw_rf_gainf_corr()
505 ah->ah_gain.g_f_corr = 0; in ath5k_hw_rf_gainf_corr()
519 ah->ah_gain.g_f_corr = step * 2; in ath5k_hw_rf_gainf_corr()
522 ah->ah_gain.g_f_corr = (step - 5) * 2; in ath5k_hw_rf_gainf_corr()
525 ah->ah_gain.g_f_corr = step; in ath5k_hw_rf_gainf_corr()
528 ah->ah_gain.g_f_corr = 0; in ath5k_hw_rf_gainf_corr()
532 return ah->ah_gain.g_f_corr; in ath5k_hw_rf_gainf_corr()
568 ah->ah_gain.g_high = level[3] - in ath5k_hw_rf_check_gainf_readback()
570 ah->ah_gain.g_low = level[0] + in ath5k_hw_rf_check_gainf_readback()
586 ah->ah_gain.g_high = 55; in ath5k_hw_rf_check_gainf_readback()
590 return (ah->ah_gain.g_current >= level[0] && in ath5k_hw_rf_check_gainf_readback()
591 ah->ah_gain.g_current <= level[1]) || in ath5k_hw_rf_check_gainf_readback()
592 (ah->ah_gain.g_current >= level[2] && in ath5k_hw_rf_check_gainf_readback()
593 ah->ah_gain.g_current <= level[3]); in ath5k_hw_rf_check_gainf_readback()
621 g_step = &go->go_step[ah->ah_gain.g_step_idx]; in ath5k_hw_rf_gainf_adjust()
623 if (ah->ah_gain.g_current >= ah->ah_gain.g_high) { in ath5k_hw_rf_gainf_adjust()
626 if (ah->ah_gain.g_step_idx == 0) in ath5k_hw_rf_gainf_adjust()
629 for (ah->ah_gain.g_target = ah->ah_gain.g_current; in ath5k_hw_rf_gainf_adjust()
630 ah->ah_gain.g_target >= ah->ah_gain.g_high && in ath5k_hw_rf_gainf_adjust()
631 ah->ah_gain.g_step_idx > 0; in ath5k_hw_rf_gainf_adjust()
632 g_step = &go->go_step[ah->ah_gain.g_step_idx]) in ath5k_hw_rf_gainf_adjust()
633 ah->ah_gain.g_target -= 2 * in ath5k_hw_rf_gainf_adjust()
634 (go->go_step[--(ah->ah_gain.g_step_idx)].gos_gain - in ath5k_hw_rf_gainf_adjust()
641 if (ah->ah_gain.g_current <= ah->ah_gain.g_low) { in ath5k_hw_rf_gainf_adjust()
644 if (ah->ah_gain.g_step_idx == (go->go_steps_count - 1)) in ath5k_hw_rf_gainf_adjust()
647 for (ah->ah_gain.g_target = ah->ah_gain.g_current; in ath5k_hw_rf_gainf_adjust()
648 ah->ah_gain.g_target <= ah->ah_gain.g_low && in ath5k_hw_rf_gainf_adjust()
649 ah->ah_gain.g_step_idx < go->go_steps_count - 1; in ath5k_hw_rf_gainf_adjust()
650 g_step = &go->go_step[ah->ah_gain.g_step_idx]) in ath5k_hw_rf_gainf_adjust()
651 ah->ah_gain.g_target -= 2 * in ath5k_hw_rf_gainf_adjust()
652 (go->go_step[++ah->ah_gain.g_step_idx].gos_gain - in ath5k_hw_rf_gainf_adjust()
662 ret, ah->ah_gain.g_step_idx, ah->ah_gain.g_current, in ath5k_hw_rf_gainf_adjust()
663 ah->ah_gain.g_target); in ath5k_hw_rf_gainf_adjust()
685 ah->ah_gain.g_state == AR5K_RFGAIN_INACTIVE) in ath5k_hw_gainf_calibrate()
690 if (ah->ah_gain.g_state != AR5K_RFGAIN_READ_REQUESTED) in ath5k_hw_gainf_calibrate()
699 ah->ah_gain.g_current = data >> AR5K_PHY_PAPD_PROBE_GAINF_S; in ath5k_hw_gainf_calibrate()
706 ah->ah_gain.g_current += in ath5k_hw_gainf_calibrate()
709 ah->ah_gain.g_current += in ath5k_hw_gainf_calibrate()
717 ah->ah_gain.g_current = in ath5k_hw_gainf_calibrate()
718 ah->ah_gain.g_current >= ah->ah_gain.g_f_corr ? in ath5k_hw_gainf_calibrate()
719 (ah->ah_gain.g_current - ah->ah_gain.g_f_corr) : in ath5k_hw_gainf_calibrate()
727 AR5K_GAIN_CHECK_ADJUST(&ah->ah_gain) && in ath5k_hw_gainf_calibrate()
729 ah->ah_gain.g_state = AR5K_RFGAIN_NEED_CHANGE; in ath5k_hw_gainf_calibrate()
731 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE; in ath5k_hw_gainf_calibrate()
736 return ah->ah_gain.g_state; in ath5k_hw_gainf_calibrate()
965 g_step = &go->go_step[ah->ah_gain.g_step_idx]; in ath5k_hw_rfregs_init()
993 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE; in ath5k_hw_rfregs_init()
1058 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE; in ath5k_hw_rfregs_init()