diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 01c72ad5ed..ed54a314fe 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -496,6 +496,13 @@ int wmi_get_pending_cmds(wmi_unified_t wmi_handle); */ void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val); +/** + * WMI API to set target suspend command acked flag + * @param wmi_handle : handle to WMI. + * @param val : suspend command acked flag boolean + */ +void wmi_set_target_suspend_acked(wmi_unified_t wmi_handle, bool val); + /** * wmi_is_target_suspended() - WMI API to check target suspend state * @wmi_handle: handle to WMI. @@ -506,6 +513,17 @@ void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val); */ bool wmi_is_target_suspended(struct wmi_unified *wmi_handle); +/** + * wmi_is_target_suspend_acked() - WMI API to check target suspend command is + * acked or not + * @wmi_handle: handle to WMI. + * + * WMI API to check whether the target suspend command is acked or not + * + * Return: true if target suspend command is acked, else false. + */ +bool wmi_is_target_suspend_acked(struct wmi_unified *wmi_handle); + #ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI /** * wmi_set_qmi_stats() - WMI API to set qmi stats enabled/disabled diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 6d928d6c45..9c744ffef1 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -2532,6 +2532,7 @@ struct wmi_unified { #endif /*WMI_INTERFACE_EVENT_LOGGING */ qdf_atomic_t is_target_suspended; + qdf_atomic_t is_target_suspend_acked; #ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI bool is_qmi_stats_enabled; #endif diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index ba8c7e883a..7c88ddd753 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -3117,6 +3117,7 @@ void *wmi_unified_attach(void *scn_handle, qdf_atomic_init(&wmi_handle->pending_cmds); qdf_atomic_init(&wmi_handle->is_target_suspended); + qdf_atomic_init(&wmi_handle->is_target_suspend_acked); qdf_atomic_init(&wmi_handle->num_stats_over_qmi); wmi_runtime_pm_init(wmi_handle); wmi_interface_logging_init(wmi_handle, WMI_HOST_PDEV_ID_0); @@ -3515,6 +3516,19 @@ void wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val) qdf_atomic_set(&wmi_handle->is_target_suspended, val); } +/** + * wmi_set_target_suspend_acked() - WMI API to set target suspend acked flag + * + * @wmi_handle: handle to WMI. + * @val: target suspend command acked flag. + * + * @Return: none. + */ +void wmi_set_target_suspend_acked(wmi_unified_t wmi_handle, A_BOOL val) +{ + qdf_atomic_set(&wmi_handle->is_target_suspend_acked, val); +} + /** * wmi_is_target_suspended() - WMI API to check target suspend state * @wmi_handle: handle to WMI. @@ -3529,6 +3543,21 @@ bool wmi_is_target_suspended(struct wmi_unified *wmi_handle) } qdf_export_symbol(wmi_is_target_suspended); +/** + * wmi_is_target_suspend_acked() - WMI API to check target suspend command is + * acked or not + * @wmi_handle: handle to WMI. + * + * WMI API to check whether the target suspend command is acked or not + * + * Return: true if target suspend command is acked, else false. + */ +bool wmi_is_target_suspend_acked(struct wmi_unified *wmi_handle) +{ + return qdf_atomic_read(&wmi_handle->is_target_suspend_acked); +} +qdf_export_symbol(wmi_is_target_suspend_acked); + #ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val) { diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 600de8b734..c491b54539 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -723,7 +723,7 @@ QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle, if (!wmi_is_qmi_stats_enabled(wmi_handle)) goto send_over_wmi; - if (wmi_is_target_suspended(wmi_handle)) { + if (wmi_is_target_suspend_acked(wmi_handle)) { if (QDF_IS_STATUS_SUCCESS( wmi_unified_cmd_send_over_qmi(wmi_handle, buf, buflen, cmd_id)))