Browse Source

qcacmn: Add API to check state of all mlo vdev

Add API to check state of all mlo vdev to avoid roaming and disconnect
race issue.

Change-Id: Idc9a9a57f433aeff185fe78826faa84e08c09ddb
CRs-Fixed: 3372132
Jianmin Zhu 2 years ago
parent
commit
b98a087c60
2 changed files with 34 additions and 1 deletions
  1. 16 1
      umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h
  2. 18 0
      umac/mlo_mgr/src/wlan_mlo_mgr_sta.c

+ 16 - 1
umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 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
@@ -106,6 +106,15 @@ bool mlo_is_mld_sta(struct wlan_objmgr_vdev *vdev);
  */
 bool ucfg_mlo_is_mld_disconnected(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * mlo_is_mld_disconnecting_connecting - Check whether MLD is disconnecting or
+ * connecting
+ * @vdev: pointer to vdev
+ *
+ * Return: true if mld is disconnecting or connecting, false otherwise
+ */
+bool mlo_is_mld_disconnecting_connecting(struct wlan_objmgr_vdev *vdev);
+
 #ifndef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
 /**
  * ucfg_mlo_is_mld_connected - Check whether MLD is connected
@@ -632,6 +641,12 @@ bool ucfg_mlo_is_mld_disconnected(struct wlan_objmgr_vdev *vdev)
 }
 #endif
 
+static inline
+bool mlo_is_mld_disconnecting_connecting(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+
 static inline
 bool mlo_is_mld_sta(struct wlan_objmgr_vdev *vdev)
 {

+ 18 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_sta.c

@@ -151,6 +151,24 @@ bool mlo_is_mld_disconnected(struct wlan_objmgr_vdev *vdev)
 	return true;
 }
 
+bool mlo_is_mld_disconnecting_connecting(struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_mlo_dev_context *mlo_dev_ctx = vdev->mlo_dev_ctx;
+	uint8_t i = 0;
+
+	if (!mlo_dev_ctx || !wlan_vdev_mlme_is_mlo_vdev(vdev))
+		return false;
+
+	for (i =  0; i < WLAN_UMAC_MLO_MAX_VDEVS; i++) {
+		if (!mlo_dev_ctx->wlan_vdev_list[i])
+			continue;
+		if (wlan_cm_is_vdev_disconnecting(mlo_dev_ctx->wlan_vdev_list[i]) ||
+		    wlan_cm_is_vdev_connecting(mlo_dev_ctx->wlan_vdev_list[i]))
+			return true;
+	}
+	return false;
+}
+
 bool ucfg_mlo_is_mld_disconnected(struct wlan_objmgr_vdev *vdev)
 {
 	return mlo_is_mld_disconnected(vdev);