diff --git a/wmi/inc/wmi_unified_pmo_api.h b/wmi/inc/wmi_unified_pmo_api.h index e32e6935ec..8adfe00ad0 100644 --- a/wmi/inc/wmi_unified_pmo_api.h +++ b/wmi/inc/wmi_unified_pmo_api.h @@ -330,13 +330,15 @@ QDF_STATUS wmi_unified_wow_delete_pattern_cmd(wmi_unified_t wmi_handle, /** * wmi_unified_host_wakeup_ind_to_fw_cmd() - send wakeup ind to fw * @wmi_handle: wmi handle + * @tx_pending_ind: flag of TX has pending frames * * Sends host wakeup indication to FW. On receiving this indication, * FW will come out of WOW. * * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ -QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle); +QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle, + bool tx_pending_ind); /** * wmi_unified_wow_timer_pattern_cmd() - set timer pattern tlv, so that diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 98f8b4b3bc..d80f390050 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -960,7 +960,8 @@ QDF_STATUS (*send_wow_delete_pattern_cmd)(wmi_unified_t wmi_handle, uint8_t ptrn_id, uint8_t vdev_id); -QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle); +QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle, + bool tx_pending_ind); QDF_STATUS (*send_wow_timer_pattern_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id, uint32_t cookie, uint32_t time); diff --git a/wmi/src/wmi_unified_pmo_api.c b/wmi/src/wmi_unified_pmo_api.c index b7ba6660aa..928b99ad75 100644 --- a/wmi/src/wmi_unified_pmo_api.c +++ b/wmi/src/wmi_unified_pmo_api.c @@ -308,10 +308,13 @@ QDF_STATUS wmi_unified_wow_delete_pattern_cmd(wmi_unified_t wmi_handle, return QDF_STATUS_E_FAILURE; } -QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle) +QDF_STATUS wmi_unified_host_wakeup_ind_to_fw_cmd(wmi_unified_t wmi_handle, + bool tx_pending_ind) { if (wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd) - return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd(wmi_handle); + return wmi_handle->ops->send_host_wakeup_ind_to_fw_cmd + (wmi_handle, + tx_pending_ind); return QDF_STATUS_E_FAILURE; } diff --git a/wmi/src/wmi_unified_pmo_tlv.c b/wmi/src/wmi_unified_pmo_tlv.c index 9ffe773248..5579316b1c 100644 --- a/wmi/src/wmi_unified_pmo_tlv.c +++ b/wmi/src/wmi_unified_pmo_tlv.c @@ -1682,16 +1682,19 @@ QDF_STATUS wmi_unified_cmd_send_chk(struct wmi_unified *wmi_handle, } #endif +#define WMI_WAKEUP_TX_PEDNING_IND 1 /** * send_host_wakeup_ind_to_fw_cmd_tlv() - send wakeup ind to fw * @wmi_handle: wmi handle + * @tx_pending_ind: flag of TX has pending frames * * Sends host wakeup indication to FW. On receiving this indication, * FW will come out of WOW. * * Return: CDF status */ -static QDF_STATUS send_host_wakeup_ind_to_fw_cmd_tlv(wmi_unified_t wmi_handle) +static QDF_STATUS send_host_wakeup_ind_to_fw_cmd_tlv(wmi_unified_t wmi_handle, + bool tx_pending_ind) { wmi_wow_hostwakeup_from_sleep_cmd_fixed_param *cmd; wmi_buf_t buf; @@ -1708,6 +1711,12 @@ static QDF_STATUS send_host_wakeup_ind_to_fw_cmd_tlv(wmi_unified_t wmi_handle) cmd = (wmi_wow_hostwakeup_from_sleep_cmd_fixed_param *) wmi_buf_data(buf); + + if (tx_pending_ind) { + wmi_debug("TX pending before WoW wake, indicate FW"); + cmd->reserved0 |= WMI_WAKEUP_TX_PEDNING_IND; + } + WMITLV_SET_HDR(&cmd->tlv_header, WMITLV_TAG_STRUC_wmi_wow_hostwakeup_from_sleep_cmd_fixed_param, WMITLV_GET_STRUCT_TLVLEN