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,