qcacmn: Change FIPS event extract APIs
Add pdev_id in FIPS extract params to be used to get appropriate pdev. Also refactor extart APIs to get all data in one API and implement TLV APIs. Change-Id: Ib58d54ad0dcc25814e58f45e7e4a83d01549a523 CRs-Fixed: 1115213
This commit is contained in:
@@ -5252,43 +5252,22 @@ QDF_STATUS wmi_extract_dcs_im_tgt_stats(void *wmi_hdl, void *evt_buf,
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* wmi_extract_fips_event_error_status() - extract fips event error status
|
|
||||||
* @wmi_handle: wmi handle
|
|
||||||
* @param evt_buf: pointer to event buffer
|
|
||||||
* @param err_status: Pointer to hold error status
|
|
||||||
*
|
|
||||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
||||||
*/
|
|
||||||
QDF_STATUS wmi_extract_fips_event_error_status(void *wmi_hdl, void *evt_buf,
|
|
||||||
uint32_t *err_status)
|
|
||||||
{
|
|
||||||
wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
|
|
||||||
|
|
||||||
if (wmi->ops->extract_fips_event_error_status) {
|
|
||||||
return wmi->ops->extract_fips_event_error_status(wmi,
|
|
||||||
evt_buf, err_status);
|
|
||||||
}
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmi_extract_fips_event_data() - extract fips event data
|
* wmi_extract_fips_event_data() - extract fips event data
|
||||||
* @wmi_handle: wmi handle
|
* @wmi_handle: wmi handle
|
||||||
* @param evt_buf: pointer to event buffer
|
* @param evt_buf: pointer to event buffer
|
||||||
* @param data_len: Pointer to hold fips data length
|
* @param param: pointer to FIPS event param
|
||||||
* @param data: Double pointer to hold fips data
|
|
||||||
*
|
*
|
||||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||||
*/
|
*/
|
||||||
QDF_STATUS wmi_extract_fips_event_data(void *wmi_hdl, void *evt_buf,
|
QDF_STATUS wmi_extract_fips_event_data(void *wmi_hdl, void *evt_buf,
|
||||||
uint32_t *data_len, uint32_t **data)
|
struct wmi_host_fips_event_param *param)
|
||||||
{
|
{
|
||||||
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
|
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
|
||||||
|
|
||||||
if (wmi_handle->ops->extract_fips_event_data) {
|
if (wmi_handle->ops->extract_fips_event_data) {
|
||||||
return wmi_handle->ops->extract_fips_event_data(wmi_handle,
|
return wmi_handle->ops->extract_fips_event_data(wmi_handle,
|
||||||
evt_buf, data_len, data);
|
evt_buf, param);
|
||||||
}
|
}
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
@@ -5836,36 +5836,17 @@ static QDF_STATUS extract_dcs_im_tgt_stats_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* extract_fips_event_error_status_non_tlv() - extract fips event error status
|
|
||||||
* @wmi_handle: wmi handle
|
|
||||||
* @param evt_buf: pointer to event buffer
|
|
||||||
* @param err_status: Pointer to hold error status
|
|
||||||
*
|
|
||||||
* Return: 0 for success or error code
|
|
||||||
*/
|
|
||||||
static QDF_STATUS extract_fips_event_error_status_non_tlv(
|
|
||||||
wmi_unified_t wmi_handle, void *evt_buf,
|
|
||||||
uint32_t *err_status)
|
|
||||||
{
|
|
||||||
wmi_pdev_fips_event *event = (wmi_pdev_fips_event *)evt_buf;
|
|
||||||
|
|
||||||
*err_status = event->error_status;
|
|
||||||
return QDF_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* extract_fips_event_data_non_tlv() - extract fips event data
|
* extract_fips_event_data_non_tlv() - extract fips event data
|
||||||
* @wmi_handle: wmi handle
|
* @wmi_handle: wmi handle
|
||||||
* @param evt_buf: pointer to event buffer
|
* @param evt_buf: pointer to event buffer
|
||||||
* @param data_len: Pointer to hold fips data length
|
* @param param: pointer FIPS event params
|
||||||
* @param data: Double pointer to hold fips data
|
|
||||||
*
|
*
|
||||||
* Return: 0 for success or error code
|
* Return: 0 for success or error code
|
||||||
*/
|
*/
|
||||||
static QDF_STATUS extract_fips_event_data_non_tlv(wmi_unified_t wmi_handle,
|
static QDF_STATUS extract_fips_event_data_non_tlv(wmi_unified_t wmi_handle,
|
||||||
void *evt_buf,
|
void *evt_buf,
|
||||||
uint32_t *data_len, uint32_t **data)
|
struct wmi_host_fips_event_param *param)
|
||||||
{
|
{
|
||||||
wmi_pdev_fips_event *event = (wmi_pdev_fips_event *)evt_buf;
|
wmi_pdev_fips_event *event = (wmi_pdev_fips_event *)evt_buf;
|
||||||
#ifdef BIG_ENDIAN_HOST
|
#ifdef BIG_ENDIAN_HOST
|
||||||
@@ -5912,8 +5893,10 @@ static QDF_STATUS extract_fips_event_data_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
/*************************************************************/
|
/*************************************************************/
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*data = event->data;
|
param->data = event->data;
|
||||||
*data_len = event->data_len;
|
param->data_len = event->data_len;
|
||||||
|
param->error_status = event->error_status;
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8096,8 +8079,6 @@ struct wmi_ops non_tlv_ops = {
|
|||||||
extract_tx_data_traffic_ctrl_ev_non_tlv,
|
extract_tx_data_traffic_ctrl_ev_non_tlv,
|
||||||
.extract_vdev_extd_stats = extract_vdev_extd_stats_non_tlv,
|
.extract_vdev_extd_stats = extract_vdev_extd_stats_non_tlv,
|
||||||
.extract_fips_event_data = extract_fips_event_data_non_tlv,
|
.extract_fips_event_data = extract_fips_event_data_non_tlv,
|
||||||
.extract_fips_event_error_status =
|
|
||||||
extract_fips_event_error_status_non_tlv,
|
|
||||||
.extract_mumimo_tx_count_ev_param =
|
.extract_mumimo_tx_count_ev_param =
|
||||||
extract_mumimo_tx_count_ev_param_non_tlv,
|
extract_mumimo_tx_count_ev_param_non_tlv,
|
||||||
.extract_peer_gid_userpos_list_ev_param =
|
.extract_peer_gid_userpos_list_ev_param =
|
||||||
|
@@ -13105,6 +13105,97 @@ static QDF_STATUS extract_dcs_im_tgt_stats_tlv(wmi_unified_t wmi_handle,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef BIG_ENDIAN_HOST
|
||||||
|
/**
|
||||||
|
* fips_conv_data_be() - LE to BE conversion of FIPS ev data
|
||||||
|
* @param data_len - data length
|
||||||
|
* @param data - pointer to data
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS - success or error status
|
||||||
|
*/
|
||||||
|
static QDF_STATUS fips_conv_data_be(uint32_t data_len, uint8_t *data)
|
||||||
|
{
|
||||||
|
uint8_t *data_aligned = NULL;
|
||||||
|
int c;
|
||||||
|
unsigned char *data_unaligned;
|
||||||
|
|
||||||
|
data_unaligned = qdf_mem_malloc(((sizeof(uint8_t) * data_len) +
|
||||||
|
FIPS_ALIGN));
|
||||||
|
/* Assigning unaligned space to copy the data */
|
||||||
|
/* Checking if kmalloc does succesful allocation */
|
||||||
|
if (data_unaligned == NULL)
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
|
/* Checking if space is alligned */
|
||||||
|
if (!FIPS_IS_ALIGNED(data_unaligned, FIPS_ALIGN)) {
|
||||||
|
/* align the data space */
|
||||||
|
data_aligned =
|
||||||
|
(uint8_t *)FIPS_ALIGNTO(data_unaligned, FIPS_ALIGN);
|
||||||
|
} else {
|
||||||
|
data_aligned = (u_int8_t *)data_unaligned;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* memset and copy content from data to data aligned */
|
||||||
|
OS_MEMSET(data_aligned, 0, data_len);
|
||||||
|
OS_MEMCPY(data_aligned, data, data_len);
|
||||||
|
/* Endianness to LE */
|
||||||
|
for (c = 0; c < data_len/4; c++) {
|
||||||
|
*((u_int32_t *)data_aligned + c) =
|
||||||
|
qdf_os_le32_to_cpu(*((u_int32_t *)data_aligned + c));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Copy content to event->data */
|
||||||
|
OS_MEMCPY(data, data_aligned, data_len);
|
||||||
|
|
||||||
|
/* clean up allocated space */
|
||||||
|
qdf_mem_free(data_unaligned);
|
||||||
|
data_aligned = NULL;
|
||||||
|
data_unaligned = NULL;
|
||||||
|
|
||||||
|
/*************************************************************/
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* fips_conv_data_be() - DUMMY for LE platform
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS - success
|
||||||
|
*/
|
||||||
|
static QDF_STATUS fips_conv_data_be(uint32_t data_len, uint8_t *data)
|
||||||
|
{
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extract_fips_event_data_tlv() - extract fips event data
|
||||||
|
* @wmi_handle: wmi handle
|
||||||
|
* @param evt_buf: pointer to event buffer
|
||||||
|
* @param param: pointer FIPS event params
|
||||||
|
*
|
||||||
|
* Return: 0 for success or error code
|
||||||
|
*/
|
||||||
|
static QDF_STATUS extract_fips_event_data_tlv(wmi_unified_t wmi_handle,
|
||||||
|
void *evt_buf, struct wmi_host_fips_event_param *param)
|
||||||
|
{
|
||||||
|
WMI_PDEV_FIPS_EVENTID_param_tlvs *param_buf;
|
||||||
|
wmi_pdev_fips_event_fixed_param *event;
|
||||||
|
|
||||||
|
param_buf = (WMI_PDEV_FIPS_EVENTID_param_tlvs *) evt_buf;
|
||||||
|
event = (wmi_pdev_fips_event_fixed_param *) param_buf->fixed_param;
|
||||||
|
|
||||||
|
if (fips_conv_data_be(event->data_len, param_buf->data) !=
|
||||||
|
QDF_STATUS_SUCCESS)
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
|
param->data = (uint32_t *)param_buf->data;
|
||||||
|
param->data_len = event->data_len;
|
||||||
|
param->error_status = event->error_status;
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
||||||
static bool is_management_record_tlv(uint32_t cmd_id)
|
static bool is_management_record_tlv(uint32_t cmd_id)
|
||||||
{
|
{
|
||||||
@@ -13497,6 +13588,7 @@ struct wmi_ops tlv_ops = {
|
|||||||
.extract_dcs_interference_type = extract_dcs_interference_type_tlv,
|
.extract_dcs_interference_type = extract_dcs_interference_type_tlv,
|
||||||
.extract_dcs_cw_int = extract_dcs_cw_int_tlv,
|
.extract_dcs_cw_int = extract_dcs_cw_int_tlv,
|
||||||
.extract_dcs_im_tgt_stats = extract_dcs_im_tgt_stats_tlv,
|
.extract_dcs_im_tgt_stats = extract_dcs_im_tgt_stats_tlv,
|
||||||
|
.extract_fips_event_data = extract_fips_event_data_tlv,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef CONFIG_MCL
|
#ifndef CONFIG_MCL
|
||||||
|
Reference in New Issue
Block a user