From 154d789744d6224c1947533e8226004bcde29cf0 Mon Sep 17 00:00:00 2001 From: kaliu Date: Wed, 30 Dec 2015 17:27:58 +0530 Subject: [PATCH] qcacld-3.0: eSmeCommandDelStaSession stuck in smeCmdActiveList qcacld-2.0 to qcacld-3.0 propagation. 1.Use iw tool to let dut connect to remote ap, dut is working on wlan0. 2.At same time, use hostapd to start sap also on interface wlan0. In item1, before connect to ap, dut will do an internal scan to search ap, if scan result matched configured ap profile, dut trys to connect to ap. In item2, when starting sap, found it's sta mode it will try to disconnect dut with remote ap and close sta session. #1 If ap start action happened in item1's scan period, trying disconnecting won't take effect as currently sta has not yet connected with remote ap. So after item1's scan finished, dut continues to do connection. #2 During closing sta session, sme issued eSmeCommandDelStaSession, as currently sta is doing connection, so session is in started status, this cause closure failed, so there is no chance to remove cmd in smeCmdActiveList. While cmd pending in smeCmdActiveList for 120s, driver issued crash. The solution is in item1 after scan complete to check whether it's needed to start following connection. If stop action has been issued during scan period, then don't do the connection. Change-Id: If632e21cb13277fba371ff1bf8df97febf856d09 CRs-Fixed: 923375 --- core/sme/inc/csr_api.h | 4 +++- core/sme/src/csr/csr_api_roam.c | 4 +++- core/sme/src/csr/csr_api_scan.c | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index af46ebc441da..08e3b15f3e37 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -662,6 +662,8 @@ typedef enum { eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTED, /* Participating in a Infra network and connected to a peer */ eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED, + /* Disconnecting with AP or stop connecting process */ + eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING, } eCsrConnectState; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f22cf8dac2a1..b7a9aefb3711 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -7777,6 +7777,8 @@ CDF_STATUS csr_roam_disconnect_internal(tpAniSirGlobal pMac, uint32_t sessionId, status = csr_roam_issue_disassociate_cmd(pMac, sessionId, reason); } else { + pMac->roam.roamSession[sessionId].connectState = + eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING; csr_scan_abort_scan_for_ssid(pMac, sessionId); status = CDF_STATUS_CMD_NOT_QUEUED; sms_log(pMac, LOG1, diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index fde1c3038bb1..7a6e1155eab8 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1181,6 +1181,13 @@ CDF_STATUS csr_scan_handle_search_for_ssid(tpAniSirGlobal pMac, status = csr_scan_get_result(pMac, pScanFilter, &hBSSList); if (!CDF_IS_STATUS_SUCCESS(status)) break; + if (pMac->roam.roamSession[sessionId].connectState == + eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING) { + sms_log(pMac, LOGE, + FL("upper layer issued disconnetion")); + status = CDF_STATUS_E_FAILURE; + break; + } status = csr_roam_issue_connect(pMac, sessionId, pProfile, hBSSList, eCsrHddIssued, pCommand->u.scanCmd.roamId,