qcacld-3.0: Set system suspend/resume state in hif ctx

Set system state in hif ctx to suspend or resume on
system suspend and resume respectively.

Change-Id: If1904a4fe5c861deed1b35071be10cb8cc8d6407
CRs-Fixed: 2899520
This commit is contained in:
Yeshwanth Sriram Guntuka 2021-03-09 23:43:00 +05:30 • committed by snandini
commit 7108fe3ca7
7 changed files with 72 additions and 0 deletions

1
Kbuild
View file

@ -3303,6 +3303,7 @@ cppflags-y += -DDP_RX_DESC_COOKIE_INVALIDATE
cppflags-y += -DMON_ENABLE_DROP_FOR_MAC
cppflags-y += -DPCI_LINK_STATUS_SANITY
cppflags-y += -DDP_MON_RSSI_IN_DBM
cppflags-y += -DSYSTEM_PM_CHECK
endif
# Enable Low latency optimisation mode

View file

@ -360,6 +360,20 @@ QDF_STATUS pmo_core_txrx_resume(struct wlan_objmgr_psoc *psoc);
*/
QDF_STATUS pmo_core_config_forced_dtim(struct wlan_objmgr_vdev *vdev,
uint32_t dynamic_dtim);
#ifdef SYSTEM_PM_CHECK
/**
* pmo_core_system_resume() - function to handle system resume notification
* @psoc: objmgr psoc handle
*
* Return: None
*/
void pmo_core_system_resume(struct wlan_objmgr_psoc *psoc);
#else
static inline void pmo_core_system_resume(struct wlan_objmgr_psoc *psoc)
{
}
#endif
#endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
#endif /* end of _WLAN_PMO_SUSPEND_RESUME_H_ */

View file

@ -1810,3 +1810,28 @@ out:
pmo_exit();
return status;
}
#ifdef SYSTEM_PM_CHECK
void pmo_core_system_resume(struct wlan_objmgr_psoc *psoc)
{
struct pmo_psoc_priv_obj *psoc_ctx;
QDF_STATUS status;
if (!psoc) {
pmo_err("psoc is NULL");
return;
}
status = pmo_psoc_get_ref(psoc);
if (status != QDF_STATUS_SUCCESS) {
pmo_err("pmo cannot get the reference out of psoc");
return;
}
psoc_ctx = pmo_psoc_get_priv(psoc);
htc_system_resume(psoc_ctx->htc_hdl);
pmo_psoc_put_ref(psoc);
}
#endif

View file

@ -2028,4 +2028,19 @@ ucfg_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
bool
ucfg_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
#ifdef SYSTEM_PM_CHECK
/**
* ucfg_pmo_notify_system_resume() - system resume notification to pmo
* @psoc: pointer to psoc object
*
* Return: None
*/
void
ucfg_pmo_notify_system_resume(struct wlan_objmgr_psoc *psoc);
#else
static inline
void ucfg_pmo_notify_system_resume(struct wlan_objmgr_psoc *psoc)
{
}
#endif
#endif /* end of _WLAN_PMO_UCFG_API_H_ */

View file

@ -895,3 +895,10 @@ QDF_STATUS ucfg_pmo_core_txrx_resume(struct wlan_objmgr_psoc *psoc)
{
return pmo_core_txrx_resume(psoc);
}
#ifdef SYSTEM_PM_CHECK
void ucfg_pmo_notify_system_resume(struct wlan_objmgr_psoc *psoc)
{
pmo_core_system_resume(psoc);
}
#endif

View file

@ -1217,6 +1217,8 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
goto late_hif_resume;
}
hif_system_pm_set_state_suspended(hif_ctx);
err = hif_bus_suspend(hif_ctx);
if (err) {
hdd_err("Failed hif bus suspend: %d", err);
@ -1266,6 +1268,7 @@ late_hif_resume:
resume_cdp:
status = cdp_bus_resume(dp_soc, OL_TXRX_PDEV_ID);
QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
hif_system_pm_set_state_on(hif_ctx);
return err;
}
@ -1431,6 +1434,8 @@ int wlan_hdd_bus_resume(void)
goto out;
}
hif_system_pm_set_state_resuming(hif_ctx);
qdf_status = ucfg_pmo_psoc_bus_resume_req(hdd_ctx->psoc,
QDF_SYSTEM_SUSPEND);
status = qdf_status_to_os_return(qdf_status);
@ -1439,6 +1444,8 @@ int wlan_hdd_bus_resume(void)
goto out;
}
hif_system_pm_set_state_on(hif_ctx);
status = hif_bus_late_resume(hif_ctx);
if (status) {
hdd_err("Failed hif bus late resume");
@ -1457,6 +1464,7 @@ int wlan_hdd_bus_resume(void)
return 0;
out:
hif_system_pm_set_state_suspended(hif_ctx);
if (cds_is_driver_recovering() || cds_is_driver_in_bad_state() ||
cds_is_fw_down())
return 0;

View file

@ -1926,6 +1926,8 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
}
}
ucfg_pmo_notify_system_resume(hdd_ctx->psoc);
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_RESUME_WLAN,
NO_SESSION, hdd_ctx->is_wiphy_suspended);