diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index 61ea4b3aac34..3d7b358e6e16 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -852,6 +852,8 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc, goto out; } + pmo_tgt_update_target_suspend_acked_flag(psoc, true); + host_credits = pmo_tgt_psoc_get_host_credits(psoc); wmi_pending_cmds = pmo_tgt_psoc_get_pending_cmnds(psoc); @@ -900,6 +902,8 @@ QDF_STATUS pmo_core_psoc_suspend_target(struct wlan_objmgr_psoc *psoc, pmo_tgt_update_target_suspend_flag(psoc, false); if (!psoc_ctx->wow.target_suspend.force_set) qdf_trigger_self_recovery(psoc, QDF_SUSPEND_TIMEOUT); + } else { + pmo_tgt_update_target_suspend_acked_flag(psoc, true); } out: @@ -1237,10 +1241,9 @@ QDF_STATUS pmo_core_psoc_send_host_wakeup_ind_to_fw( qdf_trigger_self_recovery(psoc, QDF_RESUME_TIMEOUT); } else { pmo_debug("Host wakeup received"); - } - - if (status == QDF_STATUS_SUCCESS) pmo_tgt_update_target_suspend_flag(psoc, false); + pmo_tgt_update_target_suspend_acked_flag(psoc, false); + } out: pmo_exit(); @@ -1310,10 +1313,9 @@ QDF_STATUS pmo_core_psoc_resume_target(struct wlan_objmgr_psoc *psoc, qdf_trigger_self_recovery(psoc, QDF_RESUME_TIMEOUT); } else { pmo_debug("Host wakeup received"); - } - - if (status == QDF_STATUS_SUCCESS) pmo_tgt_update_target_suspend_flag(psoc, false); + pmo_tgt_update_target_suspend_acked_flag(psoc, false); + } out: pmo_exit(); diff --git a/components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_public_struct.h index 2e394fe5b738..4fb2a5db0294 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_public_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -209,6 +209,8 @@ struct wlan_pmo_tx_ops { struct wlan_objmgr_psoc *psoc); void (*update_target_suspend_flag)( struct wlan_objmgr_psoc *psoc, uint8_t value); + void (*update_target_suspend_acked_flag)( + struct wlan_objmgr_psoc *psoc, uint8_t value); bool (*is_target_suspended)(struct wlan_objmgr_psoc *psoc); QDF_STATUS (*psoc_send_wow_enable_req)(struct wlan_objmgr_psoc *psoc, struct pmo_wow_cmd_params *param); diff --git a/components/pmo/dispatcher/inc/wlan_pmo_tgt_api.h b/components/pmo/dispatcher/inc/wlan_pmo_tgt_api.h index e08560b0e3ae..128fb038c158 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_tgt_api.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_tgt_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -377,10 +377,21 @@ int pmo_tgt_psoc_get_pending_cmnds(struct wlan_objmgr_psoc *psoc); * @psoc: objmgr psoc * @val: true on suspend false for resume * - * Return: Pending WMI commands on success else EAGAIN on error + * Return: None */ void pmo_tgt_update_target_suspend_flag(struct wlan_objmgr_psoc *psoc, - uint8_t val); + uint8_t val); + +/** + * pmo_tgt_update_target_suspend_acked_flag() - Set WMI target Suspend acked + * flag + * @psoc: objmgr psoc + * @val: true on suspend false for resume + * + * Return: None + */ +void pmo_tgt_update_target_suspend_acked_flag(struct wlan_objmgr_psoc *psoc, + uint8_t val); /** * pmo_tgt_is_target_suspended() - Get WMI target Suspend flag diff --git a/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c b/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c index 1c08a0de9f16..18960d5ad016 100644 --- a/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c +++ b/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -131,6 +131,19 @@ void pmo_tgt_update_target_suspend_flag(struct wlan_objmgr_psoc *psoc, pmo_tx_ops.update_target_suspend_flag(psoc, val); } +void pmo_tgt_update_target_suspend_acked_flag(struct wlan_objmgr_psoc *psoc, + uint8_t val) +{ + struct wlan_pmo_tx_ops pmo_tx_ops; + + pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc); + if (!pmo_tx_ops.update_target_suspend_acked_flag) { + pmo_err("update_target_suspend_acked_flag is null"); + return; + } + pmo_tx_ops.update_target_suspend_acked_flag(psoc, val); +} + bool pmo_tgt_is_target_suspended(struct wlan_objmgr_psoc *psoc) { struct wlan_pmo_tx_ops pmo_tx_ops; diff --git a/components/target_if/pmo/inc/target_if_pmo.h b/components/target_if/pmo/inc/target_if_pmo.h index d2991ea42934..c858bcb4db1b 100644 --- a/components/target_if/pmo/inc/target_if_pmo.h +++ b/components/target_if/pmo/inc/target_if_pmo.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -382,11 +382,23 @@ int target_if_pmo_psoc_get_pending_cmnds(struct wlan_objmgr_psoc *psoc); * @psoc: objmgr psoc * @value: value * - * Return: return wmi pending commands + * Return: None */ void target_if_pmo_update_target_suspend_flag(struct wlan_objmgr_psoc *psoc, uint8_t value); +/** + * target_if_pmo_update_target_suspend_acked_flag() - set wmi target suspend + * acked flag + * @psoc: objmgr psoc + * @value: value + * + * Return: None + */ +void target_if_pmo_update_target_suspend_acked_flag( + struct wlan_objmgr_psoc *psoc, + uint8_t value); + /** * target_if_pmo_is_target_suspended() - get wmi target suspend flag * @psoc: objmgr psoc diff --git a/components/target_if/pmo/src/target_if_pmo_main.c b/components/target_if/pmo/src/target_if_pmo_main.c index c769ce46828c..a0134d082877 100644 --- a/components/target_if/pmo/src/target_if_pmo_main.c +++ b/components/target_if/pmo/src/target_if_pmo_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -103,6 +103,8 @@ void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops) target_if_pmo_psoc_get_pending_cmnds; pmo_tx_ops->update_target_suspend_flag = target_if_pmo_update_target_suspend_flag; + pmo_tx_ops->update_target_suspend_acked_flag = + target_if_pmo_update_target_suspend_acked_flag; pmo_tx_ops->is_target_suspended = target_if_pmo_is_target_suspended; pmo_tx_ops->psoc_send_wow_enable_req = diff --git a/components/target_if/pmo/src/target_if_pmo_suspend_resume.c b/components/target_if/pmo/src/target_if_pmo_suspend_resume.c index 77f2974cfe0a..9263469e9e2d 100644 --- a/components/target_if/pmo/src/target_if_pmo_suspend_resume.c +++ b/components/target_if/pmo/src/target_if_pmo_suspend_resume.c @@ -201,6 +201,21 @@ void target_if_pmo_update_target_suspend_flag(struct wlan_objmgr_psoc *psoc, wmi_set_target_suspend(wmi_handle, value); } +void target_if_pmo_update_target_suspend_acked_flag( + struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + wmi_unified_t wmi_handle; + + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); + if (!wmi_handle) { + target_if_err("Invalid wmi handle"); + return; + } + + wmi_set_target_suspend_acked(wmi_handle, value); +} + bool target_if_pmo_is_target_suspended(struct wlan_objmgr_psoc *psoc) { wmi_unified_t wmi_handle;