qcacmn: Handle 80p80 and 160 MHz separately
Currently 160 and 80+80 MHz modes are handled together in Spectral module. Differentiate between 160 and 80+80 MHz to support new features like restricted 80+80 which are applicable only with 80+80 MHz. CRs-Fixed: 2630729 Change-Id: I3e9fdd0e2d22a0bca7d37445df7fb1f1bab023c8
This commit is contained in:

کامیت شده توسط
nshrivas

والد
1d4f7736d3
کامیت
49de9e2d3c
@@ -3281,7 +3281,8 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
||||
extension_channel;
|
||||
}
|
||||
|
||||
} else if (spectral->ch_width[smode] == CH_WIDTH_160MHZ) {
|
||||
} else if (is_ch_width_160_or_80p80(
|
||||
spectral->ch_width[smode])) {
|
||||
/* Set the FFT Size */
|
||||
|
||||
/* The below applies to both 160 and 80+80 cases */
|
||||
|
@@ -1445,6 +1445,7 @@ static inline
|
||||
enum phy_ch_width target_if_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc = NULL;
|
||||
enum phy_ch_width ch_width;
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
@@ -1452,8 +1453,24 @@ enum phy_ch_width target_if_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev)
|
||||
return CH_WIDTH_INVALID;
|
||||
}
|
||||
|
||||
return psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_vdev_get_ch_width(
|
||||
vdev);
|
||||
ch_width = psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_vdev_get_ch_width(
|
||||
vdev);
|
||||
|
||||
if (ch_width == CH_WIDTH_160MHZ) {
|
||||
int16_t cfreq2;
|
||||
|
||||
cfreq2 = target_if_vdev_get_chan_freq_seg2(vdev);
|
||||
if (cfreq2 < 0) {
|
||||
spectral_err("Invalid value for cfreq2 %d", cfreq2);
|
||||
return CH_WIDTH_INVALID;
|
||||
}
|
||||
|
||||
/* Use non zero cfreq2 to identify 80p80 */
|
||||
if (cfreq2)
|
||||
ch_width = CH_WIDTH_80P80MHZ;
|
||||
}
|
||||
|
||||
return ch_width;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1585,6 +1602,12 @@ target_if_get_spectral_msg_type(enum spectral_scan_mode smode,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
is_ch_width_160_or_80p80(enum phy_ch_width ch_width)
|
||||
{
|
||||
return (ch_width == CH_WIDTH_160MHZ || ch_width == CH_WIDTH_80P80MHZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* init_160mhz_delivery_state_machine() - Initialize 160MHz Spectral
|
||||
* state machine
|
||||
@@ -1625,7 +1648,7 @@ reset_160mhz_delivery_state_machine(struct target_if_spectral *spectral,
|
||||
return;
|
||||
}
|
||||
|
||||
if (spectral->ch_width[smode] == CH_WIDTH_160MHZ) {
|
||||
if (is_ch_width_160_or_80p80(spectral->ch_width[smode])) {
|
||||
spectral->state_160mhz_delivery[smode] =
|
||||
SPECTRAL_REPORT_WAIT_PRIMARY80;
|
||||
|
||||
@@ -1654,10 +1677,10 @@ bool is_secondaryseg_expected(struct target_if_spectral *spectral,
|
||||
enum spectral_scan_mode smode)
|
||||
{
|
||||
return
|
||||
((spectral->ch_width[smode] == CH_WIDTH_160MHZ) &&
|
||||
(is_ch_width_160_or_80p80(spectral->ch_width[smode]) &&
|
||||
spectral->rparams.fragmentation_160[smode] &&
|
||||
(spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_WAIT_SECONDARY80));
|
||||
(spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_WAIT_SECONDARY80));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1675,11 +1698,10 @@ bool is_primaryseg_expected(struct target_if_spectral *spectral,
|
||||
enum spectral_scan_mode smode)
|
||||
{
|
||||
return
|
||||
((spectral->ch_width[smode] != CH_WIDTH_160MHZ) ||
|
||||
((spectral->ch_width[smode] == CH_WIDTH_160MHZ) &&
|
||||
(!spectral->rparams.fragmentation_160[smode] ||
|
||||
spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_WAIT_PRIMARY80)));
|
||||
(!is_ch_width_160_or_80p80(spectral->ch_width[smode]) ||
|
||||
!spectral->rparams.fragmentation_160[smode] ||
|
||||
(spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_WAIT_PRIMARY80));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1696,13 +1718,12 @@ bool is_primaryseg_rx_inprog(struct target_if_spectral *spectral,
|
||||
enum spectral_scan_mode smode)
|
||||
{
|
||||
return
|
||||
((spectral->ch_width[smode] != CH_WIDTH_160MHZ) ||
|
||||
((spectral->ch_width[smode] == CH_WIDTH_160MHZ) &&
|
||||
((spectral->spectral_gen == SPECTRAL_GEN2) ||
|
||||
((spectral->spectral_gen == SPECTRAL_GEN3) &&
|
||||
(!spectral->rparams.fragmentation_160[smode] ||
|
||||
spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_RX_PRIMARY80)))));
|
||||
(!is_ch_width_160_or_80p80(spectral->ch_width[smode]) ||
|
||||
spectral->spectral_gen == SPECTRAL_GEN2 ||
|
||||
(spectral->spectral_gen == SPECTRAL_GEN3 &&
|
||||
(!spectral->rparams.fragmentation_160[smode] ||
|
||||
spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_RX_PRIMARY80)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1719,12 +1740,12 @@ bool is_secondaryseg_rx_inprog(struct target_if_spectral *spectral,
|
||||
enum spectral_scan_mode smode)
|
||||
{
|
||||
return
|
||||
((spectral->ch_width[smode] == CH_WIDTH_160MHZ) &&
|
||||
((spectral->spectral_gen == SPECTRAL_GEN2) ||
|
||||
((spectral->spectral_gen == SPECTRAL_GEN3) &&
|
||||
(!spectral->rparams.fragmentation_160[smode] ||
|
||||
spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_RX_SECONDARY80))));
|
||||
(is_ch_width_160_or_80p80(spectral->ch_width[smode]) &&
|
||||
(spectral->spectral_gen == SPECTRAL_GEN2 ||
|
||||
((spectral->spectral_gen == SPECTRAL_GEN3) &&
|
||||
(!spectral->rparams.fragmentation_160[smode] ||
|
||||
spectral->state_160mhz_delivery[smode] ==
|
||||
SPECTRAL_REPORT_RX_SECONDARY80))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -238,7 +238,7 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
||||
}
|
||||
}
|
||||
|
||||
if (spectral->ch_width[params->smode] != CH_WIDTH_160MHZ ||
|
||||
if (!is_ch_width_160_or_80p80(spectral->ch_width[params->smode]) ||
|
||||
is_secondaryseg_rx_inprog(spectral, params->smode)) {
|
||||
if (spectral->send_phy_data(spectral->pdev_obj,
|
||||
msg_type) == 0)
|
||||
@@ -248,7 +248,7 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
||||
|
||||
/* Take care of state transitions for 160MHz/ 80p80 */
|
||||
if (spectral->spectral_gen == SPECTRAL_GEN3 &&
|
||||
spectral->ch_width[params->smode] == CH_WIDTH_160MHZ &&
|
||||
is_ch_width_160_or_80p80(spectral->ch_width[params->smode]) &&
|
||||
spectral->rparams.fragmentation_160[params->smode])
|
||||
target_if_160mhz_delivery_state_change(
|
||||
spectral, params->smode,
|
||||
|
@@ -251,6 +251,7 @@ target_if_get_offset_swar_sec80(uint32_t channel_width)
|
||||
offset = OFFSET_CH_WIDTH_80;
|
||||
break;
|
||||
case CH_WIDTH_160MHZ:
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
offset = OFFSET_CH_WIDTH_160;
|
||||
break;
|
||||
default:
|
||||
@@ -810,6 +811,8 @@ target_if_process_phyerr_gen2(struct target_if_spectral *spectral,
|
||||
|
||||
uint8_t segid = 0;
|
||||
uint8_t segid_sec80 = 0;
|
||||
enum phy_ch_width ch_width =
|
||||
spectral->ch_width[SPECTRAL_SCAN_MODE_NORMAL];
|
||||
|
||||
if (spectral->is_160_format)
|
||||
segid_skiplen = sizeof(SPECTRAL_SEGID_INFO);
|
||||
@@ -967,8 +970,8 @@ target_if_process_phyerr_gen2(struct target_if_spectral *spectral,
|
||||
acs_stats->nfc_ctl_rssi = control_rssi;
|
||||
acs_stats->nfc_ext_rssi = extension_rssi;
|
||||
|
||||
if (spectral->is_160_format && spectral->ch_width
|
||||
[SPECTRAL_SCAN_MODE_NORMAL] == CH_WIDTH_160MHZ) {
|
||||
if (spectral->is_160_format &&
|
||||
is_ch_width_160_or_80p80(ch_width)) {
|
||||
/*
|
||||
* We expect to see one more Search FFT report, and it
|
||||
* should be equal in size to the current one.
|
||||
@@ -1453,8 +1456,8 @@ target_if_160mhz_delivery_state_change(struct target_if_spectral *spectral,
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (spectral->ch_width[smode] != CH_WIDTH_160MHZ) {
|
||||
spectral_err_rl("Current scan BW %d is not 160 for mode %d",
|
||||
if (!is_ch_width_160_or_80p80(spectral->ch_width[smode])) {
|
||||
spectral_err_rl("Scan BW %d is not 160/80p80 for mode %d",
|
||||
spectral->ch_width[smode], smode);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
@@ -1913,8 +1916,9 @@ target_if_consume_spectral_report_gen3(
|
||||
target_reset_count;
|
||||
|
||||
/* Take care of state transitions for 160 MHz and 80p80 */
|
||||
if (spectral->ch_width[spectral_mode] == CH_WIDTH_160MHZ &&
|
||||
spectral->rparams.fragmentation_160[spectral_mode]) {
|
||||
if (is_ch_width_160_or_80p80(spectral->ch_width
|
||||
[spectral_mode]) && spectral->rparams.
|
||||
fragmentation_160[spectral_mode]) {
|
||||
ret = target_if_160mhz_delivery_state_change(
|
||||
spectral, spectral_mode,
|
||||
detector_id);
|
||||
@@ -1967,8 +1971,9 @@ target_if_consume_spectral_report_gen3(
|
||||
params.bin_pwr_data = (uint8_t *)((uint8_t *)p_fft_report +
|
||||
SPECTRAL_FFT_BINS_POS);
|
||||
params.pwr_count = fft_bin_count;
|
||||
if (spectral->ch_width[spectral_mode] == CH_WIDTH_160MHZ &&
|
||||
!spectral->rparams.fragmentation_160[spectral_mode]) {
|
||||
if (is_ch_width_160_or_80p80(spectral->ch_width
|
||||
[spectral_mode]) && !spectral->rparams.
|
||||
fragmentation_160[spectral_mode]) {
|
||||
params.agc_total_gain_sec80 =
|
||||
sscan_report_fields.sscan_agc_total_gain;
|
||||
params.gainchange_sec80 =
|
||||
@@ -2041,8 +2046,9 @@ target_if_consume_spectral_report_gen3(
|
||||
params.raw_timestamp_sec80 = p_sfft->timestamp;
|
||||
|
||||
/* Take care of state transitions for 160 MHz and 80p80 */
|
||||
if (spectral->ch_width[spectral_mode] == CH_WIDTH_160MHZ &&
|
||||
spectral->rparams.fragmentation_160[spectral_mode]) {
|
||||
if (is_ch_width_160_or_80p80(spectral->ch_width
|
||||
[spectral_mode]) && spectral->rparams.
|
||||
fragmentation_160[spectral_mode]) {
|
||||
ret = target_if_160mhz_delivery_state_change(
|
||||
spectral, spectral_mode,
|
||||
detector_id);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015,2017-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015,2017-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
@@ -66,7 +66,6 @@ static OS_TIMER_FUNC(target_if_spectral_sim_phyerrdelivery_handler);
|
||||
* data for one report for generation 2 chipsets
|
||||
* @report: Pointer to spectral report data instance
|
||||
* @width : Channel bandwidth enumeration
|
||||
* @is_80_80: Whether the channel is operating in 80-80 mode
|
||||
*
|
||||
* Statically populate simulation data for one report for generation 2 chipsets
|
||||
*
|
||||
@@ -75,7 +74,7 @@ static OS_TIMER_FUNC(target_if_spectral_sim_phyerrdelivery_handler);
|
||||
static int
|
||||
target_if_populate_report_static_gen2(
|
||||
struct spectralsim_report *report,
|
||||
enum phy_ch_width width, bool is_80_80)
|
||||
enum phy_ch_width width)
|
||||
{
|
||||
qdf_assert_always(report);
|
||||
|
||||
@@ -137,47 +136,47 @@ target_if_populate_report_static_gen2(
|
||||
&chan_info_80, sizeof(report->chan_info));
|
||||
|
||||
break;
|
||||
case CH_WIDTH_160MHZ:
|
||||
if (is_80_80) {
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_80_80_gen2));
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_80_80_gen2));
|
||||
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
|
||||
report->datasize = sizeof(reportdata_80_80_gen2);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_80_80_gen2, report->datasize);
|
||||
report->datasize = sizeof(reportdata_80_80_gen2);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_80_80_gen2, report->datasize);
|
||||
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_80_80,
|
||||
sizeof(report->rfqual_info));
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_80_80,
|
||||
sizeof(report->rfqual_info));
|
||||
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_80_80,
|
||||
sizeof(report->chan_info));
|
||||
|
||||
} else {
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_160_gen2));
|
||||
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
|
||||
report->datasize = sizeof(reportdata_160_gen2);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_160_gen2, report->datasize);
|
||||
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_160,
|
||||
sizeof(report->rfqual_info));
|
||||
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_160, sizeof(report->chan_info));
|
||||
}
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_80_80,
|
||||
sizeof(report->chan_info));
|
||||
break;
|
||||
|
||||
case CH_WIDTH_160MHZ:
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_160_gen2));
|
||||
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
|
||||
report->datasize = sizeof(reportdata_160_gen2);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_160_gen2, report->datasize);
|
||||
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_160,
|
||||
sizeof(report->rfqual_info));
|
||||
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_160, sizeof(report->chan_info));
|
||||
break;
|
||||
|
||||
default:
|
||||
spectral_err("Unhandled width. Please correct. Asserting");
|
||||
qdf_assert_always(0);
|
||||
@@ -194,7 +193,6 @@ target_if_populate_report_static_gen2(
|
||||
* data for one report for generation 3 chipsets
|
||||
* @report: Pointer to spectral report data instance
|
||||
* @width : Channel bandwidth enumeration
|
||||
* @is_80_80: Whether the channel is operating in 80-80 mode
|
||||
*
|
||||
* Statically populate simulation data for one report for generation 3 chipsets
|
||||
*
|
||||
@@ -203,7 +201,7 @@ target_if_populate_report_static_gen2(
|
||||
static int
|
||||
target_if_populate_report_static_gen3(
|
||||
struct spectralsim_report *report,
|
||||
enum phy_ch_width width, bool is_80_80)
|
||||
enum phy_ch_width width)
|
||||
{
|
||||
qdf_assert_always(report);
|
||||
|
||||
@@ -265,47 +263,48 @@ target_if_populate_report_static_gen3(
|
||||
&chan_info_80, sizeof(report->chan_info));
|
||||
|
||||
break;
|
||||
case CH_WIDTH_160MHZ:
|
||||
if (is_80_80) {
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_80_80_gen3));
|
||||
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_80_80_gen3));
|
||||
|
||||
report->datasize = sizeof(reportdata_80_80_gen3);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_80_80_gen3, report->datasize);
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_80_80,
|
||||
sizeof(report->rfqual_info));
|
||||
report->datasize = sizeof(reportdata_80_80_gen3);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_80_80_gen3, report->datasize);
|
||||
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_80_80,
|
||||
sizeof(report->chan_info));
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_80_80,
|
||||
sizeof(report->rfqual_info));
|
||||
|
||||
} else {
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_160_gen3));
|
||||
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
|
||||
report->datasize = sizeof(reportdata_160_gen3);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_160_gen3, report->datasize);
|
||||
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_160,
|
||||
sizeof(report->rfqual_info));
|
||||
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_160, sizeof(report->chan_info));
|
||||
}
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_80_80,
|
||||
sizeof(report->chan_info));
|
||||
break;
|
||||
|
||||
case CH_WIDTH_160MHZ:
|
||||
report->data = NULL;
|
||||
report->data = (uint8_t *)
|
||||
qdf_mem_malloc(sizeof(reportdata_160_gen3));
|
||||
|
||||
if (!report->data)
|
||||
goto bad;
|
||||
|
||||
report->datasize = sizeof(reportdata_160_gen3);
|
||||
qdf_mem_copy(report->data,
|
||||
reportdata_160_gen3, report->datasize);
|
||||
|
||||
qdf_mem_copy(&report->rfqual_info,
|
||||
&rfqual_info_160,
|
||||
sizeof(report->rfqual_info));
|
||||
|
||||
qdf_mem_copy(&report->chan_info,
|
||||
&chan_info_160, sizeof(report->chan_info));
|
||||
break;
|
||||
|
||||
default:
|
||||
spectral_err("Unhandled width. Please correct. Asserting");
|
||||
qdf_assert_always(0);
|
||||
@@ -346,7 +345,6 @@ target_if_depopulate_report(
|
||||
* @simctx: Pointer to struct spectralsim_context
|
||||
* @reportset: Set of spectral report data instances
|
||||
* @width : Channel bandwidth enumeration
|
||||
* @is_80_80: Whether the channel is operating in 80+80 mode
|
||||
*
|
||||
* Statically populate simulation data for a given configuration
|
||||
*
|
||||
@@ -356,7 +354,7 @@ static int
|
||||
target_if_populate_reportset_static(
|
||||
struct spectralsim_context *simctx,
|
||||
struct spectralsim_reportset *reportset,
|
||||
enum phy_ch_width width, bool is_80_80)
|
||||
enum phy_ch_width width)
|
||||
{
|
||||
int ret = 0;
|
||||
struct spectralsim_report *report = NULL;
|
||||
@@ -380,7 +378,7 @@ target_if_populate_reportset_static(
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_20_1, sizeof(reportset->config));
|
||||
|
||||
ret = simctx->populate_report_static(report, CH_WIDTH_20MHZ, 0);
|
||||
ret = simctx->populate_report_static(report, CH_WIDTH_20MHZ);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
|
||||
@@ -391,7 +389,7 @@ target_if_populate_reportset_static(
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_40_1, sizeof(reportset->config));
|
||||
|
||||
ret = simctx->populate_report_static(report, CH_WIDTH_40MHZ, 0);
|
||||
ret = simctx->populate_report_static(report, CH_WIDTH_40MHZ);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
|
||||
@@ -402,41 +400,41 @@ target_if_populate_reportset_static(
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_80_1, sizeof(reportset->config));
|
||||
|
||||
ret = simctx->populate_report_static(report, CH_WIDTH_80MHZ, 0);
|
||||
ret = simctx->populate_report_static(report, CH_WIDTH_80MHZ);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
|
||||
report->next = NULL;
|
||||
reportset->headreport = report;
|
||||
break;
|
||||
case CH_WIDTH_160MHZ:
|
||||
if (is_80_80) {
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_80_80_1,
|
||||
sizeof(reportset->config));
|
||||
|
||||
ret = simctx->populate_report_static(report,
|
||||
CH_WIDTH_160MHZ,
|
||||
1);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_80_80_1,
|
||||
sizeof(reportset->config));
|
||||
|
||||
report->next = NULL;
|
||||
reportset->headreport = report;
|
||||
} else {
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_160_1, sizeof(reportset->config));
|
||||
ret = simctx->populate_report_static(report,
|
||||
CH_WIDTH_80P80MHZ);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
|
||||
ret = simctx->populate_report_static(report,
|
||||
CH_WIDTH_160MHZ,
|
||||
0);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
|
||||
report->next = NULL;
|
||||
reportset->headreport = report;
|
||||
}
|
||||
report->next = NULL;
|
||||
reportset->headreport = report;
|
||||
break;
|
||||
|
||||
case CH_WIDTH_160MHZ:
|
||||
qdf_mem_copy(&reportset->config,
|
||||
&config_160_1, sizeof(reportset->config));
|
||||
|
||||
ret = simctx->populate_report_static(report,
|
||||
CH_WIDTH_160MHZ);
|
||||
if (ret != 0)
|
||||
goto bad;
|
||||
|
||||
report->next = NULL;
|
||||
reportset->headreport = report;
|
||||
break;
|
||||
|
||||
default:
|
||||
spectral_err("Unhandled width. Please rectify.");
|
||||
qdf_assert_always(0);
|
||||
@@ -500,27 +498,27 @@ target_if_populate_simdata(
|
||||
simctx->bw20_headreportset = NULL;
|
||||
SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx,
|
||||
simctx->bw20_headreportset,
|
||||
CH_WIDTH_20MHZ, 0);
|
||||
CH_WIDTH_20MHZ);
|
||||
|
||||
simctx->bw40_headreportset = NULL;
|
||||
SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx,
|
||||
simctx->bw40_headreportset,
|
||||
CH_WIDTH_40MHZ, 0);
|
||||
CH_WIDTH_40MHZ);
|
||||
|
||||
simctx->bw80_headreportset = NULL;
|
||||
SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx,
|
||||
simctx->bw80_headreportset,
|
||||
CH_WIDTH_80MHZ, 0);
|
||||
CH_WIDTH_80MHZ);
|
||||
|
||||
simctx->bw160_headreportset = NULL;
|
||||
SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx,
|
||||
simctx->bw160_headreportset,
|
||||
CH_WIDTH_160MHZ, 0);
|
||||
CH_WIDTH_160MHZ);
|
||||
|
||||
simctx->bw80_80_headreportset = NULL;
|
||||
SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx,
|
||||
simctx->bw80_80_headreportset,
|
||||
CH_WIDTH_160MHZ, 1);
|
||||
CH_WIDTH_80P80MHZ);
|
||||
|
||||
simctx->curr_reportset = NULL;
|
||||
|
||||
@@ -881,19 +879,12 @@ target_if_spectral_sops_sim_configure_params(
|
||||
des_headreportset = simctx->bw80_headreportset;
|
||||
break;
|
||||
case CH_WIDTH_160MHZ:
|
||||
phymode = wlan_vdev_get_phymode(vdev);
|
||||
if (phymode == WLAN_PHYMODE_11AC_VHT160) {
|
||||
des_headreportset = simctx->bw160_headreportset;
|
||||
} else if (phymode == WLAN_PHYMODE_11AC_VHT80_80) {
|
||||
des_headreportset = simctx->bw80_80_headreportset;
|
||||
} else {
|
||||
spectral_err("Spectral simulation: Unexpected PHY mode %u found for width 160 MHz...asserting.",
|
||||
phymode);
|
||||
qdf_assert_always(0);
|
||||
}
|
||||
des_headreportset = simctx->bw160_headreportset;
|
||||
break;
|
||||
|
||||
case IEEE80211_CWM_WIDTHINVALID:
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
des_headreportset = simctx->bw80_80_headreportset;
|
||||
break;
|
||||
case CH_WIDTH_INVALID:
|
||||
spectral_err("Spectral simulation: Invalid width configured - not proceeding with param config.");
|
||||
is_invalid_width = true;
|
||||
default:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015,2017-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015,2017-2020 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
@@ -119,9 +119,8 @@ struct spectralsim_context {
|
||||
/* Helper Macros */
|
||||
|
||||
/* Allocate and populate reportset for a single configuration */
|
||||
#define SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx, reportset, width, \
|
||||
is_80_80) \
|
||||
{ \
|
||||
#define SPECTRAL_SIM_REPORTSET_ALLOCPOPL_SINGLE(simctx, reportset, width) \
|
||||
do { \
|
||||
(reportset) = (struct spectralsim_reportset *) \
|
||||
qdf_mem_malloc(sizeof(struct spectralsim_reportset)); \
|
||||
\
|
||||
@@ -133,13 +132,13 @@ struct spectralsim_context {
|
||||
qdf_mem_zero((reportset), sizeof(struct spectralsim_reportset)); \
|
||||
\
|
||||
if (target_if_populate_reportset_static( \
|
||||
(simctx), (reportset), (width), (is_80_80)) != 0) { \
|
||||
(simctx), (reportset), (width)) != 0) { \
|
||||
target_if_depopulate_simdata((simctx)); \
|
||||
return -EPERM; \
|
||||
} \
|
||||
\
|
||||
(reportset)->next = NULL; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/* Depopulate and free list of report sets */
|
||||
#define SPECTRAL_SIM_REPORTSET_DEPOPLFREE_LIST(reportset) \
|
||||
|
مرجع در شماره جدید
Block a user