diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 1cfb8bc661..52425f3930 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -4463,4 +4463,16 @@ wmi_extract_halphy_cal_ev_param(wmi_unified_t wmi_handle, void *evt_buf, struct wmi_host_pdev_set_halphy_cal_event *param); +#ifdef FEATURE_MEC_OFFLOAD +/** + * wmi_unified_pdev_set_mec_timer() - set mec timer value + * @wmi_handle: wmi handle + * @param: params needed for mec timer config + * + * Return: QDF_STATUS_SUCCESS for success or error code + */ +QDF_STATUS +wmi_unified_pdev_set_mec_timer(struct wmi_unified *wmi_handle, + struct set_mec_timer_params *param); +#endif #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index d6896ebfcd..d87a32ab23 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -8171,4 +8171,18 @@ struct wmi_host_pdev_set_halphy_cal_event { enum wmi_host_set_halphy_cal_status status; }; +#ifdef FEATURE_MEC_OFFLOAD +/** + * struct set_mec_timer_params - params MEC timer params + * @pdev_id: unique id identifying the PDEV, generated by the caller + * @vdev_id: unique id identifying the VDEV, generated by the caller + * @mec_aging_timer_threshold: The Threshold for mec aging timer in ms + * @enable: Enable/Disable the command + */ +struct set_mec_timer_params { + uint32_t pdev_id; + uint32_t vdev_id; + uint32_t mec_aging_timer_threshold; +}; +#endif #endif /* _WMI_UNIFIED_PARAM_H_ */ diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index df96e599ab..afd2dce655 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -449,6 +449,11 @@ QDF_STATUS struct roam_pmkid_req_event **list); #endif /* ROAM_TARGET_IF_CONVERGENCE */ #endif +#ifdef FEATURE_MEC_OFFLOAD +QDF_STATUS +(*send_pdev_set_mec_timer_cmd)(struct wmi_unified *wmi_handle, + struct set_mec_timer_params *param); +#endif QDF_STATUS (*send_vdev_create_cmd)(wmi_unified_t wmi_handle, uint8_t macaddr[QDF_MAC_ADDR_SIZE], struct vdev_create_params *param); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 31695171ac..929952b32c 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -3560,3 +3560,16 @@ wmi_unified_send_set_halphy_cal(wmi_unified_t wmi_handle, return QDF_STATUS_E_FAILURE; } + +#ifdef FEATURE_MEC_OFFLOAD +QDF_STATUS +wmi_unified_pdev_set_mec_timer(struct wmi_unified *wmi_handle, + struct set_mec_timer_params *param) +{ + if (wmi_handle->ops->send_pdev_set_mec_timer_cmd) + return wmi_handle->ops->send_pdev_set_mec_timer_cmd(wmi_handle, + param); + + return QDF_STATUS_E_FAILURE; +} +#endif diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 23f635540f..68dcb22823 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -14871,6 +14871,41 @@ static QDF_STATUS send_mws_coex_status_req_cmd_tlv(wmi_unified_t wmi_handle, } #endif +#ifdef FEATURE_MEC_OFFLOAD +static QDF_STATUS +send_pdev_set_mec_timer_cmd_tlv(struct wmi_unified *wmi_handle, + struct set_mec_timer_params *param) +{ + wmi_pdev_mec_aging_timer_config_cmd_fixed_param *cmd; + wmi_buf_t buf; + int32_t len = sizeof(*cmd); + + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + wmi_err("wmi_buf_alloc failed"); + return QDF_STATUS_E_FAILURE; + } + cmd = (wmi_pdev_mec_aging_timer_config_cmd_fixed_param *) + wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_pdev_mec_aging_timer_config_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_pdev_mec_aging_timer_config_cmd_fixed_param)); + cmd->pdev_id = param->pdev_id; + cmd->mec_aging_timer_threshold = param->mec_aging_timer_threshold; + + wmi_mtrace(WMI_PDEV_MEC_AGING_TIMER_CONFIG_CMDID, param->vdev_id, 0); + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PDEV_MEC_AGING_TIMER_CONFIG_CMDID)) { + wmi_err("Failed to set mec aging timer param"); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} +#endif + #ifdef WIFI_POS_CONVERGED /** * extract_oem_response_param_tlv() - Extract oem response params @@ -16563,6 +16598,9 @@ struct wmi_ops tlv_ops = { .send_roam_scan_ch_list_req_cmd = send_roam_scan_ch_list_req_cmd_tlv, .send_injector_config_cmd = send_injector_config_cmd_tlv, .send_cp_stats_cmd = send_cp_stats_cmd_tlv, +#ifdef FEATURE_MEC_OFFLOAD + .send_pdev_set_mec_timer_cmd = send_pdev_set_mec_timer_cmd_tlv, +#endif #ifdef WLAN_SUPPORT_INFRA_CTRL_PATH_STATS .extract_infra_cp_stats = extract_infra_cp_stats_tlv, #endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */