Lines Matching +full:disable +full:- +full:radar +full:- +full:background

32 	if (!spec_priv->rfs_chan_spec_scan)  in ath_debug_send_fft_sample()
35 length = __be16_to_cpu(fft_sample_tlv->length) + in ath_debug_send_fft_sample()
37 relay_write(spec_priv->rfs_chan_spec_scan, fft_sample_tlv, length); in ath_debug_send_fft_sample()
54 if (bytes_read < SPECTRAL_HT20_SAMPLE_LEN - 1) in ath_cmn_max_idx_verify_ht20_fft()
55 return -1; in ath_cmn_max_idx_verify_ht20_fft()
57 mag_info = (struct ath_ht20_mag_info *) (sample_end - in ath_cmn_max_idx_verify_ht20_fft()
60 sample = sample_end - SPECTRAL_HT20_SAMPLE_LEN + 1; in ath_cmn_max_idx_verify_ht20_fft()
62 max_index = spectral_max_index_ht20(mag_info->all_bins); in ath_cmn_max_idx_verify_ht20_fft()
63 max_magnitude = spectral_max_magnitude(mag_info->all_bins); in ath_cmn_max_idx_verify_ht20_fft()
65 max_exp = mag_info->max_exp & 0xf; in ath_cmn_max_idx_verify_ht20_fft()
72 return -1; in ath_cmn_max_idx_verify_ht20_fft()
75 return -1; in ath_cmn_max_idx_verify_ht20_fft()
93 if (bytes_read < SPECTRAL_HT20_40_SAMPLE_LEN - 1) in ath_cmn_max_idx_verify_ht20_40_fft()
94 return -1; in ath_cmn_max_idx_verify_ht20_40_fft()
96 mag_info = (struct ath_ht20_40_mag_info *) (sample_end - in ath_cmn_max_idx_verify_ht20_40_fft()
99 sample = sample_end - SPECTRAL_HT20_40_SAMPLE_LEN + 1; in ath_cmn_max_idx_verify_ht20_40_fft()
101 lower_mag = spectral_max_magnitude(mag_info->lower_bins); in ath_cmn_max_idx_verify_ht20_40_fft()
102 lower_max_index = spectral_max_index_ht40(mag_info->lower_bins); in ath_cmn_max_idx_verify_ht20_40_fft()
104 upper_mag = spectral_max_magnitude(mag_info->upper_bins); in ath_cmn_max_idx_verify_ht20_40_fft()
105 upper_max_index = spectral_max_index_ht40(mag_info->upper_bins); in ath_cmn_max_idx_verify_ht20_40_fft()
107 max_exp = mag_info->max_exp & 0xf; in ath_cmn_max_idx_verify_ht20_40_fft()
115 return -1; in ath_cmn_max_idx_verify_ht20_40_fft()
121 return -1; in ath_cmn_max_idx_verify_ht20_40_fft()
137 struct ath_common *common = ath9k_hw_common(spec_priv->ah); in ath_cmn_process_ht20_fft()
138 struct ath_hw *ah = spec_priv->ah; in ath_cmn_process_ht20_fft()
147 length = sizeof(fft_sample_20) - sizeof(struct fft_sample_tlv); in ath_cmn_process_ht20_fft()
151 fft_sample_20.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]); in ath_cmn_process_ht20_fft()
152 fft_sample_20.noise = ah->noise; in ath_cmn_process_ht20_fft()
157 magnitude = spectral_max_magnitude(mag_info->all_bins); in ath_cmn_process_ht20_fft()
160 max_index = spectral_max_index_ht20(mag_info->all_bins); in ath_cmn_process_ht20_fft()
163 bitmap_w = spectral_bitmap_weight(mag_info->all_bins); in ath_cmn_process_ht20_fft()
166 max_exp = mag_info->max_exp & 0xf; in ath_cmn_process_ht20_fft()
181 ret = -1; in ath_cmn_process_ht20_fft()
188 fft_sample_20.data[dc_pos - 1]) / 2; in ath_cmn_process_ht20_fft()
220 ret = -1; in ath_cmn_process_ht20_fft()
241 struct ath_common *common = ath9k_hw_common(spec_priv->ah); in ath_cmn_process_ht20_40_fft()
242 struct ath_hw *ah = spec_priv->ah; in ath_cmn_process_ht20_40_fft()
243 struct ath9k_hw_cal_data *caldata = ah->caldata; in ath_cmn_process_ht20_40_fft()
256 ext_nf = ath9k_hw_getchan_noise(ah, ah->curchan, in ath_cmn_process_ht20_40_fft()
257 caldata->nfCalHist[3].privNF); in ath_cmn_process_ht20_40_fft()
261 length = sizeof(fft_sample_40) - sizeof(struct fft_sample_tlv); in ath_cmn_process_ht20_40_fft()
268 lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]); in ath_cmn_process_ht20_40_fft()
269 upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ext[0]); in ath_cmn_process_ht20_40_fft()
271 fft_sample_40.lower_noise = ah->noise; in ath_cmn_process_ht20_40_fft()
274 lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ext[0]); in ath_cmn_process_ht20_40_fft()
275 upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]); in ath_cmn_process_ht20_40_fft()
278 fft_sample_40.upper_noise = ah->noise; in ath_cmn_process_ht20_40_fft()
287 lower_mag = spectral_max_magnitude(mag_info->lower_bins); in ath_cmn_process_ht20_40_fft()
290 upper_mag = spectral_max_magnitude(mag_info->upper_bins); in ath_cmn_process_ht20_40_fft()
293 lower_max_index = spectral_max_index_ht40(mag_info->lower_bins); in ath_cmn_process_ht20_40_fft()
296 upper_max_index = spectral_max_index_ht40(mag_info->upper_bins); in ath_cmn_process_ht20_40_fft()
299 lower_bitmap_w = spectral_bitmap_weight(mag_info->lower_bins); in ath_cmn_process_ht20_40_fft()
302 upper_bitmap_w = spectral_bitmap_weight(mag_info->upper_bins); in ath_cmn_process_ht20_40_fft()
305 max_exp = mag_info->max_exp & 0xf; in ath_cmn_process_ht20_40_fft()
328 ret = -1; in ath_cmn_process_ht20_40_fft()
335 fft_sample_40.data[dc_pos - 1]) / 2; in ath_cmn_process_ht20_40_fft()
367 ret = -1; in ath_cmn_process_ht20_40_fft()
397 ret = -1; in ath_cmn_process_ht20_40_fft()
414 switch (sample_bytes - sample_len) { in ath_cmn_copy_fft_frame()
415 case -1: in ath_cmn_copy_fft_frame()
418 sample_len - 1); in ath_cmn_copy_fft_frame()
431 sample_len - 32); in ath_cmn_copy_fft_frame()
440 sample_len - 31); in ath_cmn_copy_fft_frame()
453 struct rchan *rc = spec_priv->rfs_chan_spec_scan; in ath_cmn_is_fft_buf_full()
456 if ((buf = *per_cpu_ptr(rc->buf, i))) { in ath_cmn_is_fft_buf_full()
472 struct ath_hw *ah = spec_priv->ah; in ath_cmn_process_fft()
473 struct ath_common *common = ath9k_hw_common(spec_priv->ah); in ath_cmn_process_fft()
474 struct ath_softc *sc = common->priv; in ath_cmn_process_fft()
477 int len = rs->rs_datalen; in ath_cmn_process_fft()
483 u16 fft_len, sample_len, freq = ah->curchan->chan->center_freq; in ath_cmn_process_fft()
492 if (rs->rs_phyerr != ATH9K_PHYERR_RADAR && in ath_cmn_process_fft()
493 rs->rs_phyerr != ATH9K_PHYERR_FALSE_RADAR_EXT && in ath_cmn_process_fft()
494 rs->rs_phyerr != ATH9K_PHYERR_SPECTRAL) in ath_cmn_process_fft()
500 radar_info = ((struct ath_radar_info *)&vdata[len]) - 1; in ath_cmn_process_fft()
501 if (!(radar_info->pulse_bw_info & SPECTRAL_SCAN_BITMASK)) in ath_cmn_process_fft()
504 if (!spec_priv->rfs_chan_spec_scan) in ath_cmn_process_fft()
517 chan_type = cfg80211_get_chandef_type(&common->hw->conf.chandef); in ath_cmn_process_fft()
533 ath_dbg(common, SPECTRAL_SCAN, "Got radar dump bw_info: 0x%X," in ath_cmn_process_fft()
535 radar_info->pulse_bw_info, in ath_cmn_process_fft()
539 for (i = 0; i < len - 2; i++) { in ath_cmn_process_fft()
549 sample_bytes = len - sizeof(struct ath_radar_info); in ath_cmn_process_fft()
554 * sample_len - 1 and sample_len + 2. exp_max is 3 in ath_cmn_process_fft()
560 if (vdata[i] <= 0x7 && sample_bytes >= sample_len - 1) { in ath_cmn_process_fft()
565 * a) sample_len -> We got the correct length in ath_cmn_process_fft()
566 * b) sample_len + 2 -> 2 bytes added around bin[31] in ath_cmn_process_fft()
567 * c) sample_len - 1 -> The first byte is missing in ath_cmn_process_fft()
568 * d) sample_len + 1 -> b + c at the same time in ath_cmn_process_fft()
587 * Failure is non-fatal, later frames may in ath_cmn_process_fft()
596 /* We expect 1 - 2 more bytes */ in ath_cmn_process_fft()
604 else if ((sample_bytes == sample_len - 1) && in ath_cmn_process_fft()
663 /* -1 to grab sample_len -1, -2 since in ath_cmn_process_fft()
669 i += num_bins - 2; in ath_cmn_process_fft()
670 sample_bytes = num_bins - 2; in ath_cmn_process_fft()
676 i -= num_bins - 2; in ath_cmn_process_fft()
677 if (len - i != sizeof(struct ath_radar_info)) in ath_cmn_process_fft()
680 len - i); in ath_cmn_process_fft()
692 struct ath_spec_scan_priv *spec_priv = file->private_data; in read_file_spec_scan_ctl()
696 switch (spec_priv->spectral_mode) { in read_file_spec_scan_ctl()
698 mode = "disable"; in read_file_spec_scan_ctl()
701 mode = "background"; in read_file_spec_scan_ctl()
717 struct ath_hw *ah = spec_priv->ah; in ath9k_cmn_spectral_scan_trigger()
723 if (!ath9k_hw_ops(ah)->spectral_scan_trigger) { in ath9k_cmn_spectral_scan_trigger()
728 if (!spec_priv->spec_config.enabled) in ath9k_cmn_spectral_scan_trigger()
731 ath_ps_ops(common)->wakeup(common); in ath9k_cmn_spectral_scan_trigger()
742 ath9k_cmn_spectral_scan_config(common, spec_priv, spec_priv->spectral_mode); in ath9k_cmn_spectral_scan_trigger()
743 ath9k_hw_ops(ah)->spectral_scan_trigger(ah); in ath9k_cmn_spectral_scan_trigger()
744 ath_ps_ops(common)->restore(common); in ath9k_cmn_spectral_scan_trigger()
752 struct ath_hw *ah = spec_priv->ah; in ath9k_cmn_spectral_scan_config()
754 if (!ath9k_hw_ops(ah)->spectral_scan_trigger) { in ath9k_cmn_spectral_scan_config()
756 return -1; in ath9k_cmn_spectral_scan_config()
761 spec_priv->spec_config.enabled = 0; in ath9k_cmn_spectral_scan_config()
765 * TODO: is this really useful for "background"? in ath9k_cmn_spectral_scan_config()
767 spec_priv->spec_config.endless = 1; in ath9k_cmn_spectral_scan_config()
768 spec_priv->spec_config.enabled = 1; in ath9k_cmn_spectral_scan_config()
772 spec_priv->spec_config.endless = 0; in ath9k_cmn_spectral_scan_config()
773 spec_priv->spec_config.enabled = 1; in ath9k_cmn_spectral_scan_config()
776 return -1; in ath9k_cmn_spectral_scan_config()
779 ath_ps_ops(common)->wakeup(common); in ath9k_cmn_spectral_scan_config()
780 ath9k_hw_ops(ah)->spectral_scan_config(ah, &spec_priv->spec_config); in ath9k_cmn_spectral_scan_config()
781 ath_ps_ops(common)->restore(common); in ath9k_cmn_spectral_scan_config()
783 spec_priv->spectral_mode = spectral_mode; in ath9k_cmn_spectral_scan_config()
793 struct ath_spec_scan_priv *spec_priv = file->private_data; in write_file_spec_scan_ctl()
794 struct ath_common *common = ath9k_hw_common(spec_priv->ah); in write_file_spec_scan_ctl()
799 return -EOPNOTSUPP; in write_file_spec_scan_ctl()
801 len = min(count, sizeof(buf) - 1); in write_file_spec_scan_ctl()
803 return -EFAULT; in write_file_spec_scan_ctl()
809 } else if (strncmp("background", buf, 10) == 0) { in write_file_spec_scan_ctl()
811 ath_dbg(common, CONFIG, "spectral scan: background mode enabled\n"); in write_file_spec_scan_ctl()
818 } else if (strncmp("disable", buf, 7) == 0) { in write_file_spec_scan_ctl()
822 return -EINVAL; in write_file_spec_scan_ctl()
844 struct ath_spec_scan_priv *spec_priv = file->private_data; in read_file_spectral_short_repeat()
848 len = sprintf(buf, "%d\n", spec_priv->spec_config.short_repeat); in read_file_spectral_short_repeat()
856 struct ath_spec_scan_priv *spec_priv = file->private_data; in write_file_spectral_short_repeat()
865 return -EINVAL; in write_file_spectral_short_repeat()
867 spec_priv->spec_config.short_repeat = val; in write_file_spectral_short_repeat()
887 struct ath_spec_scan_priv *spec_priv = file->private_data; in read_file_spectral_count()
891 len = sprintf(buf, "%d\n", spec_priv->spec_config.count); in read_file_spectral_count()
899 struct ath_spec_scan_priv *spec_priv = file->private_data; in write_file_spectral_count()
907 return -EINVAL; in write_file_spectral_count()
909 spec_priv->spec_config.count = val; in write_file_spectral_count()
929 struct ath_spec_scan_priv *spec_priv = file->private_data; in read_file_spectral_period()
933 len = sprintf(buf, "%d\n", spec_priv->spec_config.period); in read_file_spectral_period()
941 struct ath_spec_scan_priv *spec_priv = file->private_data; in write_file_spectral_period()
950 return -EINVAL; in write_file_spectral_period()
952 spec_priv->spec_config.period = val; in write_file_spectral_period()
972 struct ath_spec_scan_priv *spec_priv = file->private_data; in read_file_spectral_fft_period()
976 len = sprintf(buf, "%d\n", spec_priv->spec_config.fft_period); in read_file_spectral_fft_period()
984 struct ath_spec_scan_priv *spec_priv = file->private_data; in write_file_spectral_fft_period()
993 return -EINVAL; in write_file_spectral_fft_period()
995 spec_priv->spec_config.fft_period = val; in write_file_spectral_fft_period()
1046 if (spec_priv->rfs_chan_spec_scan) { in ath9k_cmn_spectral_deinit_debug()
1047 relay_close(spec_priv->rfs_chan_spec_scan); in ath9k_cmn_spectral_deinit_debug()
1048 spec_priv->rfs_chan_spec_scan = NULL; in ath9k_cmn_spectral_deinit_debug()
1056 spec_priv->rfs_chan_spec_scan = relay_open("spectral_scan", in ath9k_cmn_spectral_init_debug()
1060 if (!spec_priv->rfs_chan_spec_scan) in ath9k_cmn_spectral_init_debug()