|
@@ -102,6 +102,7 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral,
|
|
uint16_t *binptr_16;
|
|
uint16_t *binptr_16;
|
|
uint16_t pwr_16;
|
|
uint16_t pwr_16;
|
|
size_t pwr_count;
|
|
size_t pwr_count;
|
|
|
|
+ uint16_t num_edge_bins;
|
|
uint16_t idx;
|
|
uint16_t idx;
|
|
uint16_t start_bin_index;
|
|
uint16_t start_bin_index;
|
|
|
|
|
|
@@ -127,10 +128,7 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral,
|
|
rb_edge_bins->start_bin_idx =
|
|
rb_edge_bins->start_bin_idx =
|
|
map_det_info->rb_extrabins_start_idx;
|
|
map_det_info->rb_extrabins_start_idx;
|
|
rb_edge_bins->num_bins = map_det_info->rb_extrabins_num;
|
|
rb_edge_bins->num_bins = map_det_info->rb_extrabins_num;
|
|
- if (lb_edge_bins->num_bins)
|
|
|
|
- start_bin_index = lb_edge_bins->start_bin_idx;
|
|
|
|
- else
|
|
|
|
- start_bin_index = detector_info->start_bin_idx;
|
|
|
|
|
|
+ start_bin_index = detector_info->start_bin_idx;
|
|
|
|
|
|
detector_info->rssi = params->rssi;
|
|
detector_info->rssi = params->rssi;
|
|
|
|
|
|
@@ -155,10 +153,9 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral,
|
|
bin_pwr_data = ¶ms->bin_pwr_data
|
|
bin_pwr_data = ¶ms->bin_pwr_data
|
|
[map_det_info->src_start_bin_idx];
|
|
[map_det_info->src_start_bin_idx];
|
|
pwr_count = detector_info->end_bin_idx -
|
|
pwr_count = detector_info->end_bin_idx -
|
|
- detector_info->start_bin_idx +
|
|
|
|
- lb_edge_bins->num_bins +
|
|
|
|
- rb_edge_bins->num_bins + 1;
|
|
|
|
- spec_samp_msg->bin_pwr_count += pwr_count;
|
|
|
|
|
|
+ detector_info->start_bin_idx + 1;
|
|
|
|
+ num_edge_bins = lb_edge_bins->num_bins +
|
|
|
|
+ rb_edge_bins->num_bins;
|
|
/*
|
|
/*
|
|
* To check whether FFT bin values exceed 8 bits, we add a
|
|
* To check whether FFT bin values exceed 8 bits, we add a
|
|
* check before copying values to samp_data->bin_pwr.
|
|
* check before copying values to samp_data->bin_pwr.
|
|
@@ -171,6 +168,19 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral,
|
|
if (swar->fftbin_size_war ==
|
|
if (swar->fftbin_size_war ==
|
|
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE) {
|
|
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE) {
|
|
binptr_32 = (uint32_t *)bin_pwr_data;
|
|
binptr_32 = (uint32_t *)bin_pwr_data;
|
|
|
|
+ if (lb_edge_bins->num_bins > 0) {
|
|
|
|
+ for (idx = 0; idx < lb_edge_bins->num_bins;
|
|
|
|
+ idx++) {
|
|
|
|
+ /* Read only the first 2 bytes of the DWORD */
|
|
|
|
+ pwr_16 = *((uint16_t *)binptr_32++);
|
|
|
|
+ if (qdf_unlikely(pwr_16 >
|
|
|
|
+ MAX_FFTBIN_VALUE))
|
|
|
|
+ pwr_16 = MAX_FFTBIN_VALUE;
|
|
|
|
+ spec_samp_msg->bin_pwr
|
|
|
|
+ [lb_edge_bins->start_bin_idx + idx]
|
|
|
|
+ = pwr_16;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (idx = 0; idx < pwr_count; idx++) {
|
|
for (idx = 0; idx < pwr_count; idx++) {
|
|
/* Read only the first 2 bytes of the DWORD */
|
|
/* Read only the first 2 bytes of the DWORD */
|
|
pwr_16 = *((uint16_t *)binptr_32++);
|
|
pwr_16 = *((uint16_t *)binptr_32++);
|
|
@@ -179,9 +189,34 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral,
|
|
spec_samp_msg->bin_pwr[start_bin_index + idx]
|
|
spec_samp_msg->bin_pwr[start_bin_index + idx]
|
|
= pwr_16;
|
|
= pwr_16;
|
|
}
|
|
}
|
|
|
|
+ if (rb_edge_bins->num_bins > 0) {
|
|
|
|
+ for (idx = 0; idx < rb_edge_bins->num_bins;
|
|
|
|
+ idx++) {
|
|
|
|
+ /* Read only the first 2 bytes of the DWORD */
|
|
|
|
+ pwr_16 = *((uint16_t *)binptr_32++);
|
|
|
|
+ if (qdf_unlikely(pwr_16 >
|
|
|
|
+ MAX_FFTBIN_VALUE))
|
|
|
|
+ pwr_16 = MAX_FFTBIN_VALUE;
|
|
|
|
+ spec_samp_msg->bin_pwr
|
|
|
|
+ [rb_edge_bins->start_bin_idx + idx]
|
|
|
|
+ = pwr_16;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else if (swar->fftbin_size_war ==
|
|
} else if (swar->fftbin_size_war ==
|
|
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
|
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
|
binptr_16 = (uint16_t *)bin_pwr_data;
|
|
binptr_16 = (uint16_t *)bin_pwr_data;
|
|
|
|
+ if (lb_edge_bins->num_bins > 0) {
|
|
|
|
+ for (idx = 0; idx < lb_edge_bins->num_bins;
|
|
|
|
+ idx++) {
|
|
|
|
+ pwr_16 = *(binptr_16++);
|
|
|
|
+ if (qdf_unlikely(pwr_16 >
|
|
|
|
+ MAX_FFTBIN_VALUE))
|
|
|
|
+ pwr_16 = MAX_FFTBIN_VALUE;
|
|
|
|
+ spec_samp_msg->bin_pwr
|
|
|
|
+ [lb_edge_bins->start_bin_idx + idx]
|
|
|
|
+ = pwr_16;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (idx = 0; idx < pwr_count; idx++) {
|
|
for (idx = 0; idx < pwr_count; idx++) {
|
|
pwr_16 = *(binptr_16++);
|
|
pwr_16 = *(binptr_16++);
|
|
if (qdf_unlikely(pwr_16 > MAX_FFTBIN_VALUE))
|
|
if (qdf_unlikely(pwr_16 > MAX_FFTBIN_VALUE))
|
|
@@ -189,10 +224,35 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral,
|
|
spec_samp_msg->bin_pwr[start_bin_index + idx]
|
|
spec_samp_msg->bin_pwr[start_bin_index + idx]
|
|
= pwr_16;
|
|
= pwr_16;
|
|
}
|
|
}
|
|
|
|
+ if (rb_edge_bins->num_bins > 0) {
|
|
|
|
+ for (idx = 0; idx < rb_edge_bins->num_bins;
|
|
|
|
+ idx++) {
|
|
|
|
+ pwr_16 = *(binptr_16++);
|
|
|
|
+ if (qdf_unlikely(pwr_16 >
|
|
|
|
+ MAX_FFTBIN_VALUE))
|
|
|
|
+ pwr_16 = MAX_FFTBIN_VALUE;
|
|
|
|
+ spec_samp_msg->bin_pwr
|
|
|
|
+ [rb_edge_bins->start_bin_idx + idx]
|
|
|
|
+ = pwr_16;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
|
|
+ if (lb_edge_bins->num_bins > 0)
|
|
|
|
+ qdf_mem_copy(&spec_samp_msg->bin_pwr
|
|
|
|
+ [lb_edge_bins->start_bin_idx],
|
|
|
|
+ &bin_pwr_data[0],
|
|
|
|
+ lb_edge_bins->num_bins);
|
|
qdf_mem_copy(&spec_samp_msg->bin_pwr[start_bin_index],
|
|
qdf_mem_copy(&spec_samp_msg->bin_pwr[start_bin_index],
|
|
- bin_pwr_data, pwr_count);
|
|
|
|
|
|
+ &bin_pwr_data[lb_edge_bins->num_bins],
|
|
|
|
+ pwr_count);
|
|
|
|
+ if (rb_edge_bins->num_bins > 0)
|
|
|
|
+ qdf_mem_copy(&spec_samp_msg->bin_pwr
|
|
|
|
+ [rb_edge_bins->start_bin_idx],
|
|
|
|
+ &bin_pwr_data[pwr_count +
|
|
|
|
+ lb_edge_bins->num_bins],
|
|
|
|
+ rb_edge_bins->num_bins);
|
|
}
|
|
}
|
|
|
|
+ spec_samp_msg->bin_pwr_count += (pwr_count + num_edge_bins);
|
|
}
|
|
}
|
|
|
|
|
|
if (det_map->send_to_upper_layers) {
|
|
if (det_map->send_to_upper_layers) {
|