qcacmn: fftbin size WAR for HK V2
For HK V2 each fft bin is 2 bytes due to
some HW limitations. To fix this modify the
fftbin size WAR to convert 2 byte fft bins to 1 byte
and forward to applications via SAMP message.
CRs-Fixed: 2319415
Change-Id: I6c27d6804ddaf91ed9e6695e0b21a81115744fff
Esse commit está contido em:
@@ -2006,13 +2006,20 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
|
||||
target_if_spectral_clear_stats(spectral);
|
||||
|
||||
#ifdef CONFIG_WIN
|
||||
if ((target_type == TARGET_TYPE_QCA8074) ||
|
||||
(target_type == TARGET_TYPE_QCA8074V2)) {
|
||||
spectral->fftbin_size_war = 1;
|
||||
if (target_type == TARGET_TYPE_QCA8074V2)
|
||||
spectral->fftbin_size_war =
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE;
|
||||
else if (target_type == TARGET_TYPE_QCA8074)
|
||||
spectral->fftbin_size_war =
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE;
|
||||
else
|
||||
spectral->fftbin_size_war = SPECTRAL_FFTBIN_SIZE_NO_WAR;
|
||||
|
||||
if (target_type == TARGET_TYPE_QCA8074 ||
|
||||
target_type == TARGET_TYPE_QCA8074V2) {
|
||||
spectral->inband_fftbin_size_adj = 1;
|
||||
spectral->null_fftbin_adj = 1;
|
||||
} else {
|
||||
spectral->fftbin_size_war = 0;
|
||||
spectral->inband_fftbin_size_adj = 0;
|
||||
spectral->null_fftbin_adj = 0;
|
||||
}
|
||||
|
@@ -399,6 +399,22 @@ enum spectral_gen {
|
||||
SPECTRAL_GEN3,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum spectral_fftbin_size_war - spectral fft bin size war
|
||||
* @SPECTRAL_FFTBIN_SIZE_NO_WAR : No WAR applicable for Spectral FFT bin size
|
||||
* @SPECTRAL_FFTBIN_SIZE_2BYTE_TO_1BYTE : Spectral FFT bin size: Retain only
|
||||
* least significant byte from 2 byte
|
||||
* FFT bin transferred by HW
|
||||
* @SPECTRAL_FFTBIN_SIZE_4BYTE_TO_1BYTE : Spectral FFT bin size: Retain only
|
||||
* least significant byte from 4 byte
|
||||
* FFT bin transferred by HW
|
||||
*/
|
||||
enum spectral_fftbin_size_war {
|
||||
SPECTRAL_FFTBIN_SIZE_NO_WAR = 0,
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE = 1,
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE = 2,
|
||||
};
|
||||
|
||||
#if ATH_PERF_PWR_OFFLOAD
|
||||
/**
|
||||
* enum target_if_spectral_info - Enumerations for specifying which spectral
|
||||
@@ -876,7 +892,7 @@ struct target_if_spectral {
|
||||
struct spectral_nl_cb nl_cb;
|
||||
bool use_nl_bcast;
|
||||
int (*send_phy_data)(struct wlan_objmgr_pdev *pdev);
|
||||
u_int8_t fftbin_size_war;
|
||||
enum spectral_fftbin_size_war fftbin_size_war;
|
||||
u_int8_t inband_fftbin_size_adj;
|
||||
u_int8_t null_fftbin_adj;
|
||||
enum spectral_160mhz_report_delivery_state state_160mhz_delivery;
|
||||
|
@@ -44,7 +44,8 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
||||
struct spectral_classifier_params *cp = NULL;
|
||||
struct spectral_classifier_params *pcp = NULL;
|
||||
struct target_if_spectral_ops *p_sops = NULL;
|
||||
uint32_t *binptr = NULL;
|
||||
uint32_t *binptr_32 = NULL;
|
||||
uint16_t *binptr_16 = NULL;
|
||||
int idx = 0;
|
||||
struct spectral_samp_data *samp_data;
|
||||
static int samp_msg_index;
|
||||
@@ -119,10 +120,16 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
||||
qdf_mem_copy(cp, pcp,
|
||||
sizeof(struct spectral_classifier_params));
|
||||
|
||||
if (spectral->fftbin_size_war) {
|
||||
binptr = (uint32_t *)bin_pwr_data;
|
||||
if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE) {
|
||||
binptr_32 = (uint32_t *)bin_pwr_data;
|
||||
for (idx = 0; idx < params->pwr_count; idx++)
|
||||
samp_data->bin_pwr[idx] = *(binptr++);
|
||||
samp_data->bin_pwr[idx] = *(binptr_32++);
|
||||
} else if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
||||
binptr_16 = (uint16_t *)bin_pwr_data;
|
||||
for (idx = 0; idx < params->pwr_count; idx++)
|
||||
samp_data->bin_pwr[idx] = *(binptr_16++);
|
||||
} else {
|
||||
SPECTRAL_MESSAGE_COPY_CHAR_ARRAY(
|
||||
&samp_data->bin_pwr[0], bin_pwr_data,
|
||||
@@ -163,10 +170,16 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
||||
params->pwr_count_sec80;
|
||||
|
||||
bin_pwr_data = params->bin_pwr_data_sec80;
|
||||
if (spectral->fftbin_size_war) {
|
||||
binptr = (uint32_t *)bin_pwr_data;
|
||||
if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE) {
|
||||
binptr_32 = (uint32_t *)bin_pwr_data;
|
||||
for (idx = 0; idx < params->pwr_count_sec80; idx++)
|
||||
samp_data->bin_pwr_sec80[idx] = *(binptr++);
|
||||
samp_data->bin_pwr_sec80[idx] = *(binptr_32++);
|
||||
} else if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
||||
binptr_16 = (uint16_t *)bin_pwr_data;
|
||||
for (idx = 0; idx < params->pwr_count_sec80; idx++)
|
||||
samp_data->bin_pwr_sec80[idx] = *(binptr_16++);
|
||||
} else {
|
||||
SPECTRAL_MESSAGE_COPY_CHAR_ARRAY(
|
||||
&samp_data->bin_pwr_sec80[0],
|
||||
|
@@ -1195,9 +1195,21 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
||||
/* fft_bin_len_adj is intentionally left at 0. */
|
||||
fft_bin_len_to_dump = 0;
|
||||
} else {
|
||||
if (spectral->fftbin_size_war)
|
||||
/*
|
||||
* Divide fft bin length by appropriate factor depending
|
||||
* on the value of fftbin_size_war.
|
||||
*/
|
||||
if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE)
|
||||
fft_bin_len_adj = fft_bin_len >> 2;
|
||||
else
|
||||
else if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
||||
/* Ideally we should be dividing fft bin length by 2.
|
||||
* Due to a HW bug, actual length is two times the
|
||||
* expected length.
|
||||
*/
|
||||
fft_bin_len_adj = fft_bin_len >> 2;
|
||||
} else
|
||||
fft_bin_len_adj = fft_bin_len;
|
||||
|
||||
if ((spectral->params.ss_rpt_mode == 2) &&
|
||||
@@ -1522,12 +1534,20 @@ target_if_consume_spectral_report_gen3(
|
||||
fft_bin_len = (fft_hdr_length - 16);
|
||||
|
||||
/*
|
||||
* Divide fft bin length by 4 if fftbin_size_war is
|
||||
* enabled.
|
||||
* Divide fft bin length by appropriate factor depending
|
||||
* on the value of fftbin_size_war.
|
||||
*/
|
||||
if (spectral->fftbin_size_war)
|
||||
if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE)
|
||||
fft_bin_len >>= 2;
|
||||
|
||||
else if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
||||
/* Ideally we should be dividing fft bin length
|
||||
* by 2. Due to a HW bug, actual length is two
|
||||
* times the expected length.
|
||||
*/
|
||||
fft_bin_len >>= 2;
|
||||
}
|
||||
if ((spectral->params.ss_rpt_mode == 2) &&
|
||||
spectral->inband_fftbin_size_adj) {
|
||||
fft_bin_len >>= 1;
|
||||
@@ -1649,11 +1669,20 @@ target_if_consume_spectral_report_gen3(
|
||||
fft_bin_len = (fft_hdr_length - 16);
|
||||
|
||||
/*
|
||||
* Divide fft bin length by 4 if fftbin_size_war is
|
||||
* enabled.
|
||||
* Divide fft bin length by appropriate factor depending
|
||||
* on the value of fftbin_size_war.
|
||||
*/
|
||||
if (spectral->fftbin_size_war)
|
||||
if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_4BYTE_TO_1BYTE)
|
||||
fft_bin_len >>= 2;
|
||||
else if (spectral->fftbin_size_war ==
|
||||
SPECTRAL_FFTBIN_SIZE_WAR_2BYTE_TO_1BYTE) {
|
||||
/* Ideally we should be dividing fft bin length
|
||||
* by 2. Due to a HW bug, actual length is two
|
||||
* times the expected length.
|
||||
*/
|
||||
fft_bin_len >>= 2;
|
||||
}
|
||||
|
||||
if ((spectral->params.ss_rpt_mode == 2) &&
|
||||
spectral->inband_fftbin_size_adj) {
|
||||
|
Referência em uma nova issue
Block a user