From 64aff0c8a91a83f87d75ce5530e6c7cc8cf85d08 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Tue, 20 Jun 2017 16:35:26 +0530 Subject: [PATCH] qcacld-3.0: Reject connection if channel not ok for DNBS Reject connection in csr_roam_connect(), if the BSS entry selected from the driver cached scan results, has a channel which is not OK for Do_Not_Break_Stream. Change-Id: Icf725361382bff7dad80138cfc1b51bafa548afa CRs-Fixed: 2064380 --- core/sme/src/csr/csr_api_roam.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 2d8cfda7c822..10cabc52ebb8 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -8012,8 +8012,27 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, /* check if set hw mode needs to be done */ if ((pScanFilter->csrPersona == QDF_STA_MODE) || (pScanFilter->csrPersona == QDF_P2P_CLIENT_MODE)) { + bool ok; + csr_get_bssdescr_from_scan_handle(hBSSList, first_ap_profile); + status = policy_mgr_is_chan_ok_for_dnbs(pMac->psoc, + first_ap_profile->channelId, &ok); + if (QDF_IS_STATUS_ERROR(status)) { + sme_debug("policy_mgr_is_chan_ok_for_dnbs():error:%d", + status); + csr_scan_result_purge(pMac, hBSSList); + fCallCallback = true; + goto error; + } + if (!ok) { + sme_debug("chan:%d not ok for DNBS", + first_ap_profile->channelId); + csr_scan_result_purge(pMac, hBSSList); + fCallCallback = true; + status = QDF_STATUS_E_INVAL; + goto error; + } status = policy_mgr_handle_conc_multiport(pMac->psoc, sessionId, first_ap_profile->channelId); if ((QDF_IS_STATUS_SUCCESS(status)) &&