qcacmn: Add support to extract fixed params from Spectral Caps event
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to indicated the different capabilities of the Spectral HW block. Add support to extract the fixed parameters from this event. Change-Id: Ib13108f078de008b6a76a25a010e85a7fdb6f5fe CRs-Fixed: 3098203
This commit is contained in:

committed by
Madan Koyyalamudi

parent
0ae42b09e4
commit
a9547b0f25
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -7022,6 +7022,46 @@ target_if_extract_pdev_spectral_session_detector_info(
|
|||||||
extract_pdev_spectral_session_detector_info(
|
extract_pdev_spectral_session_detector_info(
|
||||||
wmi_handle, evt_buf, det_info, det_info_idx);
|
wmi_handle, evt_buf, det_info, det_info_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* target_if_wmi_extract_spectral_caps_fixed_param() - Wrapper function to
|
||||||
|
* extract fixed params from Spectral capabilities WMI event
|
||||||
|
* @psoc: Pointer to psoc object
|
||||||
|
* @evt_buf: Event buffer
|
||||||
|
* @param: Spectral capabilities event parameters data structure to be filled
|
||||||
|
* by this API
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS of operation
|
||||||
|
*/
|
||||||
|
QDF_STATUS
|
||||||
|
target_if_wmi_extract_spectral_caps_fixed_param(
|
||||||
|
struct wlan_objmgr_psoc *psoc,
|
||||||
|
uint8_t *evt_buf,
|
||||||
|
struct spectral_capabilities_event_params *param)
|
||||||
|
{
|
||||||
|
struct target_if_psoc_spectral *psoc_spectral;
|
||||||
|
wmi_unified_t wmi_handle;
|
||||||
|
|
||||||
|
if (!psoc) {
|
||||||
|
spectral_err("psoc is null");
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc);
|
||||||
|
if (!wmi_handle) {
|
||||||
|
spectral_err("WMI handle is null");
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
psoc_spectral = get_target_if_spectral_handle_from_psoc(psoc);
|
||||||
|
if (!psoc_spectral) {
|
||||||
|
spectral_err("spectral object is null");
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return psoc_spectral->wmi_ops.extract_spectral_caps_fixed_param(
|
||||||
|
wmi_handle, evt_buf, param);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
* target_if_spectral_wmi_unified_register_event_handler() - Wrapper function to
|
* target_if_spectral_wmi_unified_register_event_handler() - Wrapper function to
|
||||||
@@ -7261,6 +7301,24 @@ target_if_extract_pdev_spectral_session_detector_info(
|
|||||||
return wmi_extract_pdev_spectral_session_detector_info(
|
return wmi_extract_pdev_spectral_session_detector_info(
|
||||||
wmi_handle, evt_buf, det_info, det_info_idx);
|
wmi_handle, evt_buf, det_info, det_info_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDF_STATUS
|
||||||
|
target_if_wmi_extract_spectral_caps_fixed_param(
|
||||||
|
struct wlan_objmgr_psoc *psoc,
|
||||||
|
uint8_t *evt_buf,
|
||||||
|
struct spectral_capabilities_event_params *param)
|
||||||
|
{
|
||||||
|
wmi_unified_t wmi_handle;
|
||||||
|
|
||||||
|
wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc);
|
||||||
|
if (!wmi_handle) {
|
||||||
|
spectral_err("WMI handle is null");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wmi_extract_spectral_caps_fixed_param(wmi_handle, evt_buf,
|
||||||
|
param);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -942,6 +942,8 @@ struct vdev_spectral_enable_params;
|
|||||||
* channel information
|
* channel information
|
||||||
* @extract_pdev_spectral_session_detector_info: Extract Spectral scan session
|
* @extract_pdev_spectral_session_detector_info: Extract Spectral scan session
|
||||||
* detector information
|
* detector information
|
||||||
|
* @extract_spectral_caps_fixed_param: Extract fixed parameters from Spectral
|
||||||
|
* capabilities event
|
||||||
*/
|
*/
|
||||||
struct spectral_wmi_ops {
|
struct spectral_wmi_ops {
|
||||||
QDF_STATUS (*wmi_spectral_configure_cmd_send)(
|
QDF_STATUS (*wmi_spectral_configure_cmd_send)(
|
||||||
@@ -975,6 +977,9 @@ struct spectral_wmi_ops {
|
|||||||
wmi_unified_t wmi_handle, void *event,
|
wmi_unified_t wmi_handle, void *event,
|
||||||
struct spectral_session_det_info *det_info,
|
struct spectral_session_det_info *det_info,
|
||||||
uint8_t det_info_idx);
|
uint8_t det_info_idx);
|
||||||
|
QDF_STATUS (*extract_spectral_caps_fixed_param)(
|
||||||
|
wmi_unified_t wmi_handle, void *event,
|
||||||
|
struct spectral_capabilities_event_params *param);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2979,4 +2984,20 @@ target_if_spectral_copy_fft_bins(struct target_if_spectral *spectral,
|
|||||||
uint32_t *bytes_copied,
|
uint32_t *bytes_copied,
|
||||||
uint16_t pwr_format);
|
uint16_t pwr_format);
|
||||||
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
||||||
|
|
||||||
|
struct spectral_capabilities_event_params;
|
||||||
|
/**
|
||||||
|
* target_if_wmi_extract_spectral_caps_fixed_param() - Wrapper function to
|
||||||
|
* extract fixed params from Spectral capabilities WMI event
|
||||||
|
* @psoc: Pointer to psoc object
|
||||||
|
* @evt_buf: Event buffer
|
||||||
|
* @param: Spectral capabilities event parameters data structure to be filled
|
||||||
|
* by this API
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS of operation
|
||||||
|
*/
|
||||||
|
QDF_STATUS target_if_wmi_extract_spectral_caps_fixed_param(
|
||||||
|
struct wlan_objmgr_psoc *psoc,
|
||||||
|
uint8_t *evt_buf,
|
||||||
|
struct spectral_capabilities_event_params *param);
|
||||||
#endif /* _TARGET_IF_SPECTRAL_H_ */
|
#endif /* _TARGET_IF_SPECTRAL_H_ */
|
||||||
|
@@ -2311,6 +2311,20 @@ QDF_STATUS wmi_extract_pdev_spectral_session_detector_info(
|
|||||||
wmi_unified_t wmi_handle, void *event,
|
wmi_unified_t wmi_handle, void *event,
|
||||||
struct spectral_session_det_info *det_info,
|
struct spectral_session_det_info *det_info,
|
||||||
uint8_t det_info_idx);
|
uint8_t det_info_idx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_extract_spectral_caps_fixed_param() - Extract fixed params from Spectral
|
||||||
|
* capabilities WMI event
|
||||||
|
* @wmi_handle: handle to WMI.
|
||||||
|
* @event: Event buffer
|
||||||
|
* @param: Spectral capabilities event parameters data structure to be filled
|
||||||
|
* by this API
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS of operation
|
||||||
|
*/
|
||||||
|
QDF_STATUS wmi_extract_spectral_caps_fixed_param(
|
||||||
|
wmi_unified_t wmi_handle, void *event,
|
||||||
|
struct spectral_capabilities_event_params *param);
|
||||||
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
||||||
|
|
||||||
#if defined(WLAN_SUPPORT_FILS) || defined(CONFIG_BAND_6GHZ)
|
#if defined(WLAN_SUPPORT_FILS) || defined(CONFIG_BAND_6GHZ)
|
||||||
|
@@ -3106,6 +3106,17 @@ struct spectral_session_det_info {
|
|||||||
qdf_freq_t start_freq;
|
qdf_freq_t start_freq;
|
||||||
qdf_freq_t end_freq;
|
qdf_freq_t end_freq;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct spectral_capabilities_event_params - parameters related to Spectral
|
||||||
|
* capabilities event
|
||||||
|
* @num_sscan_bw_caps: Number of spectral_scan_bw_capabilities TLVs
|
||||||
|
* @num_fft_size_caps: Number of spectral_fft_size_capabilities TLVs
|
||||||
|
*/
|
||||||
|
struct spectral_capabilities_event_params {
|
||||||
|
uint8_t num_sscan_bw_caps;
|
||||||
|
uint8_t num_fft_size_caps;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1514,6 +1514,10 @@ QDF_STATUS (*extract_pdev_spectral_session_detector_info)(
|
|||||||
wmi_unified_t wmi_handle, void *event,
|
wmi_unified_t wmi_handle, void *event,
|
||||||
struct spectral_session_det_info *det_info,
|
struct spectral_session_det_info *det_info,
|
||||||
uint8_t det_info_idx);
|
uint8_t det_info_idx);
|
||||||
|
|
||||||
|
QDF_STATUS (*extract_spectral_caps_fixed_param)(
|
||||||
|
wmi_unified_t wmi_handle, void *event,
|
||||||
|
struct spectral_capabilities_event_params *param);
|
||||||
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
||||||
|
|
||||||
QDF_STATUS (*send_vdev_spectral_configure_cmd)(wmi_unified_t wmi_handle,
|
QDF_STATUS (*send_vdev_spectral_configure_cmd)(wmi_unified_t wmi_handle,
|
||||||
|
@@ -2684,6 +2684,17 @@ QDF_STATUS wmi_extract_pdev_spectral_session_detector_info(
|
|||||||
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDF_STATUS wmi_extract_spectral_caps_fixed_param(
|
||||||
|
wmi_unified_t wmi_handle, void *event,
|
||||||
|
struct spectral_capabilities_event_params *param)
|
||||||
|
{
|
||||||
|
if (wmi_handle->ops->extract_spectral_caps_fixed_param)
|
||||||
|
return wmi_handle->ops->extract_spectral_caps_fixed_param(
|
||||||
|
wmi_handle, event, param);
|
||||||
|
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
||||||
|
|
||||||
QDF_STATUS wmi_extract_spectral_scaling_params_service_ready_ext(
|
QDF_STATUS wmi_extract_spectral_scaling_params_service_ready_ext(
|
||||||
|
@@ -7306,7 +7306,6 @@ extract_pdev_sscan_fft_bin_index_tlv(
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SPECTRAL_BERYLLIUM
|
|
||||||
/**
|
/**
|
||||||
* extract_pdev_spectral_session_chan_info_tlv() - Extract channel information
|
* extract_pdev_spectral_session_chan_info_tlv() - Extract channel information
|
||||||
* for a spectral scan session
|
* for a spectral scan session
|
||||||
@@ -7379,7 +7378,7 @@ extract_pdev_spectral_session_detector_info_tlv(
|
|||||||
struct spectral_session_det_info *det_info, uint8_t idx)
|
struct spectral_session_det_info *det_info, uint8_t idx)
|
||||||
{
|
{
|
||||||
WMI_PDEV_SSCAN_FW_PARAM_EVENTID_param_tlvs *param_buf = event;
|
WMI_PDEV_SSCAN_FW_PARAM_EVENTID_param_tlvs *param_buf = event;
|
||||||
wmi_pdev_sscan_detector_info *det_info_tlv;
|
wmi_pdev_sscan_per_detector_info *det_info_tlv;
|
||||||
|
|
||||||
if (!param_buf) {
|
if (!param_buf) {
|
||||||
wmi_err("param_buf is NULL");
|
wmi_err("param_buf is NULL");
|
||||||
@@ -7414,7 +7413,42 @@ extract_pdev_spectral_session_detector_info_tlv(
|
|||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* SPECTRAL_BERYLLIUM */
|
|
||||||
|
/**
|
||||||
|
* extract_spectral_caps_fixed_param_tlv() - Extract fixed params from Spectral
|
||||||
|
* capabilities WMI event
|
||||||
|
* @wmi_handle: handle to WMI.
|
||||||
|
* @event: Event buffer
|
||||||
|
* @param: Spectral capabilities event parameters data structure to be filled
|
||||||
|
* by this API
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS of operation
|
||||||
|
*/
|
||||||
|
static QDF_STATUS
|
||||||
|
extract_spectral_caps_fixed_param_tlv(
|
||||||
|
wmi_unified_t wmi_handle, void *event,
|
||||||
|
struct spectral_capabilities_event_params *params)
|
||||||
|
{
|
||||||
|
WMI_SPECTRAL_CAPABILITIES_EVENTID_param_tlvs *param_buf = event;
|
||||||
|
|
||||||
|
if (!param_buf) {
|
||||||
|
wmi_err("param_buf is NULL");
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!params) {
|
||||||
|
wmi_err("event parameters is NULL");
|
||||||
|
return QDF_STATUS_E_NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
params->num_sscan_bw_caps = param_buf->num_sscan_bw_caps;
|
||||||
|
params->num_fft_size_caps = param_buf->num_fft_size_caps;
|
||||||
|
|
||||||
|
wmi_debug("num_sscan_bw_caps:%u num_fft_size_caps:%u",
|
||||||
|
params->num_sscan_bw_caps, params->num_fft_size_caps);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
||||||
|
|
||||||
#ifdef FEATURE_WPSS_THERMAL_MITIGATION
|
#ifdef FEATURE_WPSS_THERMAL_MITIGATION
|
||||||
@@ -17001,12 +17035,12 @@ struct wmi_ops tlv_ops = {
|
|||||||
extract_pdev_sscan_fw_cmd_fixed_param_tlv,
|
extract_pdev_sscan_fw_cmd_fixed_param_tlv,
|
||||||
.extract_pdev_sscan_fft_bin_index =
|
.extract_pdev_sscan_fft_bin_index =
|
||||||
extract_pdev_sscan_fft_bin_index_tlv,
|
extract_pdev_sscan_fft_bin_index_tlv,
|
||||||
#ifdef SPECTRAL_BERYLLIUM
|
|
||||||
.extract_pdev_spectral_session_chan_info =
|
.extract_pdev_spectral_session_chan_info =
|
||||||
extract_pdev_spectral_session_chan_info_tlv,
|
extract_pdev_spectral_session_chan_info_tlv,
|
||||||
.extract_pdev_spectral_session_detector_info =
|
.extract_pdev_spectral_session_detector_info =
|
||||||
extract_pdev_spectral_session_detector_info_tlv,
|
extract_pdev_spectral_session_detector_info_tlv,
|
||||||
#endif /* SPECTRAL_BERYLLIUM */
|
.extract_spectral_caps_fixed_param =
|
||||||
|
extract_spectral_caps_fixed_param_tlv,
|
||||||
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
#endif /* WLAN_CONV_SPECTRAL_ENABLE */
|
||||||
.send_thermal_mitigation_param_cmd =
|
.send_thermal_mitigation_param_cmd =
|
||||||
send_thermal_mitigation_param_cmd_tlv,
|
send_thermal_mitigation_param_cmd_tlv,
|
||||||
|
Reference in New Issue
Block a user