diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 9bbb5e6854be..96629fac9fc5 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -506,6 +506,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. @@ -516,6 +523,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 3f910809436b..387970b7b0f2 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -2536,6 +2536,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 f2513e553dc3..15487b721d49 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -3095,6 +3095,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); @@ -3505,6 +3506,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. @@ -3519,6 +3533,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 75c20713b8cb..66b1ecc26ac8 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)))