qcacmn: Populate the list of supported sscan bandwidths and detectors
Populate the list of supported spectral scan bandwidths for different targets and use that in populating the detector list. CRs-Fixed: 3042448 Change-Id: I5dac2c845843698bbafac64a01517acfbe120180
This commit is contained in:

committed by
Madan Koyyalamudi

orang tua
db135c6eac
melakukan
8e8df4a411
@@ -2232,9 +2232,13 @@ target_if_populate_supported_sscan_bws_be(struct target_if_spectral *spectral)
|
|||||||
supported_bws = &spectral->supported_bws
|
supported_bws = &spectral->supported_bws
|
||||||
[SPECTRAL_SCAN_MODE_NORMAL][op_bw];
|
[SPECTRAL_SCAN_MODE_NORMAL][op_bw];
|
||||||
supported_bws->bandwidths |= 1 << get_supported_sscan_bw_pos(op_bw);
|
supported_bws->bandwidths |= 1 << get_supported_sscan_bw_pos(op_bw);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[SPECTRAL_SCAN_MODE_NORMAL][op_bw] = true;
|
||||||
supported_bws = &spectral->supported_bws
|
supported_bws = &spectral->supported_bws
|
||||||
[SPECTRAL_SCAN_MODE_AGILE][op_bw];
|
[SPECTRAL_SCAN_MODE_AGILE][op_bw];
|
||||||
supported_bws->bandwidths |= 1 << get_supported_sscan_bw_pos(op_bw);
|
supported_bws->bandwidths |= 1 << get_supported_sscan_bw_pos(op_bw);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[SPECTRAL_SCAN_MODE_AGILE][op_bw] = true;
|
||||||
|
|
||||||
for (op_bw = CH_WIDTH_40MHZ; op_bw < CH_WIDTH_MAX; op_bw++) {
|
for (op_bw = CH_WIDTH_40MHZ; op_bw < CH_WIDTH_MAX; op_bw++) {
|
||||||
bool is_supported;
|
bool is_supported;
|
||||||
@@ -2257,17 +2261,24 @@ target_if_populate_supported_sscan_bws_be(struct target_if_spectral *spectral)
|
|||||||
[SPECTRAL_SCAN_MODE_NORMAL][op_bw];
|
[SPECTRAL_SCAN_MODE_NORMAL][op_bw];
|
||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(op_bw);
|
1 << get_supported_sscan_bw_pos(op_bw);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[SPECTRAL_SCAN_MODE_NORMAL][op_bw] = true;
|
||||||
|
|
||||||
/* Agile mode */
|
/* Agile mode */
|
||||||
supported_bws = &spectral->supported_bws
|
supported_bws = &spectral->supported_bws
|
||||||
[SPECTRAL_SCAN_MODE_AGILE][op_bw];
|
[SPECTRAL_SCAN_MODE_AGILE][op_bw];
|
||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(op_bw);
|
1 << get_supported_sscan_bw_pos(op_bw);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[SPECTRAL_SCAN_MODE_AGILE][op_bw] = true;
|
||||||
|
|
||||||
half_op_bw = target_if_get_half_bandwidth(op_bw);
|
half_op_bw = target_if_get_half_bandwidth(op_bw);
|
||||||
if (half_op_bw != CH_WIDTH_INVALID)
|
if (half_op_bw != CH_WIDTH_INVALID) {
|
||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(half_op_bw);
|
1 << get_supported_sscan_bw_pos(half_op_bw);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[SPECTRAL_SCAN_MODE_AGILE][half_op_bw] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
@@ -2327,10 +2338,14 @@ target_if_populate_supported_sscan_bws(struct target_if_spectral *spectral,
|
|||||||
* If fragmentation is supported, then only 80Hz
|
* If fragmentation is supported, then only 80Hz
|
||||||
* agile width is supported
|
* agile width is supported
|
||||||
*/
|
*/
|
||||||
if (spectral->rparams.fragmentation_160[smode])
|
if (spectral->rparams.
|
||||||
|
fragmentation_160[smode]) {
|
||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(
|
1 << get_supported_sscan_bw_pos(
|
||||||
CH_WIDTH_80MHZ);
|
CH_WIDTH_80MHZ);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[smode][CH_WIDTH_80MHZ] = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If restricted 80p80 is supported, then both
|
* If restricted 80p80 is supported, then both
|
||||||
@@ -2343,15 +2358,23 @@ target_if_populate_supported_sscan_bws(struct target_if_spectral *spectral,
|
|||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(
|
1 << get_supported_sscan_bw_pos(
|
||||||
CH_WIDTH_160MHZ);
|
CH_WIDTH_160MHZ);
|
||||||
if (op_bw == CH_WIDTH_160MHZ)
|
spectral->supported_sscan_bw_list
|
||||||
|
[smode][CH_WIDTH_160MHZ] = true;
|
||||||
|
|
||||||
|
if (op_bw == CH_WIDTH_160MHZ) {
|
||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(
|
1 << get_supported_sscan_bw_pos(
|
||||||
CH_WIDTH_80P80MHZ);
|
CH_WIDTH_80P80MHZ);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[smode][CH_WIDTH_80P80MHZ] = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
supported_bws->bandwidths |=
|
supported_bws->bandwidths |=
|
||||||
1 << get_supported_sscan_bw_pos(
|
1 << get_supported_sscan_bw_pos(
|
||||||
op_bw);
|
op_bw);
|
||||||
|
spectral->supported_sscan_bw_list
|
||||||
|
[smode][op_bw] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3087,7 +3110,6 @@ target_if_spectral_report_params_init(
|
|||||||
smode = SPECTRAL_SCAN_MODE_NORMAL;
|
smode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
|
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
|
||||||
rparams->fragmentation_160[smode] = false;
|
rparams->fragmentation_160[smode] = false;
|
||||||
rparams->max_agile_ch_width = CH_WIDTH_80P80MHZ;
|
|
||||||
} else {
|
} else {
|
||||||
rparams->version = SPECTRAL_REPORT_FORMAT_VERSION_1;
|
rparams->version = SPECTRAL_REPORT_FORMAT_VERSION_1;
|
||||||
rparams->num_spectral_detectors =
|
rparams->num_spectral_detectors =
|
||||||
@@ -3095,7 +3117,6 @@ target_if_spectral_report_params_init(
|
|||||||
smode = SPECTRAL_SCAN_MODE_NORMAL;
|
smode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
|
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
|
||||||
rparams->fragmentation_160[smode] = true;
|
rparams->fragmentation_160[smode] = true;
|
||||||
rparams->max_agile_ch_width = CH_WIDTH_80MHZ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (rparams->version) {
|
switch (rparams->version) {
|
||||||
@@ -3391,7 +3412,7 @@ target_if_spectral_detector_list_init(struct target_if_spectral *spectral)
|
|||||||
* always be pri80 detector, and second detector for sec80.
|
* always be pri80 detector, and second detector for sec80.
|
||||||
*/
|
*/
|
||||||
ch_width = CH_WIDTH_20MHZ;
|
ch_width = CH_WIDTH_20MHZ;
|
||||||
for (; ch_width <= CH_WIDTH_80P80MHZ; ch_width++) {
|
for (; ch_width < CH_WIDTH_MAX; ch_width++) {
|
||||||
/* Normal spectral scan */
|
/* Normal spectral scan */
|
||||||
smode = SPECTRAL_SCAN_MODE_NORMAL;
|
smode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
spectral_debug("is_hw_mode_sbs: %d is_using_phya1:%d",
|
spectral_debug("is_hw_mode_sbs: %d is_using_phya1:%d",
|
||||||
@@ -3399,6 +3420,9 @@ target_if_spectral_detector_list_init(struct target_if_spectral *spectral)
|
|||||||
|
|
||||||
qdf_spin_lock_bh(&spectral->detector_list_lock);
|
qdf_spin_lock_bh(&spectral->detector_list_lock);
|
||||||
|
|
||||||
|
if (!spectral->supported_sscan_bw_list[smode][ch_width])
|
||||||
|
goto agile_handling;
|
||||||
|
|
||||||
det_list = &spectral->detector_list[smode][ch_width];
|
det_list = &spectral->detector_list[smode][ch_width];
|
||||||
det_list->num_detectors = 1;
|
det_list->num_detectors = 1;
|
||||||
|
|
||||||
@@ -3413,26 +3437,22 @@ target_if_spectral_detector_list_init(struct target_if_spectral *spectral)
|
|||||||
det_list->detectors[1] = SPECTRAL_DETECTOR_ID_1;
|
det_list->detectors[1] = SPECTRAL_DETECTOR_ID_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
agile_handling:
|
||||||
/* Agile spectral scan */
|
/* Agile spectral scan */
|
||||||
smode = SPECTRAL_SCAN_MODE_AGILE;
|
smode = SPECTRAL_SCAN_MODE_AGILE;
|
||||||
|
if (!spectral->supported_sscan_bw_list[smode][ch_width]) {
|
||||||
|
qdf_spin_unlock_bh(&spectral->detector_list_lock);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
det_list = &spectral->detector_list[smode][ch_width];
|
det_list = &spectral->detector_list[smode][ch_width];
|
||||||
det_list->num_detectors = 1;
|
det_list->num_detectors = 1;
|
||||||
|
|
||||||
if (spectral->rparams.fragmentation_160[smode]) {
|
if (spectral->rparams.fragmentation_160[smode])
|
||||||
/**
|
|
||||||
* Skip to next iteration if 160/80p80 MHz for Agile
|
|
||||||
* scan. Only 20/40/80 MHz is supported on platforms
|
|
||||||
* with fragmentation, as only 1 detector is available.
|
|
||||||
*/
|
|
||||||
if (is_ch_width_160_or_80p80(ch_width)) {
|
|
||||||
qdf_spin_unlock_bh(
|
|
||||||
&spectral->detector_list_lock);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
det_list->detectors[0] = SPECTRAL_DETECTOR_ID_2;
|
det_list->detectors[0] = SPECTRAL_DETECTOR_ID_2;
|
||||||
} else {
|
else
|
||||||
det_list->detectors[0] = SPECTRAL_DETECTOR_ID_1;
|
det_list->detectors[0] = SPECTRAL_DETECTOR_ID_1;
|
||||||
}
|
|
||||||
qdf_spin_unlock_bh(&spectral->detector_list_lock);
|
qdf_spin_unlock_bh(&spectral->detector_list_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -603,7 +603,6 @@ struct spectral_fft_bin_len_adj_swar {
|
|||||||
* of FFT bins.
|
* of FFT bins.
|
||||||
* @fragmentation_160: This indicates whether Spectral reports in 160/80p80 is
|
* @fragmentation_160: This indicates whether Spectral reports in 160/80p80 is
|
||||||
* fragmented.
|
* fragmented.
|
||||||
* @max_agile_ch_width: Maximum agile BW supported by the target
|
|
||||||
* @detid_mode_table: Detector ID to Spectral scan mode table
|
* @detid_mode_table: Detector ID to Spectral scan mode table
|
||||||
* @num_spectral_detectors: Total number of Spectral detectors
|
* @num_spectral_detectors: Total number of Spectral detectors
|
||||||
* @marker: Describes the boundaries of pri80, 5 MHz and sec80 bins
|
* @marker: Describes the boundaries of pri80, 5 MHz and sec80 bins
|
||||||
@@ -613,7 +612,6 @@ struct spectral_report_params {
|
|||||||
uint8_t ssumaary_padding_bytes;
|
uint8_t ssumaary_padding_bytes;
|
||||||
uint8_t fft_report_hdr_len;
|
uint8_t fft_report_hdr_len;
|
||||||
bool fragmentation_160[SPECTRAL_SCAN_MODE_MAX];
|
bool fragmentation_160[SPECTRAL_SCAN_MODE_MAX];
|
||||||
enum phy_ch_width max_agile_ch_width;
|
|
||||||
enum spectral_scan_mode detid_mode_table[SPECTRAL_DETECTOR_ID_MAX];
|
enum spectral_scan_mode detid_mode_table[SPECTRAL_DETECTOR_ID_MAX];
|
||||||
uint8_t num_spectral_detectors;
|
uint8_t num_spectral_detectors;
|
||||||
struct spectral_fft_bin_markers_160_165mhz
|
struct spectral_fft_bin_markers_160_165mhz
|
||||||
@@ -1225,6 +1223,7 @@ int get_supported_sscan_bw_pos(enum phy_ch_width sscan_bw);
|
|||||||
* @session_report_info_lock: Lock to synchronize access to session report info
|
* @session_report_info_lock: Lock to synchronize access to session report info
|
||||||
* @supported_bws: Supported sscan bandwidths for all sscan modes and
|
* @supported_bws: Supported sscan bandwidths for all sscan modes and
|
||||||
* operating widths
|
* operating widths
|
||||||
|
* @supported_sscan_bw_list: List of supported sscan widths for all sscan modes
|
||||||
*/
|
*/
|
||||||
struct target_if_spectral {
|
struct target_if_spectral {
|
||||||
struct wlan_objmgr_pdev *pdev_obj;
|
struct wlan_objmgr_pdev *pdev_obj;
|
||||||
@@ -1356,6 +1355,8 @@ struct target_if_spectral {
|
|||||||
qdf_spinlock_t session_report_info_lock;
|
qdf_spinlock_t session_report_info_lock;
|
||||||
struct spectral_supported_bws
|
struct spectral_supported_bws
|
||||||
supported_bws[SPECTRAL_SCAN_MODE_MAX][CH_WIDTH_MAX];
|
supported_bws[SPECTRAL_SCAN_MODE_MAX][CH_WIDTH_MAX];
|
||||||
|
/* Whether a given sscan BW is supported on a given smode */
|
||||||
|
bool supported_sscan_bw_list[SPECTRAL_SCAN_MODE_MAX][CH_WIDTH_MAX];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user