Lines Matching refs:ah_gain
141 /* Initialize ah_gain durring attach */
147 ah->ah_gain.g_step_idx = rfgain_opt_5111.go_default;
148 ah->ah_gain.g_low = 20;
149 ah->ah_gain.g_high = 35;
150 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
153 ah->ah_gain.g_step_idx = rfgain_opt_5112.go_default;
154 ah->ah_gain.g_low = 20;
155 ah->ah_gain.g_high = 85;
156 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
170 if (ah->ah_gain.g_state != AR5K_RFGAIN_ACTIVE)
179 ah->ah_gain.g_state = AR5K_RFGAIN_READ_REQUESTED;
202 g_step = &go->go_step[ah->ah_gain.g_step_idx];
208 ah->ah_gain.g_f_corr = 0;
222 ah->ah_gain.g_f_corr = step * 2;
225 ah->ah_gain.g_f_corr = (step - 5) * 2;
228 ah->ah_gain.g_f_corr = step;
231 ah->ah_gain.g_f_corr = 0;
235 return ah->ah_gain.g_f_corr;
266 ah->ah_gain.g_high = level[3] -
268 ah->ah_gain.g_low = level[0] +
284 ah->ah_gain.g_high = 55;
288 return (ah->ah_gain.g_current >= level[0] &&
289 ah->ah_gain.g_current <= level[1]) ||
290 (ah->ah_gain.g_current >= level[2] &&
291 ah->ah_gain.g_current <= level[3]);
313 g_step = &go->go_step[ah->ah_gain.g_step_idx];
315 if (ah->ah_gain.g_current >= ah->ah_gain.g_high) {
318 if (ah->ah_gain.g_step_idx == 0)
321 for (ah->ah_gain.g_target = ah->ah_gain.g_current;
322 ah->ah_gain.g_target >= ah->ah_gain.g_high &&
323 ah->ah_gain.g_step_idx > 0;
324 g_step = &go->go_step[ah->ah_gain.g_step_idx])
325 ah->ah_gain.g_target -= 2 *
326 (go->go_step[--(ah->ah_gain.g_step_idx)].gos_gain -
333 if (ah->ah_gain.g_current <= ah->ah_gain.g_low) {
336 if (ah->ah_gain.g_step_idx == (go->go_steps_count - 1))
339 for (ah->ah_gain.g_target = ah->ah_gain.g_current;
340 ah->ah_gain.g_target <= ah->ah_gain.g_low &&
341 ah->ah_gain.g_step_idx < go->go_steps_count-1;
342 g_step = &go->go_step[ah->ah_gain.g_step_idx])
343 ah->ah_gain.g_target -= 2 *
344 (go->go_step[++ah->ah_gain.g_step_idx].gos_gain -
354 ret, ah->ah_gain.g_step_idx, ah->ah_gain.g_current,
355 ah->ah_gain.g_target);
372 ah->ah_gain.g_state == AR5K_RFGAIN_INACTIVE)
377 if (ah->ah_gain.g_state != AR5K_RFGAIN_READ_REQUESTED)
386 ah->ah_gain.g_current = data >> AR5K_PHY_PAPD_PROBE_GAINF_S;
393 ah->ah_gain.g_current +=
396 ah->ah_gain.g_current +=
404 ah->ah_gain.g_current =
405 ah->ah_gain.g_current >= ah->ah_gain.g_f_corr ?
406 (ah->ah_gain.g_current-ah->ah_gain.g_f_corr) :
414 AR5K_GAIN_CHECK_ADJUST(&ah->ah_gain) &&
416 ah->ah_gain.g_state = AR5K_RFGAIN_NEED_CHANGE;
418 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
423 return ah->ah_gain.g_state;
643 g_step = &go->go_step[ah->ah_gain.g_step_idx];
666 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
715 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;