summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubramanyam Nalli <nalli@qti.qualcomm.com>2014-03-25 13:47:33 +0530
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-03-26 21:24:30 -0700
commitbda79a893dfcd1746632b789125e7650359ed856 (patch)
treeb44156d1eb3995bf741d4790dbe8be810ad897d2
parent07b8e787ff5569fb61e748b7001fc392376216b2 (diff)
qcacld : LIM: Remove duplicate scan cache in SME and LIM
Currently before updating the new scan result, both BSSID and channel number are getting compared before updating the details in LIM/SMEscan cache. Due to this, if AP moves from one DFS channel to another DFS channel duplicate entries are getting created in LIM scan cache for the same BSSID. When wpa_supplicant says connect to driver, CSR is taking first entry which has older channel and trying to connect first time. AP will not be available in older channel. SO, connection would fail saying that beacon is not received. And then CSR is taking next entry which has new channel and trying to connect. 2nd time connection is successful. This patch removes duplicate entries each bssid. CRs-fixed: 634156 Change-Id: Ie5a00c537f191de5f061fe861774bc9c9a675125
-rw-r--r--CORE/MAC/src/pe/lim/limScanResultUtils.c8
-rw-r--r--CORE/SME/src/csr/csrApiScan.c3
-rw-r--r--CORE/VOSS/inc/vos_utils.h3
-rw-r--r--CORE/VOSS/src/vos_utils.c9
4 files changed, 18 insertions, 5 deletions
diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.c b/CORE/MAC/src/pe/lim/limScanResultUtils.c
index fa381d93e81f..d8980b671db8 100644
--- a/CORE/MAC/src/pe/lim/limScanResultUtils.c
+++ b/CORE/MAC/src/pe/lim/limScanResultUtils.c
@@ -43,8 +43,7 @@
#if defined WLAN_FEATURE_VOWIFI
#include "rrmApi.h"
#endif
-
-
+#include "vos_utils.h"
/**
* limDeactiveMinChannelTimerDuringScan()
@@ -732,8 +731,9 @@ limLookupNaddHashEntry(tpAniSirGlobal pMac,
(vos_mem_compare( (tANI_U8 *) pBssDescr->bssDescription.bssId,
(tANI_U8 *) ptemp->bssDescription.bssId,
sizeof(tSirMacAddr))) && //matching BSSID
- (pBssDescr->bssDescription.channelId ==
- ptemp->bssDescription.channelId) &&
+ // matching band to update new channel info
+ (vos_freq_to_band(pBssDescr->bssDescription.channelId) ==
+ vos_freq_to_band(ptemp->bssDescription.channelId)) &&
vos_mem_compare( ((tANI_U8 *) &pBssDescr->bssDescription.ieFields + 1),
((tANI_U8 *) &ptemp->bssDescription.ieFields + 1),
(tANI_U8) (ssidLen + 1)) &&
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 49d70c978e7f..f5985e7b5c42 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -49,6 +49,7 @@
#include "vos_nvitem.h"
#include "wlan_qct_wda.h"
+#include "vos_utils.h"
#define MIN_CHN_TIME_TO_FIND_GO 100
#define MAX_CHN_TIME_TO_FIND_GO 100
@@ -4631,7 +4632,7 @@ tANI_BOOLEAN csrIsDuplicateBssDescription( tpAniSirGlobal pMac, tSirBssDescripti
{
if (pCap1->ess &&
csrIsMacAddressEqual( pMac, (tCsrBssid *)pSirBssDesc1->bssId, (tCsrBssid *)pSirBssDesc2->bssId)&&
- (fForced || (pSirBssDesc1->channelId == pSirBssDesc2->channelId)))
+ (fForced || (vos_freq_to_band(pSirBssDesc1->channelId) == vos_freq_to_band((pSirBssDesc2->channelId)))))
{
fMatch = TRUE;
// Check for SSID match, if exists
diff --git a/CORE/VOSS/inc/vos_utils.h b/CORE/VOSS/inc/vos_utils.h
index 63dc656d709e..52b8fa95b451 100644
--- a/CORE/VOSS/inc/vos_utils.h
+++ b/CORE/VOSS/inc/vos_utils.h
@@ -53,6 +53,8 @@
------------------------------------------------------------------------*/
#define VOS_DIGEST_SHA1_SIZE 20
#define VOS_DIGEST_MD5_SIZE 16
+#define VOS_BAND_2GHZ 1
+#define VOS_BAND_5GHZ 2
#define VOS_24_GHZ_BASE_FREQ 2407
#define VOS_5_GHZ_BASE_FREQ 5000
@@ -168,6 +170,7 @@ VOS_STATUS vos_decrypt_AES(v_U32_t cryptHandle, /* Handle */
v_U32_t vos_chan_to_freq(v_U8_t chan);
v_U8_t vos_freq_to_chan(v_U32_t freq);
+v_U8_t vos_freq_to_band(v_U32_t freq);
#ifdef WLAN_FEATURE_11W
v_BOOL_t vos_is_mmie_valid(v_U8_t *key, v_U8_t *ipn,
v_U8_t* frm, v_U8_t* efrm);
diff --git a/CORE/VOSS/src/vos_utils.c b/CORE/VOSS/src/vos_utils.c
index 43d93099472f..dfdb23ebbbf2 100644
--- a/CORE/VOSS/src/vos_utils.c
+++ b/CORE/VOSS/src/vos_utils.c
@@ -850,3 +850,12 @@ v_U8_t vos_freq_to_chan(v_U32_t freq)
chan = (freq - VOS_5_GHZ_BASE_FREQ)/VOS_CHAN_SPACING_5MHZ;
return chan;
}
+
+
+v_U8_t vos_freq_to_band(v_U32_t freq)
+{
+ if (freq <= VOS_CHAN_14_FREQ)
+ return VOS_BAND_2GHZ;
+
+ return VOS_BAND_5GHZ;
+}