diff --git a/wmi/inc/wmi_unified_cp_stats_api.h b/wmi/inc/wmi_unified_cp_stats_api.h index 1a1b8ac9d3..00ad4960d6 100644 --- a/wmi/inc/wmi_unified_cp_stats_api.h +++ b/wmi/inc/wmi_unified_cp_stats_api.h @@ -76,6 +76,20 @@ QDF_STATUS wmi_unified_stats_request_send(wmi_unified_t wmi_handle, uint8_t macaddr[QDF_MAC_ADDR_SIZE], struct stats_request_params *param); +#ifdef WLAN_FEATURE_BIG_DATA_STATS +/** + * wmi_unified_big_data_stats_request_send() - WMI request big data stats + * function + * @wmi_handle: handle to WMI + * @param: pointer to hold stats request parameter + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS +wmi_unified_big_data_stats_request_send(wmi_unified_t wmi_handle, + struct stats_request_params *param); +#endif + /** * wmi_extract_stats_param() - extract all stats count from event * @wmi_handle: wmi handle diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index d704ee164a..865326807a 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -2513,6 +2513,11 @@ QDF_STATUS (*config_peer_latency_info_cmd)( QDF_STATUS (*send_set_tpc_power_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id, struct reg_tpc_power_info *param); +#ifdef WLAN_FEATURE_BIG_DATA_STATS +QDF_STATUS (*send_big_data_stats_request_cmd)( + wmi_unified_t wmi_handle, + struct stats_request_params *param); +#endif }; /* Forward declartion for psoc*/ diff --git a/wmi/src/wmi_unified_cp_stats_api.c b/wmi/src/wmi_unified_cp_stats_api.c index 7311dce6b6..805f7d9b19 100644 --- a/wmi/src/wmi_unified_cp_stats_api.c +++ b/wmi/src/wmi_unified_cp_stats_api.c @@ -61,6 +61,20 @@ QDF_STATUS wmi_unified_stats_request_send(wmi_unified_t wmi_handle, return QDF_STATUS_E_FAILURE; } +#ifdef WLAN_FEATURE_BIG_DATA_STATS +QDF_STATUS +wmi_unified_big_data_stats_request_send(wmi_unified_t wmi_handle, + struct stats_request_params *param) +{ + if (wmi_handle->ops->send_big_data_stats_request_cmd) + return wmi_handle->ops->send_big_data_stats_request_cmd( + wmi_handle, + param); + + return QDF_STATUS_E_FAILURE; +} +#endif + QDF_STATUS wmi_extract_stats_param(wmi_unified_t wmi_handle, void *evt_buf, wmi_host_stats_event *stats_param) diff --git a/wmi/src/wmi_unified_cp_stats_tlv.c b/wmi/src/wmi_unified_cp_stats_tlv.c index ee846b9b62..08d06196d5 100644 --- a/wmi/src/wmi_unified_cp_stats_tlv.c +++ b/wmi/src/wmi_unified_cp_stats_tlv.c @@ -408,6 +408,51 @@ send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, return qdf_status_from_os_return(ret); } +#ifdef WLAN_FEATURE_BIG_DATA_STATS +/** + * send_big_data_stats_request_cmd_tlv () - send big data stats cmd + * @wmi_handle: wmi handle + * @param : pointer to command request param + * + * Return: QDF_STATUS_SUCCESS for success or error code + */ +static QDF_STATUS +send_big_data_stats_request_cmd_tlv(wmi_unified_t wmi_handle, + struct stats_request_params *param) +{ + int32_t ret = 0; + wmi_vdev_get_big_data_p2_cmd_fixed_param *cmd; + wmi_buf_t buf; + uint16_t len = sizeof(wmi_vdev_get_big_data_p2_cmd_fixed_param); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) + return QDF_STATUS_E_NOMEM; + + cmd = (wmi_vdev_get_big_data_p2_cmd_fixed_param *)wmi_buf_data(buf); + WMITLV_SET_HDR( + &cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_get_big_data_p2_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN + (wmi_vdev_get_big_data_p2_cmd_fixed_param)); + + cmd->vdev_id = param->vdev_id; + + wmi_debug("STATS VDEV_ID:%d -->", cmd->vdev_id); + + wmi_mtrace(WMI_VDEV_GET_BIG_DATA_P2_CMDID, cmd->vdev_id, 0); + ret = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_VDEV_GET_BIG_DATA_P2_CMDID); + + if (ret) { + wmi_err("Failed to send big data stats request to fw =%d", ret); + wmi_buf_free(buf); + } + + return qdf_status_from_os_return(ret); +} +#endif + /** * extract_all_stats_counts_tlv() - extract all stats count from event * @param wmi_handle: wmi handle @@ -857,6 +902,10 @@ void wmi_cp_stats_attach_tlv(wmi_unified_t wmi_handle) struct wmi_ops *ops = wmi_handle->ops; ops->send_stats_request_cmd = send_stats_request_cmd_tlv; +#ifdef WLAN_FEATURE_BIG_DATA_STATS + ops->send_big_data_stats_request_cmd = + send_big_data_stats_request_cmd_tlv; +#endif ops->extract_all_stats_count = extract_all_stats_counts_tlv; ops->extract_pdev_stats = extract_pdev_stats_tlv; ops->extract_vdev_stats = extract_vdev_stats_tlv;