From 3ed0c49f5edacd30e7cf9a558c35b485237c0f1d Mon Sep 17 00:00:00 2001 From: Uraj Sasan Date: Thu, 21 Sep 2023 18:28:36 +0530 Subject: [PATCH] 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 --- umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h b/umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h index d8330a0fe7..6e58972332 100644 --- a/umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h +++ b/umac/mlo_mgr/inc/wlan_mlo_mgr_sta.h @@ -26,6 +26,7 @@ #include #ifdef WLAN_FEATURE_11BE_MLO #include +#include /** * 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