From 209a75fa6c31a9d540afc7a1e0ed4ad7accc3efc Mon Sep 17 00:00:00 2001 From: Deeksha Gupta Date: Mon, 19 Apr 2021 10:25:30 +0530 Subject: [PATCH] qcacmn: Convert WMI status code for TWT get_stats Convert firmware enum WMI_GET_STATS_TWT_STATUS_T status code into host enum WMI_HOST_GET_STATS_TWT_STATUS. Change-Id: I8fbb497bff11a3629689d6d8e2be5b8c9835b2de CRs-Fixed: 2923085 --- wmi/inc/wmi_unified_twt_param.h | 13 +++++++++++++ wmi/src/wmi_unified_cp_stats_tlv.c | 17 ++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/wmi/inc/wmi_unified_twt_param.h b/wmi/inc/wmi_unified_twt_param.h index 018c839932..5121edb287 100644 --- a/wmi/inc/wmi_unified_twt_param.h +++ b/wmi/inc/wmi_unified_twt_param.h @@ -290,6 +290,19 @@ struct wmi_twt_add_dialog_param { b_twt_recommendation:3; }; +/* enum - status code of Get stats TWT dialog + * @WMI_HOST_GET_STATS_TWT_STATUS_OK: Get status TWT dialog successfully completed + * @WMI_HOST_GET_STATS_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID does not exist + * @WMI_HOST_GET_STATS_TWT_STATUS_INVALID_PARAM: Invalid parameters + * @WMI_HOST_GET_STATS_TWT_STATUS_UNKNOWN_ERROR: Unknown error + */ +enum WMI_HOST_GET_STATS_TWT_STATUS { + WMI_HOST_GET_STATS_TWT_STATUS_OK, + WMI_HOST_GET_STATS_TWT_STATUS_DIALOG_ID_NOT_EXIST, + WMI_HOST_GET_STATS_TWT_STATUS_INVALID_PARAM, + WMI_HOST_GET_STATS_TWT_STATUS_UNKNOWN_ERROR, +}; + /* enum - status code of adding TWT dialog * @WMI_HOST_ADD_TWT_STATUS_OK: adding TWT dialog successfully completed * @WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED: TWT not enabled diff --git a/wmi/src/wmi_unified_cp_stats_tlv.c b/wmi/src/wmi_unified_cp_stats_tlv.c index 5ce6d57cb9..f2ca0688db 100644 --- a/wmi/src/wmi_unified_cp_stats_tlv.c +++ b/wmi/src/wmi_unified_cp_stats_tlv.c @@ -29,6 +29,21 @@ get_stats_req_twt_dialog_id(struct infra_cp_stats_cmd_info *req) return req->dialog_id; } +static enum WMI_HOST_GET_STATS_TWT_STATUS +wmi_get_converted_twt_get_stats_status(WMI_GET_STATS_TWT_STATUS_T tgt_status) +{ + switch (tgt_status) { + case WMI_GET_STATS_TWT_STATUS_OK: + return WMI_HOST_GET_STATS_TWT_STATUS_OK; + case WMI_GET_STATS_TWT_STATUS_DIALOG_ID_NOT_EXIST: + return WMI_HOST_GET_STATS_TWT_STATUS_DIALOG_ID_NOT_EXIST; + case WMI_GET_STATS_TWT_STATUS_INVALID_PARAM: + return WMI_HOST_GET_STATS_TWT_STATUS_INVALID_PARAM; + default: + return WMI_HOST_GET_STATS_TWT_STATUS_UNKNOWN_ERROR; + } +} + static inline void wmi_extract_ctrl_path_twt_stats_tlv(void *tag_buf, struct twt_infra_cp_stats_event *param) @@ -37,7 +52,7 @@ void wmi_extract_ctrl_path_twt_stats_tlv(void *tag_buf, (wmi_ctrl_path_twt_stats_struct *)tag_buf; param->dialog_id = wmi_stats_buf->dialog_id; - param->status = wmi_stats_buf->status; + param->status = wmi_get_converted_twt_get_stats_status(wmi_stats_buf->status); param->num_sp_cycles = wmi_stats_buf->num_sp_cycles; param->avg_sp_dur_us = wmi_stats_buf->avg_sp_dur_us; param->min_sp_dur_us = wmi_stats_buf->min_sp_dur_us;