summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihir Shete <smihir@qti.qualcomm.com>2014-01-27 11:30:05 +0530
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-04-11 08:44:24 -0700
commit9eb884332487d285d89e805c0732bdc599647e12 (patch)
tree09e5f17d9c770f72dbe9e25401d72fe93e574af5
parentfea615a9cb13c6ba82696f3c0a85a39478bf1155 (diff)
wlan: flush scan results obtained from the 11d scans
11d scans are done when the driver is loaded to find any BSS which is advertizing 11d IEs, 11d scans are passive and we scan all the channels the device supports irrespective of the regulatory domain restrictions. Sometimes as part of 11d scans we find APs on frequencies which are not supported by the regulatory domain and if we notify such APs to the supplicant, user may attempt to connect to such APs. To avoid this situation we will flush all the scan results cached by the SME after 11d scan. Change-Id: Ifbad1e45e24ed84782b0efc8e17fa4ffff284656 CRs-Fixed: 643075
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c27
-rw-r--r--CORE/SME/inc/csrInternal.h1
-rw-r--r--CORE/SME/inc/sme_Api.h12
-rw-r--r--CORE/SME/src/csr/csrApiScan.c2
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c20
5 files changed, 61 insertions, 1 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index a9a7f1b5549b..cbc6640b8d8a 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -10034,6 +10034,32 @@ exit:
#endif
/**---------------------------------------------------------------------------
+ \brief hdd_11d_scan_done - callback to be executed when 11d scan is
+ completed to flush out the scan results
+
+ 11d scan is done during driver load and is a passive scan on all
+ channels supported by the device, 11d scans may find some APs on
+ frequencies which are forbidden to be used in the regulatory domain
+ the device is operating in. If these APs are notified to the supplicant
+ it may try to connect to these APs, thus flush out all the scan results
+ which are present in SME after 11d scan is done.
+
+ \return - eHalStatus
+
+ --------------------------------------------------------------------------*/
+static eHalStatus hdd_11d_scan_done(tHalHandle halHandle, void *pContext,
+ tANI_U32 scanId, eCsrScanStatus status)
+{
+ ENTER();
+
+ sme_ScanFlushResult(halHandle, 0);
+
+ EXIT();
+
+ return eHAL_STATUS_SUCCESS;
+}
+
+/**---------------------------------------------------------------------------
\brief hdd_wlan_startup() - HDD init function
@@ -10690,6 +10716,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
/*SME must send channel update configuration to RIVA*/
sme_UpdateChannelConfig(pHddCtx->hHal);
#endif
+ sme_Register11dScanDoneCallback(pHddCtx->hHal, hdd_11d_scan_done);
/* Register with platform driver as client for Suspend/Resume */
status = hddRegisterPmOps(pHddCtx);
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index ef4ab16bdb6f..18d31b7cd867 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -793,6 +793,7 @@ typedef struct tagCsrScanStruct
tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found
tANI_S8 inScanResultBestAPRssi;
eCsrBand scanBandPreference; //This defines the band perference for scan
+ csrScanCompleteCallback callback11dScanDone;
}tCsrScanStruct;
#ifdef FEATURE_WLAN_TDLS_INTERNAL
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 632ea783d6f5..4d8d119a4387 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -1283,6 +1283,18 @@ extern eHalStatus sme_RegisterPowerSaveCheck (
tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext);
/* ---------------------------------------------------------------------------
+ \fn sme_Register11dScanDoneCallback
+ \brief Register a routine of type csrScanCompleteCallback which is
+ called whenever an 11d scan is done
+ \param hHal - The handle returned by macOpen.
+ \param callback - 11d scan complete routine to be registered
+ \return eHalStatus
+ ---------------------------------------------------------------------------*/
+extern eHalStatus sme_Register11dScanDoneCallback (
+ tHalHandle hHal,
+ csrScanCompleteCallback);
+
+/* ---------------------------------------------------------------------------
\fn sme_DeregisterPowerSaveCheck
\brief Deregister a power save check routine
\param hHal - The handle returned by macOpen.
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 587c4f312db7..1e6cc980c129 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -799,7 +799,7 @@ eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId,
pChnInfo->numOfChannels = (tANI_U8)numChn;
p11dScanCmd->command = eSmeCommandScan;
- p11dScanCmd->u.scanCmd.callback = NULL;
+ p11dScanCmd->u.scanCmd.callback = pMac->scan.callback11dScanDone;
p11dScanCmd->u.scanCmd.pContext = NULL;
p11dScanCmd->u.scanCmd.scanID = pMac->scan.nextScanID++;
scanReq.BSSType = eCSR_BSS_TYPE_ANY;
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 15faefa5b414..b250ae3696d5 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -4566,6 +4566,26 @@ eHalStatus sme_RegisterPowerSaveCheck (
}
/* ---------------------------------------------------------------------------
+ \fn sme_Register11dScanDoneCallback
+ \brief Register a routine of type csrScanCompleteCallback which is
+ called whenever an 11d scan is done
+ \param hHal - The handle returned by macOpen.
+ \param callback - 11d scan complete routine to be registered
+ \return eHalStatus
+ ---------------------------------------------------------------------------*/
+eHalStatus sme_Register11dScanDoneCallback (
+ tHalHandle hHal,
+ csrScanCompleteCallback callback)
+{
+ eHalStatus status = eHAL_STATUS_SUCCESS;
+ tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+
+ pMac->scan.callback11dScanDone = callback;
+
+ return (status);
+}
+
+/* ---------------------------------------------------------------------------
\fn sme_DeregisterPowerSaveCheck
\brief Deregister a power save check routine
\param hHal - The handle returned by macOpen.