瀏覽代碼

qcacmn: Add API to check active link in all MLDs

Add API to check active link in all MLDs.

Change-Id: Iec05b37543718f2f79dab0fa0201aac93431d46f
CRs-Fixed: 3635226
Shreedhar Parande 1 年之前
父節點
當前提交
ef640697c4

+ 20 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_main.h

@@ -1002,6 +1002,20 @@ QDF_STATUS wlan_mlo_mgr_mld_vdev_attach(struct wlan_objmgr_vdev *vdev,
 QDF_STATUS wlan_mlo_mgr_mld_vdev_detach(struct wlan_objmgr_vdev *vdev);
 
 #ifdef WLAN_MLO_MULTI_CHIP
+/**
+ * mlo_mgr_is_mld_has_active_link() - Check if any MLD has active link
+ *
+ * @is_active: Buffer indicating links are active or not
+ *
+ * The API iterates through all the ML dev ctx in the global MLO
+ * manager to check if there is atleast one active link present in
+ * any of the MLDs
+ *
+ * Return: QDF_STATUS_SUCCESS if link information is retrieved
+ *         successfully else QDF_STATUS_E*.
+ */
+QDF_STATUS mlo_mgr_is_mld_has_active_link(bool *is_active);
+
 #ifdef WLAN_WSI_STATS_SUPPORT
 /**
  * mlo_wsi_link_info_update_soc() - Update PSOC group in WSI stats
@@ -1020,6 +1034,12 @@ static void mlo_wsi_link_info_update_soc(struct wlan_objmgr_psoc *psoc,
 {
 }
 #endif
+#else
+static inline
+QDF_STATUS mlo_mgr_is_mld_has_active_link(bool *is_active)
+{
+	return QDF_STATUS_E_FAILURE;
+}
 #endif
 
 #else

+ 2 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -354,6 +354,7 @@ struct mlo_wsi_info {
  * @force_non_assoc_prim_umac: Force non-assoc link to be primary umac
  * @lswitch_notifier: Link switch notifier callbacks
  * @wsi_info: WSI stats info
+ * @disable_eml: Disable Enhanced Multi Link features(eMLSR and eMLMR).
  */
 struct mlo_mgr_context {
 #ifdef WLAN_MLO_USE_SPINLOCK
@@ -385,6 +386,7 @@ struct mlo_mgr_context {
 	struct wlan_mlo_link_switch_notifier lswitch_notifier[WLAN_UMAC_COMP_ID_MAX];
 #endif /* WLAN_FEATURE_11BE_MLO_ADV_FEATURE */
 	struct mlo_wsi_info *wsi_info;
+	bool disable_eml;
 };
 
 /**

+ 56 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_main.c

@@ -544,6 +544,62 @@ bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr)
 	return false;
 }
 
+#ifdef WLAN_MLO_MULTI_CHIP
+QDF_STATUS mlo_mgr_is_mld_has_active_link(bool *is_active)
+{
+	qdf_list_t *ml_list;
+	uint32_t idx, count;
+	struct wlan_mlo_dev_context *mld_cur, *mld_next;
+	struct wlan_objmgr_vdev *vdev;
+	struct mlo_mgr_context *g_mlo_ctx = wlan_objmgr_get_mlo_ctx();
+	QDF_STATUS status;
+
+	if (!g_mlo_ctx || !is_active)
+		return QDF_STATUS_E_FAILURE;
+
+	ml_link_lock_acquire(g_mlo_ctx);
+	ml_list = &g_mlo_ctx->ml_dev_list;
+	if (!qdf_list_size(ml_list)) {
+		ml_link_lock_release(g_mlo_ctx);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*is_active = false;
+	mld_cur = wlan_mlo_list_peek_head(ml_list);
+	while (mld_cur) {
+		mlo_dev_lock_acquire(mld_cur);
+		count = QDF_ARRAY_SIZE(mld_cur->wlan_vdev_list);
+		for (idx = 0; idx < count; idx++) {
+			vdev = mld_cur->wlan_vdev_list[idx];
+			if (!vdev)
+				continue;
+
+			status = wlan_vdev_mlme_is_init_state(vdev);
+			if (QDF_STATUS_SUCCESS == status)
+				continue;
+
+			qdf_err("VDEV [vdev_id %u, pdev_id %u, psoc_id %u, state %u] is still active",
+				wlan_vdev_get_id(vdev),
+				wlan_objmgr_pdev_get_pdev_id(wlan_vdev_get_pdev(vdev)),
+				wlan_vdev_get_psoc_id(vdev),
+				wlan_vdev_mlme_get_state(vdev));
+			*is_active = true;
+			mlo_dev_lock_release(mld_cur);
+			ml_link_lock_release(g_mlo_ctx);
+			return QDF_STATUS_SUCCESS;
+		}
+		mld_next = wlan_mlo_get_next_mld_ctx(ml_list, mld_cur);
+		mlo_dev_lock_release(mld_cur);
+		mld_cur = mld_next;
+	}
+	ml_link_lock_release(g_mlo_ctx);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+qdf_export_symbol(mlo_mgr_is_mld_has_active_link);
+#endif
+
 #ifdef WLAN_FEATURE_11BE_MLO
 bool mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t *peer_addr,
 					  uint8_t *peer_vdev_id)