Browse Source

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
Rajeev Kumar 6 years ago
parent
commit
1f97e10701
2 changed files with 16 additions and 18 deletions
  1. 6 12
      components/pmo/core/inc/wlan_pmo_wow.h
  2. 10 6
      components/pmo/core/src/wlan_pmo_wow.c

+ 6 - 12
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;
-
-	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);
+	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
 
-	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;
 }

+ 10 - 6
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);