From 3c208c966204b44dba829f5250f414a5a1bf47d0 Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Fri, 22 Mar 2024 11:42:14 +0530 Subject: [PATCH] qcacmn: Enhance link state handling for active and inactive links Previously, host drivers only updated the link state for active links upon receiving the wmi_mlo_link_state_switch_eventid event from the firmware. This led to all links being updated as active after multiple link_state_switch events, as the state for inactive links was not being updated. This commit addresses this issue by ensuring that the link state for both active and inactive links is updated upon receiving the link_state_switch event from the firmware. Change-Id: I668074b397cf6b570929459c9fe5e23ca55b75b1 CRs-Fixed: 3763361 --- umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c b/umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c index dd398d978b..287a9aaa67 100644 --- a/umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c +++ b/umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c @@ -83,6 +83,7 @@ void mlo_mgr_update_ap_link_info(struct wlan_objmgr_vdev *vdev, uint8_t link_id, qdf_mem_copy(link_info->link_chan_info, &channel, sizeof(channel)); link_info->link_status_flags = 0; link_info->link_id = link_id; + link_info->is_link_active = false; mlo_debug("Update AP Link info for link_id: %d, vdev_id:%d, link_addr:" QDF_MAC_ADDR_FMT, link_info->link_id, link_info->vdev_id, @@ -1219,20 +1220,16 @@ QDF_STATUS mlo_mgr_link_switch_request_params(struct wlan_objmgr_psoc *psoc, static void mlo_mgr_update_link_state(struct wlan_mlo_dev_context *mld_ctx, uint32_t active_link_bitmap) { + uint8_t i; struct mlo_link_info *link_info; - uint8_t link_iter; - for (link_iter = 0; link_iter < MAX_MLO_LINK_ID; link_iter++) { - if (IS_LINK_SET(active_link_bitmap, link_iter)) { - link_info = mlo_mgr_get_ap_link_by_link_id(mld_ctx, - link_iter); - if (!link_info) { - mlo_err("link: %d info does not exist", - link_iter); - return; - } + for (i = 0; i < WLAN_MAX_ML_BSS_LINKS; i++) { + link_info = &mld_ctx->link_ctx->links_info[i]; + + if (IS_LINK_SET(active_link_bitmap, link_info->link_id)) link_info->is_link_active = true; - } + else + link_info->is_link_active = false; } }