Browse Source

qcacld-3.0: Add API to check all sta link are disconnected

Add API policy_mgr_is_mlo_sta_disconnected to check all STA
in mlo dev are disconnected. If any link is associated
the API will return false.

Change-Id: I2845e81b25b4dabe5cd52e80d230979ce44e9994
CRs-Fixed: 3302791
Liangwei Dong 2 years ago
parent
commit
b15019d221

+ 12 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -4283,6 +4283,18 @@ QDF_STATUS policy_mgr_get_radio_combinations(struct wlan_objmgr_psoc *psoc,
 					     uint32_t comb_max,
 					     uint32_t *comb_num);
 
+/**
+ * policy_mgr_is_mlo_sta_disconnected() - Check all STA in mlo are disconnected
+ * @psoc: PSOC object information
+ * @vdev_id: vdev id for sta
+ *
+ * if any link is associated the API will return false.
+ *
+ * Return: True if all sta links are disconnected
+ */
+bool policy_mgr_is_mlo_sta_disconnected(struct wlan_objmgr_psoc *psoc,
+					uint8_t vdev_id);
+
 #ifdef WLAN_FEATURE_11BE_MLO
 /**
  * policy_mgr_is_mlo_sap_concurrency_allowed() - Check for mlo sap allowed

+ 20 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -3751,6 +3751,26 @@ policy_mgr_delete_from_disabled_links(struct policy_mgr_psoc_priv_obj *pm_ctx,
 }
 #endif
 
+bool policy_mgr_is_mlo_sta_disconnected(struct wlan_objmgr_psoc *psoc,
+					 uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	bool disconnected;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_POLICY_MGR_ID);
+	if (!vdev)
+		return true;
+	/* mlo mgr has no corresponding protocol api used in non-osif/hdd
+	 * component. Todo: clean up to use internal API
+	 */
+	disconnected = ucfg_mlo_is_mld_disconnected(vdev);
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
+
+	return disconnected;
+}
+
 void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc,
 				enum QDF_OPMODE mode,
 				uint8_t session_id)