From 43957256d4d51cdebf8683f9934ed6c63147a0c8 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Tue, 13 Jun 2023 11:53:26 +0530 Subject: [PATCH] qcacld-3.0: Fix RSO state change in disconnected state When roaming has started and connect request from userspace is received, disconnect is initiated as part of the connect request and RSO stop->RSO Deinit is sent to firmware. But before receiving the RSO stop, firmware posted the Roam Synch indication to the host driver. While droping the roam synch indication, the driver does abort roaming and as part of that RSO state is changed to RSO enabled in connecting state. Change the RSO state to RSO enabled only if roaming or roam synch indication processing is in progress. Change-Id: I7869d1a559884480708b9d1a493296a443364f0b CRs-Fixed: 3089165 --- core/sme/src/csr/csr_api_roam.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index d09e2611c8ea..9aa6882b0864 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -21306,10 +21306,19 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx, * the candidate was not successful. * Connection to the previous AP is still valid in this * case. So move to RSO_ENABLED state. + * + * Switch to RSO enabled state only if the current state is + * WLAN_ROAMING_IN_PROG or WLAN_ROAM_SYNCH_IN_PROG. + * This API can be called in internal roam aborts also when + * RSO state is deinit and cause RSO start to be sent in + * disconnected state. */ - csr_post_roam_state_change(mac_ctx, session_id, - WLAN_ROAM_RSO_ENABLED, - REASON_ROAM_ABORT); + if (MLME_IS_ROAMING_IN_PROG(mac_ctx->psoc, session_id) || + MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, session_id)) + csr_post_roam_state_change(mac_ctx, session_id, + WLAN_ROAM_RSO_ENABLED, + REASON_ROAM_ABORT); + csr_roam_roaming_offload_timer_action(mac_ctx, 0, session_id, ROAMING_OFFLOAD_TIMER_STOP); csr_roam_call_callback(mac_ctx, session_id, NULL, 0,