From 2b431b63764ca0f12e992d3a1acaa46d77afdd54 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Mon, 18 Mar 2019 20:23:58 +0530 Subject: [PATCH] qcacld-3.0: Fix false alarm scan reject issue Currently, the scan is rejected if roaming in progress on STA or if a client of SAP is in the middle of WPS/EAPOL exchange. And it uses last_scan_reject_timestamp and reset scan_reject_cnt to avoid scan stuck issue. last_scan_reject_timestamp and scan_reject_cnt reset when the next scan issues successfully. If: 1\ Scan happens and roaming is in progress on STA or client of SAP is in the middle of the WPS/EAPOL exchange. Initialized last_scan_reject_timestamp and reset scan_reject_cnt; 2\ Maybe no scan happens for a long time; 3\ scan happens but unfortunately, a connection is in progress again. Then false alarm may happen because the time has already expired and scan_reject_cnt >= 15. Reset scan reject params after successful set key and successful roam. Change-Id: I1197e66483e3bc8da38d6bcbc8b8c32b193ef6c9 CRs-Fixed: 2418658 --- core/hdd/src/wlan_hdd_assoc.c | 3 +++ core/hdd/src/wlan_hdd_main.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 6748ca24eabe..975b76b2a54e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1983,6 +1983,9 @@ QDF_STATUS hdd_change_peer_state(struct hdd_adapter *adapter, #endif if (sta_state == OL_TXRX_PEER_STATE_AUTH) { + /* Reset scan reject params on successful set key */ + hdd_debug("Reset scan reject params"); + hdd_init_scan_reject_params(adapter->hdd_ctx); #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL /* make sure event is reset */ INIT_COMPLETION(adapter->sta_authorized_event); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 031204183302..3c573e91e87d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -14618,6 +14618,11 @@ void hdd_set_roaming_in_progress(bool value) hdd_ctx->roaming_in_progress = value; hdd_debug("Roaming in Progress set to %d", value); + if (!hdd_ctx->roaming_in_progress) { + /* Reset scan reject params on successful roam complete */ + hdd_debug("Reset scan reject params"); + hdd_init_scan_reject_params(hdd_ctx); + } } bool hdd_is_roaming_in_progress(struct hdd_context *hdd_ctx)