From 1f97e1070102c1423aabaa1ce654d950eed5d200 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Wed, 5 Dec 2018 17:07:27 -0800 Subject: [PATCH] qcacld-3.0: Decouple PMO LPASS and NAN wow enable check from vdev LPASS is driver specific feature which is controlled by INI item and similarly NAN is also driver specific and not vdev specific hence decouple PMO lpass and nan feature get APIs from vdev to psoc. Change-Id: I152f8b909cf85e412c2fa72a2e7147a1505e60e1 CRs-Fixed: 2361991 --- components/pmo/core/inc/wlan_pmo_wow.h | 18 ++++++------------ components/pmo/core/src/wlan_pmo_wow.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/components/pmo/core/inc/wlan_pmo_wow.h b/components/pmo/core/inc/wlan_pmo_wow.h index 6ea9d5537a4b..1ecfb66192b1 100644 --- a/components/pmo/core/inc/wlan_pmo_wow.h +++ b/components/pmo/core/inc/wlan_pmo_wow.h @@ -614,8 +614,8 @@ void pmo_core_update_p2plo_in_progress(struct wlan_objmgr_vdev *vdev, #ifdef WLAN_FEATURE_LPSS /** - * pmo_is_lpass_enabled() - check if lpass is enabled - * @vdev: objmgr vdev handle + * pmo_core_is_lpass_enabled() - check if lpass is enabled + * @posc: objmgr psoc object * * WoW is needed if LPASS or NaN feature is enabled in INI because * target can't wake up itself if its put in PDEV suspend when LPASS @@ -624,21 +624,15 @@ void pmo_core_update_p2plo_in_progress(struct wlan_objmgr_vdev *vdev, * Return: true if lpass is enabled else false */ static inline -bool pmo_core_is_lpass_enabled(struct wlan_objmgr_vdev *vdev) +bool pmo_core_is_lpass_enabled(struct wlan_objmgr_psoc *psoc) { - bool lpass_enable; - struct pmo_vdev_priv_obj *vdev_ctx; + struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc); - vdev_ctx = pmo_vdev_get_priv(vdev); - qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); - lpass_enable = vdev_ctx->pmo_psoc_ctx->psoc_cfg.lpass_enable; - qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); - - return lpass_enable; + return pmo_psoc_ctx->psoc_cfg.lpass_enable; } #else static inline -bool pmo_core_is_lpass_enabled(struct wlan_objmgr_vdev *vdev) +bool pmo_core_is_lpass_enabled(struct wlan_objmgr_psoc *psoc) { return false; } diff --git a/components/pmo/core/src/wlan_pmo_wow.c b/components/pmo/core/src/wlan_pmo_wow.c index 8becfcfa08e7..bb2089b86269 100644 --- a/components/pmo/core/src/wlan_pmo_wow.c +++ b/components/pmo/core/src/wlan_pmo_wow.c @@ -321,6 +321,16 @@ bool pmo_core_is_wow_applicable(struct wlan_objmgr_psoc *psoc) return true; } + if (pmo_core_is_lpass_enabled(psoc)) { + pmo_info("lpass enabled, enabling wow"); + return true; + } + + if (cfg_nan_get_enable(psoc)) { + pmo_debug("nan enabled, enabling wow"); + return true; + } + /* Iterate through VDEV list */ for (vdev_id = 0; vdev_id < WLAN_UMAC_PSOC_MAX_VDEVS; vdev_id++) { vdev = pmo_psoc_get_vdev(psoc, vdev_id); @@ -343,12 +353,6 @@ bool pmo_core_is_wow_applicable(struct wlan_objmgr_psoc *psoc) } else if (pmo_core_is_p2plo_in_progress(vdev)) { pmo_debug("P2P LO is in progress, enabling wow"); is_wow_applicable = true; - } else if (pmo_core_is_lpass_enabled(vdev)) { - pmo_debug("LPASS is enabled, enabling WoW"); - is_wow_applicable = true; - } else if (cfg_nan_get_enable(psoc)) { - pmo_debug("NAN is enabled, enabling WoW"); - is_wow_applicable = true; } else if (pmo_core_get_vdev_op_mode(vdev) == QDF_NDI_MODE) { pmo_debug("vdev %d is in NAN data mode, enabling wow", vdev_id);