diff --git a/core/utils/host_diag_log/src/host_diag_log.c b/core/utils/host_diag_log/src/host_diag_log.c index 05c3ea25e5..2fd1b3566f 100644 --- a/core/utils/host_diag_log/src/host_diag_log.c +++ b/core/utils/host_diag_log/src/host_diag_log.c @@ -41,6 +41,7 @@ #include "wlan_ptt_sock_svc.h" #include "wlan_nlink_srv.h" #include "cds_api.h" +#include "wlan_ps_wow_diag.h" #define PTT_MSG_DIAG_CMDS_TYPE (0x5050) @@ -283,3 +284,25 @@ void host_log_low_resource_failure(uint8_t event_sub_type) WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event, EVENT_WLAN_LOW_RESOURCE_FAILURE); } + +#ifdef FEATURE_WLAN_DIAG_SUPPORT +/** + * qdf_wow_wakeup_host_event()- send wow wakeup event + * @wow_wakeup_cause: WOW wakeup reason code + * + * This function sends wow wakeup reason code diag event + * + * Return: void. + */ +void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause) +{ + WLAN_HOST_DIAG_EVENT_DEF(wowRequest, + host_event_wlan_powersave_wow_payload_type); + qdf_mem_zero(&wowRequest, sizeof(wowRequest)); + + wowRequest.event_subtype = WLAN_WOW_WAKEUP; + wowRequest.wow_wakeup_cause = wow_wakeup_cause; + WLAN_HOST_DIAG_EVENT_REPORT(&wowRequest, + EVENT_WLAN_POWERSAVE_WOW); +} +#endif diff --git a/core/utils/host_diag_log/src/i_host_diag_core_event.h b/core/utils/host_diag_log/src/i_host_diag_core_event.h index b17ac85621..b90bae7fd2 100644 --- a/core/utils/host_diag_log/src/i_host_diag_core_event.h +++ b/core/utils/host_diag_log/src/i_host_diag_core_event.h @@ -115,6 +115,14 @@ static inline void host_log_low_resource_failure(uint8_t event_sub_type) } #endif /* FEATURE_WLAN_DIAG_SUPPORT */ +#ifdef FEATURE_WLAN_DIAG_SUPPORT +void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause); +#else +static inline void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause) +{ + return; +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 802d9eed42..bfe1953b85 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -3116,10 +3116,12 @@ int wma_wow_wakeup_host_event(void *handle, uint8_t *event, if ((wake_info->wake_reason != WOW_REASON_UNSPECIFIED) || (wake_info->wake_reason == WOW_REASON_UNSPECIFIED && - !wmi_get_runtime_pm_inprogress(wma->wmi_handle))) + !wmi_get_runtime_pm_inprogress(wma->wmi_handle))) { WMA_LOGA("WOW wakeup host event received (reason: %s(%d)) for vdev %d", wma_wow_wake_reason_str(wake_info->wake_reason), wake_info->wake_reason, wake_info->vdev_id); + qdf_wow_wakeup_host_event(wake_info->wake_reason); + } qdf_event_set(&wma->wma_resume_event);