Quellcode durchsuchen

qcacmn: Add new api to get link and mlo vdev

Add new api's to get link and mlo vdev from psoc and vdevid.

Change-Id: I4c36baab6199dbc31ba11d1b9c547589a84c9625
CRs-Fixed: 3098600
Amruta Kulkarni vor 3 Jahren
Ursprung
Commit
c1e9855dd5

+ 39 - 1
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mlme_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2019, 2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -243,4 +243,42 @@ QDF_STATUS wlan_vdev_mlme_is_init_state(struct wlan_objmgr_vdev *vdev);
  *         FAILURE: otherwise failure
  */
 QDF_STATUS wlan_vdev_is_up_active_state(struct wlan_objmgr_vdev *vdev);
+
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * wlan_vdev_mlme_get_is_mlo_link() - check if its mlo link vdev
+ * @psoc: PSOC object
+ * @vdev_id: VDEV Id
+ *
+ * Return: True if it is mlo link, otherwise false.
+ */
+bool
+wlan_vdev_mlme_get_is_mlo_link(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id);
+
+/**
+ * wlan_vdev_mlme_get_is_mlo_vdev() - check if its mlo assoc vdev
+ * @psoc: PSOC object
+ * @vdev_id: VDEV Id
+ *
+ * Return: True if it is mlo link, otherwise false.
+ */
+bool
+wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id);
+#else
+static inline bool
+wlan_vdev_mlme_get_is_mlo_link(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id)
+{
+	return false;
+}
+
+static inline bool
+wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id)
+{
+	return false;
+}
+#endif
 #endif

+ 49 - 1
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2019, 2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -336,3 +336,51 @@ QDF_STATUS wlan_vdev_is_up_active_state(struct wlan_objmgr_vdev *vdev)
 }
 
 qdf_export_symbol(wlan_vdev_is_up_active_state);
+
+#ifdef WLAN_FEATURE_11BE_MLO
+bool
+wlan_vdev_mlme_get_is_mlo_link(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	bool is_link = false;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_OBJMGR_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		return is_link;
+	}
+
+	if (wlan_vdev_mlme_is_mlo_vdev(vdev) &&
+	    wlan_vdev_mlme_is_mlo_link_vdev(vdev))
+		is_link = true;
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
+
+	return is_link;
+}
+
+bool
+wlan_vdev_mlme_get_is_mlo_vdev(struct wlan_objmgr_psoc *psoc,
+			       uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	bool is_mlo_vdev = false;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_OBJMGR_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		return is_mlo_vdev;
+	}
+
+	if (wlan_vdev_mlme_is_mlo_vdev(vdev) &&
+	    !wlan_vdev_mlme_is_mlo_link_vdev(vdev))
+		is_mlo_vdev = true;
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
+
+	return is_mlo_vdev;
+}
+#endif