Lines Matching +full:noise +full:- +full:sensitive

8  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
33 * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved.
87 * but then determines that they are either noise, or transmissions
88 * from a distant wireless network (also "noise", really) that get
92 * high that our DSP gets too busy trying to lock onto non-network
93 * activity/noise. */
107 /* "false_alarms" values below are cross-multiplications to assess the in il4965_sens_energy_cck()
110 * (some should be expected if rx is sensitive enough) in a in il4965_sens_energy_cck()
113 * MIN_FA/fixed-time < false_alarms/actual-rx-time < MAX_FA/beacon-time in il4965_sens_energy_cck()
120 const struct il_sensitivity_ranges *ranges = il->hw_params.sens; in il4965_sens_energy_cck()
122 data = &(il->sensitivity_data); in il4965_sens_energy_cck()
124 data->nrg_auto_corr_silence_diff = 0; in il4965_sens_energy_cck()
127 * This is background noise, which may include transmissions from other in il4965_sens_energy_cck()
130 (u8) ((rx_info->beacon_silence_rssi_a & ALL_BAND_FILTER) >> 8); in il4965_sens_energy_cck()
132 (u8) ((rx_info->beacon_silence_rssi_b & ALL_BAND_FILTER) >> 8); in il4965_sens_energy_cck()
134 (u8) ((rx_info->beacon_silence_rssi_c & ALL_BAND_FILTER) >> 8); in il4965_sens_energy_cck()
139 /* Store silence rssi in 20-beacon history table */ in il4965_sens_energy_cck()
140 data->nrg_silence_rssi[data->nrg_silence_idx] = max_silence_rssi; in il4965_sens_energy_cck()
141 data->nrg_silence_idx++; in il4965_sens_energy_cck()
142 if (data->nrg_silence_idx >= NRG_NUM_PREV_STAT_L) in il4965_sens_energy_cck()
143 data->nrg_silence_idx = 0; in il4965_sens_energy_cck()
147 val = data->nrg_silence_rssi[i]; in il4965_sens_energy_cck()
150 D_CALIB("silence a %u, b %u, c %u, 20-bcn max %u\n", silence_rssi_a, in il4965_sens_energy_cck()
155 * Save it in 10-beacon history table. */ in il4965_sens_energy_cck()
156 i = data->nrg_energy_idx; in il4965_sens_energy_cck()
157 val = min(rx_info->beacon_energy_b, rx_info->beacon_energy_c); in il4965_sens_energy_cck()
158 data->nrg_value[i] = min(rx_info->beacon_energy_a, val); in il4965_sens_energy_cck()
160 data->nrg_energy_idx++; in il4965_sens_energy_cck()
161 if (data->nrg_energy_idx >= 10) in il4965_sens_energy_cck()
162 data->nrg_energy_idx = 0; in il4965_sens_energy_cck()
168 max_nrg_cck = data->nrg_value[0]; in il4965_sens_energy_cck()
170 max_nrg_cck = (u32) max(max_nrg_cck, (data->nrg_value[i])); in il4965_sens_energy_cck()
173 D_CALIB("rx energy a %u, b %u, c %u, 10-bcn max/min %u\n", in il4965_sens_energy_cck()
174 rx_info->beacon_energy_a, rx_info->beacon_energy_b, in il4965_sens_energy_cck()
175 rx_info->beacon_energy_c, max_nrg_cck - 6); in il4965_sens_energy_cck()
177 /* Count number of consecutive beacons with fewer-than-desired in il4965_sens_energy_cck()
180 data->num_in_cck_no_fa++; in il4965_sens_energy_cck()
182 data->num_in_cck_no_fa = 0; in il4965_sens_energy_cck()
184 data->num_in_cck_no_fa); in il4965_sens_energy_cck()
188 data->auto_corr_cck > AUTO_CORR_MAX_TH_CCK) { in il4965_sens_energy_cck()
192 data->nrg_curr_state = IL_FA_TOO_MANY; in il4965_sens_energy_cck()
194 data->nrg_silence_ref = silence_ref; in il4965_sens_energy_cck()
198 data->nrg_th_cck = data->nrg_th_cck - NRG_STEP_CCK; in il4965_sens_energy_cck()
201 data->nrg_curr_state = IL_FA_TOO_FEW; in il4965_sens_energy_cck()
205 data->nrg_auto_corr_silence_diff = in il4965_sens_energy_cck()
206 (s32) data->nrg_silence_ref - (s32) silence_ref; in il4965_sens_energy_cck()
210 data->nrg_auto_corr_silence_diff); in il4965_sens_energy_cck()
218 if (data->nrg_prev_state != IL_FA_TOO_MANY && in il4965_sens_energy_cck()
219 (data->nrg_auto_corr_silence_diff > NRG_DIFF || in il4965_sens_energy_cck()
220 data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA)) { in il4965_sens_energy_cck()
224 val = data->nrg_th_cck + NRG_STEP_CCK; in il4965_sens_energy_cck()
225 data->nrg_th_cck = min((u32) ranges->min_nrg_cck, val); in il4965_sens_energy_cck()
233 data->nrg_curr_state = IL_FA_GOOD_RANGE; in il4965_sens_energy_cck()
236 data->nrg_silence_ref = silence_ref; in il4965_sens_energy_cck()
241 if (IL_FA_TOO_MANY == data->nrg_prev_state) { in il4965_sens_energy_cck()
243 if (data->nrg_th_cck > (max_nrg_cck + NRG_MARGIN)) in il4965_sens_energy_cck()
244 data->nrg_th_cck -= NRG_MARGIN; in il4965_sens_energy_cck()
246 data->nrg_th_cck = max_nrg_cck; in il4965_sens_energy_cck()
255 data->nrg_th_cck = max(max_nrg_cck, data->nrg_th_cck); in il4965_sens_energy_cck()
256 D_CALIB("new nrg_th_cck %u\n", data->nrg_th_cck); in il4965_sens_energy_cck()
258 data->nrg_prev_state = data->nrg_curr_state; in il4965_sens_energy_cck()
260 /* Auto-correlation CCK algorithm */ in il4965_sens_energy_cck()
264 * so the DSP won't be disturbed by the noise in il4965_sens_energy_cck()
266 if (data->auto_corr_cck < AUTO_CORR_MAX_TH_CCK) in il4965_sens_energy_cck()
267 data->auto_corr_cck = AUTO_CORR_MAX_TH_CCK + 1; in il4965_sens_energy_cck()
269 val = data->auto_corr_cck + AUTO_CORR_STEP_CCK; in il4965_sens_energy_cck()
270 data->auto_corr_cck = in il4965_sens_energy_cck()
271 min((u32) ranges->auto_corr_max_cck, val); in il4965_sens_energy_cck()
273 val = data->auto_corr_cck_mrc + AUTO_CORR_STEP_CCK; in il4965_sens_energy_cck()
274 data->auto_corr_cck_mrc = in il4965_sens_energy_cck()
275 min((u32) ranges->auto_corr_max_cck_mrc, val); in il4965_sens_energy_cck()
277 (data->nrg_auto_corr_silence_diff > NRG_DIFF || in il4965_sens_energy_cck()
278 data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA)) { in il4965_sens_energy_cck()
281 val = data->auto_corr_cck - AUTO_CORR_STEP_CCK; in il4965_sens_energy_cck()
282 data->auto_corr_cck = max((u32) ranges->auto_corr_min_cck, val); in il4965_sens_energy_cck()
283 val = data->auto_corr_cck_mrc - AUTO_CORR_STEP_CCK; in il4965_sens_energy_cck()
284 data->auto_corr_cck_mrc = in il4965_sens_energy_cck()
285 max((u32) ranges->auto_corr_min_cck_mrc, val); in il4965_sens_energy_cck()
299 const struct il_sensitivity_ranges *ranges = il->hw_params.sens; in il4965_sens_auto_corr_ofdm()
301 data = &(il->sensitivity_data); in il4965_sens_auto_corr_ofdm()
309 val = data->auto_corr_ofdm + AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
310 data->auto_corr_ofdm = in il4965_sens_auto_corr_ofdm()
311 min((u32) ranges->auto_corr_max_ofdm, val); in il4965_sens_auto_corr_ofdm()
313 val = data->auto_corr_ofdm_mrc + AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
314 data->auto_corr_ofdm_mrc = in il4965_sens_auto_corr_ofdm()
315 min((u32) ranges->auto_corr_max_ofdm_mrc, val); in il4965_sens_auto_corr_ofdm()
317 val = data->auto_corr_ofdm_x1 + AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
318 data->auto_corr_ofdm_x1 = in il4965_sens_auto_corr_ofdm()
319 min((u32) ranges->auto_corr_max_ofdm_x1, val); in il4965_sens_auto_corr_ofdm()
321 val = data->auto_corr_ofdm_mrc_x1 + AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
322 data->auto_corr_ofdm_mrc_x1 = in il4965_sens_auto_corr_ofdm()
323 min((u32) ranges->auto_corr_max_ofdm_mrc_x1, val); in il4965_sens_auto_corr_ofdm()
332 val = data->auto_corr_ofdm - AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
333 data->auto_corr_ofdm = in il4965_sens_auto_corr_ofdm()
334 max((u32) ranges->auto_corr_min_ofdm, val); in il4965_sens_auto_corr_ofdm()
336 val = data->auto_corr_ofdm_mrc - AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
337 data->auto_corr_ofdm_mrc = in il4965_sens_auto_corr_ofdm()
338 max((u32) ranges->auto_corr_min_ofdm_mrc, val); in il4965_sens_auto_corr_ofdm()
340 val = data->auto_corr_ofdm_x1 - AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
341 data->auto_corr_ofdm_x1 = in il4965_sens_auto_corr_ofdm()
342 max((u32) ranges->auto_corr_min_ofdm_x1, val); in il4965_sens_auto_corr_ofdm()
344 val = data->auto_corr_ofdm_mrc_x1 - AUTO_CORR_STEP_OFDM; in il4965_sens_auto_corr_ofdm()
345 data->auto_corr_ofdm_mrc_x1 = in il4965_sens_auto_corr_ofdm()
346 max((u32) ranges->auto_corr_min_ofdm_mrc_x1, val); in il4965_sens_auto_corr_ofdm()
360 cpu_to_le16((u16) data->auto_corr_ofdm); in il4965_prepare_legacy_sensitivity_tbl()
362 cpu_to_le16((u16) data->auto_corr_ofdm_mrc); in il4965_prepare_legacy_sensitivity_tbl()
364 cpu_to_le16((u16) data->auto_corr_ofdm_x1); in il4965_prepare_legacy_sensitivity_tbl()
366 cpu_to_le16((u16) data->auto_corr_ofdm_mrc_x1); in il4965_prepare_legacy_sensitivity_tbl()
369 cpu_to_le16((u16) data->auto_corr_cck); in il4965_prepare_legacy_sensitivity_tbl()
371 cpu_to_le16((u16) data->auto_corr_cck_mrc); in il4965_prepare_legacy_sensitivity_tbl()
373 tbl[HD_MIN_ENERGY_CCK_DET_IDX] = cpu_to_le16((u16) data->nrg_th_cck); in il4965_prepare_legacy_sensitivity_tbl()
374 tbl[HD_MIN_ENERGY_OFDM_DET_IDX] = cpu_to_le16((u16) data->nrg_th_ofdm); in il4965_prepare_legacy_sensitivity_tbl()
377 cpu_to_le16(data->barker_corr_th_min); in il4965_prepare_legacy_sensitivity_tbl()
379 cpu_to_le16(data->barker_corr_th_min_mrc); in il4965_prepare_legacy_sensitivity_tbl()
380 tbl[HD_OFDM_ENERGY_TH_IN_IDX] = cpu_to_le16(data->nrg_th_cca); in il4965_prepare_legacy_sensitivity_tbl()
383 data->auto_corr_ofdm, data->auto_corr_ofdm_mrc, in il4965_prepare_legacy_sensitivity_tbl()
384 data->auto_corr_ofdm_x1, data->auto_corr_ofdm_mrc_x1, in il4965_prepare_legacy_sensitivity_tbl()
385 data->nrg_th_ofdm); in il4965_prepare_legacy_sensitivity_tbl()
387 D_CALIB("cck: ac %u mrc %u thresh %u\n", data->auto_corr_cck, in il4965_prepare_legacy_sensitivity_tbl()
388 data->auto_corr_cck_mrc, data->nrg_th_cck); in il4965_prepare_legacy_sensitivity_tbl()
404 data = &(il->sensitivity_data); in il4965_sensitivity_write()
415 (&cmd.table[0], &(il->sensitivity_tbl[0]), in il4965_sensitivity_write()
422 memcpy(&(il->sensitivity_tbl[0]), &(cmd.table[0]), in il4965_sensitivity_write()
434 const struct il_sensitivity_ranges *ranges = il->hw_params.sens; in il4965_init_sensitivity()
436 if (il->disable_sens_cal) in il4965_init_sensitivity()
442 data = &(il->sensitivity_data); in il4965_init_sensitivity()
449 data->num_in_cck_no_fa = 0; in il4965_init_sensitivity()
450 data->nrg_curr_state = IL_FA_TOO_MANY; in il4965_init_sensitivity()
451 data->nrg_prev_state = IL_FA_TOO_MANY; in il4965_init_sensitivity()
452 data->nrg_silence_ref = 0; in il4965_init_sensitivity()
453 data->nrg_silence_idx = 0; in il4965_init_sensitivity()
454 data->nrg_energy_idx = 0; in il4965_init_sensitivity()
457 data->nrg_value[i] = 0; in il4965_init_sensitivity()
460 data->nrg_silence_rssi[i] = 0; in il4965_init_sensitivity()
462 data->auto_corr_ofdm = ranges->auto_corr_min_ofdm; in il4965_init_sensitivity()
463 data->auto_corr_ofdm_mrc = ranges->auto_corr_min_ofdm_mrc; in il4965_init_sensitivity()
464 data->auto_corr_ofdm_x1 = ranges->auto_corr_min_ofdm_x1; in il4965_init_sensitivity()
465 data->auto_corr_ofdm_mrc_x1 = ranges->auto_corr_min_ofdm_mrc_x1; in il4965_init_sensitivity()
466 data->auto_corr_cck = AUTO_CORR_CCK_MIN_VAL_DEF; in il4965_init_sensitivity()
467 data->auto_corr_cck_mrc = ranges->auto_corr_min_cck_mrc; in il4965_init_sensitivity()
468 data->nrg_th_cck = ranges->nrg_th_cck; in il4965_init_sensitivity()
469 data->nrg_th_ofdm = ranges->nrg_th_ofdm; in il4965_init_sensitivity()
470 data->barker_corr_th_min = ranges->barker_corr_th_min; in il4965_init_sensitivity()
471 data->barker_corr_th_min_mrc = ranges->barker_corr_th_min_mrc; in il4965_init_sensitivity()
472 data->nrg_th_cca = ranges->nrg_th_cca; in il4965_init_sensitivity()
474 data->last_bad_plcp_cnt_ofdm = 0; in il4965_init_sensitivity()
475 data->last_fa_cnt_ofdm = 0; in il4965_init_sensitivity()
476 data->last_bad_plcp_cnt_cck = 0; in il4965_init_sensitivity()
477 data->last_fa_cnt_cck = 0; in il4965_init_sensitivity()
499 if (il->disable_sens_cal) in il4965_sensitivity_calibration()
502 data = &(il->sensitivity_data); in il4965_sensitivity_calibration()
505 D_CALIB("<< - not associated\n"); in il4965_sensitivity_calibration()
509 spin_lock_irqsave(&il->lock, flags); in il4965_sensitivity_calibration()
511 rx_info = &(((struct il_notif_stats *)resp)->rx.general); in il4965_sensitivity_calibration()
512 ofdm = &(((struct il_notif_stats *)resp)->rx.ofdm); in il4965_sensitivity_calibration()
513 cck = &(((struct il_notif_stats *)resp)->rx.cck); in il4965_sensitivity_calibration()
515 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { in il4965_sensitivity_calibration()
517 spin_unlock_irqrestore(&il->lock, flags); in il4965_sensitivity_calibration()
522 rx_enable_time = le32_to_cpu(rx_info->channel_load); in il4965_sensitivity_calibration()
523 fa_cck = le32_to_cpu(cck->false_alarm_cnt); in il4965_sensitivity_calibration()
524 fa_ofdm = le32_to_cpu(ofdm->false_alarm_cnt); in il4965_sensitivity_calibration()
525 bad_plcp_cck = le32_to_cpu(cck->plcp_err); in il4965_sensitivity_calibration()
526 bad_plcp_ofdm = le32_to_cpu(ofdm->plcp_err); in il4965_sensitivity_calibration()
529 le32_to_cpu(rx_info->beacon_silence_rssi_a); in il4965_sensitivity_calibration()
531 le32_to_cpu(rx_info->beacon_silence_rssi_b); in il4965_sensitivity_calibration()
533 le32_to_cpu(rx_info->beacon_silence_rssi_c); in il4965_sensitivity_calibration()
534 statis.beacon_energy_a = le32_to_cpu(rx_info->beacon_energy_a); in il4965_sensitivity_calibration()
535 statis.beacon_energy_b = le32_to_cpu(rx_info->beacon_energy_b); in il4965_sensitivity_calibration()
536 statis.beacon_energy_c = le32_to_cpu(rx_info->beacon_energy_c); in il4965_sensitivity_calibration()
538 spin_unlock_irqrestore(&il->lock, flags); in il4965_sensitivity_calibration()
550 if (data->last_bad_plcp_cnt_cck > bad_plcp_cck) in il4965_sensitivity_calibration()
551 data->last_bad_plcp_cnt_cck = bad_plcp_cck; in il4965_sensitivity_calibration()
553 bad_plcp_cck -= data->last_bad_plcp_cnt_cck; in il4965_sensitivity_calibration()
554 data->last_bad_plcp_cnt_cck += bad_plcp_cck; in il4965_sensitivity_calibration()
557 if (data->last_bad_plcp_cnt_ofdm > bad_plcp_ofdm) in il4965_sensitivity_calibration()
558 data->last_bad_plcp_cnt_ofdm = bad_plcp_ofdm; in il4965_sensitivity_calibration()
560 bad_plcp_ofdm -= data->last_bad_plcp_cnt_ofdm; in il4965_sensitivity_calibration()
561 data->last_bad_plcp_cnt_ofdm += bad_plcp_ofdm; in il4965_sensitivity_calibration()
564 if (data->last_fa_cnt_ofdm > fa_ofdm) in il4965_sensitivity_calibration()
565 data->last_fa_cnt_ofdm = fa_ofdm; in il4965_sensitivity_calibration()
567 fa_ofdm -= data->last_fa_cnt_ofdm; in il4965_sensitivity_calibration()
568 data->last_fa_cnt_ofdm += fa_ofdm; in il4965_sensitivity_calibration()
571 if (data->last_fa_cnt_cck > fa_cck) in il4965_sensitivity_calibration()
572 data->last_fa_cnt_cck = fa_cck; in il4965_sensitivity_calibration()
574 fa_cck -= data->last_fa_cnt_cck; in il4965_sensitivity_calibration()
575 data->last_fa_cnt_cck += fa_cck; in il4965_sensitivity_calibration()
617 data->chain_signal_a / in il4965_find_disconn_antenna()
618 il->cfg->chain_noise_num_beacons; in il4965_find_disconn_antenna()
620 data->chain_signal_b / in il4965_find_disconn_antenna()
621 il->cfg->chain_noise_num_beacons; in il4965_find_disconn_antenna()
623 data->chain_signal_c / in il4965_find_disconn_antenna()
624 il->cfg->chain_noise_num_beacons; in il4965_find_disconn_antenna()
650 s32 rssi_delta = (max_average_sig - average_sig[i]); in il4965_find_disconn_antenna()
655 data->disconn_array[i] = 1; in il4965_find_disconn_antenna()
660 data->disconn_array[i]); in il4965_find_disconn_antenna()
674 active_chains &= il->hw_params.valid_rx_ant; in il4965_find_disconn_antenna()
679 * il->hw_setting.valid_tx_ant */ in il4965_find_disconn_antenna()
681 if (!(il->hw_params.valid_tx_ant & ant_msk)) in il4965_find_disconn_antenna()
685 if (data->disconn_array[i] == 0) in il4965_find_disconn_antenna()
688 if (num_tx_chains == il->hw_params.tx_chains_num && in il4965_find_disconn_antenna()
689 data->disconn_array[i]) { in il4965_find_disconn_antenna()
695 il4965_find_first_chain(il->cfg->valid_tx_ant); in il4965_find_disconn_antenna()
696 data->disconn_array[first_chain] = 0; in il4965_find_disconn_antenna()
699 "- declare %d as connected\n", first_chain); in il4965_find_disconn_antenna()
704 if (active_chains != il->hw_params.valid_rx_ant && in il4965_find_disconn_antenna()
705 active_chains != il->chain_noise_data.active_chains) in il4965_find_disconn_antenna()
708 il->hw_params.valid_rx_ant); in il4965_find_disconn_antenna()
711 data->active_chains = active_chains; in il4965_find_disconn_antenna()
721 struct il_chain_noise_data *data = &il->chain_noise_data; in il4965_gain_computation()
723 data->delta_gain_code[min_average_noise_antenna_i] = 0; in il4965_gain_computation()
728 if (!data->disconn_array[i] && in il4965_gain_computation()
729 data->delta_gain_code[i] == in il4965_gain_computation()
731 delta_g = average_noise[i] - min_average_noise; in il4965_gain_computation()
732 data->delta_gain_code[i] = (u8) ((delta_g * 10) / 15); in il4965_gain_computation()
733 data->delta_gain_code[i] = in il4965_gain_computation()
734 min(data->delta_gain_code[i], in il4965_gain_computation()
737 data->delta_gain_code[i] = in il4965_gain_computation()
738 (data->delta_gain_code[i] | (1 << 2)); in il4965_gain_computation()
740 data->delta_gain_code[i] = 0; in il4965_gain_computation()
743 D_CALIB("delta_gain_codes: a %d b %d c %d\n", data->delta_gain_code[0], in il4965_gain_computation()
744 data->delta_gain_code[1], data->delta_gain_code[2]); in il4965_gain_computation()
747 if (!data->radio_write) { in il4965_gain_computation()
749 data->radio_write = 1; in il4965_gain_computation()
753 cmd.diff_gain_a = data->delta_gain_code[0]; in il4965_gain_computation()
754 cmd.diff_gain_b = data->delta_gain_code[1]; in il4965_gain_computation()
755 cmd.diff_gain_c = data->delta_gain_code[2]; in il4965_gain_computation()
764 data->state = IL_CHAIN_NOISE_CALIBRATED; in il4965_gain_computation()
769 * Accumulate 16 beacons of signal and noise stats for each of
770 * 3 receivers/antennas/rx-chains, then figure out:
797 if (il->disable_chain_noise_cal) in il4965_chain_noise_calibration()
800 data = &(il->chain_noise_data); in il4965_chain_noise_calibration()
806 if (data->state != IL_CHAIN_NOISE_ACCUMULATE) { in il4965_chain_noise_calibration()
807 if (data->state == IL_CHAIN_NOISE_ALIVE) in il4965_chain_noise_calibration()
808 D_CALIB("Wait for noise calib reset\n"); in il4965_chain_noise_calibration()
812 spin_lock_irqsave(&il->lock, flags); in il4965_chain_noise_calibration()
814 rx_info = &(((struct il_notif_stats *)stat_resp)->rx.general); in il4965_chain_noise_calibration()
816 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { in il4965_chain_noise_calibration()
818 spin_unlock_irqrestore(&il->lock, flags); in il4965_chain_noise_calibration()
822 rxon_band24 = !!(il->staging.flags & RXON_FLG_BAND_24G_MSK); in il4965_chain_noise_calibration()
823 rxon_chnum = le16_to_cpu(il->staging.channel); in il4965_chain_noise_calibration()
826 !!(((struct il_notif_stats *)stat_resp)-> in il4965_chain_noise_calibration()
829 le32_to_cpu(((struct il_notif_stats *)stat_resp)->flag) >> 16; in il4965_chain_noise_calibration()
836 spin_unlock_irqrestore(&il->lock, flags); in il4965_chain_noise_calibration()
845 le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER; in il4965_chain_noise_calibration()
847 le32_to_cpu(rx_info->beacon_silence_rssi_b) & IN_BAND_FILTER; in il4965_chain_noise_calibration()
849 le32_to_cpu(rx_info->beacon_silence_rssi_c) & IN_BAND_FILTER; in il4965_chain_noise_calibration()
851 chain_sig_a = le32_to_cpu(rx_info->beacon_rssi_a) & IN_BAND_FILTER; in il4965_chain_noise_calibration()
852 chain_sig_b = le32_to_cpu(rx_info->beacon_rssi_b) & IN_BAND_FILTER; in il4965_chain_noise_calibration()
853 chain_sig_c = le32_to_cpu(rx_info->beacon_rssi_c) & IN_BAND_FILTER; in il4965_chain_noise_calibration()
855 spin_unlock_irqrestore(&il->lock, flags); in il4965_chain_noise_calibration()
857 data->beacon_count++; in il4965_chain_noise_calibration()
859 data->chain_noise_a = (chain_noise_a + data->chain_noise_a); in il4965_chain_noise_calibration()
860 data->chain_noise_b = (chain_noise_b + data->chain_noise_b); in il4965_chain_noise_calibration()
861 data->chain_noise_c = (chain_noise_c + data->chain_noise_c); in il4965_chain_noise_calibration()
863 data->chain_signal_a = (chain_sig_a + data->chain_signal_a); in il4965_chain_noise_calibration()
864 data->chain_signal_b = (chain_sig_b + data->chain_signal_b); in il4965_chain_noise_calibration()
865 data->chain_signal_c = (chain_sig_c + data->chain_signal_c); in il4965_chain_noise_calibration()
868 data->beacon_count); in il4965_chain_noise_calibration()
876 * 2) Differential gain (using silence noise) to balance receivers */ in il4965_chain_noise_calibration()
877 if (data->beacon_count != il->cfg->chain_noise_num_beacons) in il4965_chain_noise_calibration()
883 /* Analyze noise for rx balance */ in il4965_chain_noise_calibration()
885 data->chain_noise_a / il->cfg->chain_noise_num_beacons; in il4965_chain_noise_calibration()
887 data->chain_noise_b / il->cfg->chain_noise_num_beacons; in il4965_chain_noise_calibration()
889 data->chain_noise_c / il->cfg->chain_noise_num_beacons; in il4965_chain_noise_calibration()
892 if (!data->disconn_array[i] && in il4965_chain_noise_calibration()
895 * lower noise values so far: */ in il4965_chain_noise_calibration()
909 il4965_find_first_chain(il->cfg->valid_rx_ant)); in il4965_chain_noise_calibration()
914 if (il->ops->update_chain_flags) in il4965_chain_noise_calibration()
915 il->ops->update_chain_flags(il); in il4965_chain_noise_calibration()
917 data->state = IL_CHAIN_NOISE_DONE; in il4965_chain_noise_calibration()
925 memset(&(il->sensitivity_data), 0, sizeof(struct il_sensitivity_data)); in il4965_reset_run_time_calib()
926 memset(&(il->chain_noise_data), 0, sizeof(struct il_chain_noise_data)); in il4965_reset_run_time_calib()
928 il->chain_noise_data.delta_gain_code[i] = in il4965_reset_run_time_calib()