Эх сурвалжийг харах

qcacmn: Clear the bridge context properly

Bridge context was not getting cleared properly which
was causing issue in connection of WDS STA. Make sure
to clear the bridge_sta_ctx and reset central vdev.

Change-Id: I397e5ffc1223bb0e60e67d8bc3e8c4d8bbbf7808
CRs-Fixed: 3618063
Uraj Sasan 1 жил өмнө
parent
commit
3ed0c49f5e

+ 19 - 2
umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h

@@ -26,6 +26,7 @@
 #include <wlan_mlo_mgr_cmn.h>
 #ifdef WLAN_FEATURE_11BE_MLO
 #include <wlan_mlo_mgr_public_structs.h>
+#include <wlan_mlo_mgr_peer.h>
 
 /**
  * mlo_connect - Start the connection process
@@ -294,14 +295,30 @@ static inline
 void mlo_clear_bridge_sta_ctx(struct wlan_objmgr_vdev *vdev)
 {
 	struct wlan_mlo_dev_context *ml_dev = NULL;
+	struct wlan_objmgr_vdev *tmp_vdev = NULL;
+	uint8_t bridge_umac_id = -1;
 
 	if (!vdev || !vdev->mlo_dev_ctx)
 		return;
 
 	ml_dev = vdev->mlo_dev_ctx;
-	if (ml_dev->bridge_sta_ctx)
+	if (ml_dev->bridge_sta_ctx) {
+		bridge_umac_id = ml_dev->bridge_sta_ctx->bridge_umac_id;
 		qdf_mem_zero(ml_dev->bridge_sta_ctx,
-			     sizeof(ml_dev->bridge_sta_ctx));
+			     sizeof(struct wlan_mlo_bridge_sta));
+	}
+	if (mlo_is_force_central_primary(vdev)) {
+		tmp_vdev = mlo_get_link_vdev_from_psoc_id(ml_dev,
+							  bridge_umac_id,
+							  false);
+		if (!tmp_vdev) {
+			mlo_err("VDEV derivation failed for %u psoc wds bridge",
+				bridge_umac_id);
+			return;
+		}
+		tmp_vdev->vdev_objmgr.mlo_central_vdev = false;
+		wlan_objmgr_vdev_release_ref(tmp_vdev, WLAN_MLO_MGR_ID);
+	}
 }
 
 #else