summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2017-01-06 17:56:47 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-10 20:10:59 -0800
commitf20a2a5a1272eba8e69736124347ca6b70ed9122 (patch)
treea5c5b8bdeb8527e84d462ddb9c97bb8d32ca79cb
parent86bae70dbc120852583a04076877b2705f448620 (diff)
qcacld-3.0: Prioritize the bssid_hint and if fails try with other BSS
qcacld-2.0 to qcacld-3.0 propagation If connect request has bssid_hint the behaviour is same as when connect request has bssid present. So driver only try to connect to BSSID present in the bssid_hint. With this change if bssid_hint is provided in connect request driver will prioritize connection to the BSSID provided and if it fails to connect to bssid_hint, driver will try to connect to other APs with same profile. Change-Id: Ie7fd29cdfb2013aca1d4944272da6b3c29a16ab3 CRs-Fixed: 1107816
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c15
-rw-r--r--core/hdd/src/wlan_hdd_wext.c3
-rw-r--r--core/sme/inc/csr_api.h2
-rw-r--r--core/sme/src/csr/csr_api_roam.c2
-rw-r--r--core/sme/src/csr/csr_api_scan.c18
5 files changed, 33 insertions, 7 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index c3d491795966..d9272fa12335 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11818,6 +11818,12 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
ssid, ssid_len);
pRoamProfile->do_not_roam = !pAdapter->fast_roaming_allowed;
+ /* cleanup bssid hint */
+ qdf_mem_zero(pRoamProfile->bssid_hint.bytes,
+ QDF_MAC_ADDR_SIZE);
+ qdf_mem_zero((void *)(pRoamProfile->BSSIDs.bssid),
+ QDF_MAC_ADDR_SIZE);
+
if (bssid) {
pRoamProfile->BSSIDs.numOfBSSIDs = 1;
pRoamProfile->do_not_roam = true;
@@ -11833,9 +11839,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
bssid, QDF_MAC_ADDR_SIZE);
hdd_info("bssid is given by upper layer %pM", bssid);
} else if (bssid_hint) {
- pRoamProfile->BSSIDs.numOfBSSIDs = 1;
- qdf_mem_copy((void *)(pRoamProfile->BSSIDs.bssid),
- bssid_hint, QDF_MAC_ADDR_SIZE);
+ qdf_mem_copy(pRoamProfile->bssid_hint.bytes,
+ bssid_hint, QDF_MAC_ADDR_SIZE);
/*
* Save BSSID in a separate variable as
* pRoamProfile's BSSID is getting zeroed out in the
@@ -11846,10 +11851,6 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
bssid_hint, QDF_MAC_ADDR_SIZE);
hdd_info("bssid_hint is given by upper layer %pM",
bssid_hint);
- } else {
- qdf_mem_zero((void *)(pRoamProfile->BSSIDs.bssid),
- QDF_MAC_ADDR_SIZE);
- hdd_info("no bssid given by upper layer");
}
hdd_notice("Connect to SSID: %.*s operating Channel: %u",
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 41320f992acd..03a9404e185b 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -2317,6 +2317,9 @@ void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter)
pWextState->roamProfile.AuthType.authType[0] =
eCSR_AUTH_TYPE_OPEN_SYSTEM;
+ qdf_mem_zero(pWextState->roamProfile.bssid_hint.bytes,
+ QDF_MAC_ADDR_SIZE);
+
#ifdef WLAN_FEATURE_11W
pWextState->roamProfile.MFPEnabled = false;
pWextState->roamProfile.MFPRequired = 0;
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 4a92291d3a23..cc29ac78b3e0 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -392,6 +392,7 @@ typedef struct tagCsrScanResultFilter {
*/
uint8_t scan_filter_for_roam;
struct sCsrChannel_ pcl_channels;
+ struct qdf_mac_addr bssid_hint;
enum tQDF_ADAPTER_MODE csrPersona;
} tCsrScanResultFilter;
@@ -970,6 +971,7 @@ typedef struct tagCsrRoamProfile {
uint8_t beacon_tx_rate;
tSirMacRateSet supported_rates;
tSirMacRateSet extended_rates;
+ struct qdf_mac_addr bssid_hint;
bool do_not_roam;
} tCsrRoamProfile;
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 62a12105c21e..3bd1e35600c5 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -10200,6 +10200,8 @@ csr_roam_prepare_filter_from_profile(tpAniSirGlobal mac_ctx,
scan_fltr->MDID.mdiePresent = 1;
scan_fltr->MDID.mobilityDomain = profile->MDID.mobilityDomain;
}
+ qdf_mem_copy(scan_fltr->bssid_hint.bytes,
+ profile->bssid_hint.bytes, QDF_MAC_ADDR_SIZE);
#ifdef WLAN_FEATURE_11W
/* Management Frame Protection */
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index 4695a56f667f..1e3343fbd698 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -1956,10 +1956,28 @@ csr_save_scan_entry(tpAniSirGlobal pMac,
(*count)++;
return status;
}
+ if (pFilter &&
+ !qdf_mem_cmp(pResult->Result.BssDescriptor.bssId,
+ pFilter->bssid_hint.bytes, QDF_MAC_ADDR_SIZE)) {
+ /* bssid hint AP should be on head */
+ csr_ll_insert_head(&pRetList->List,
+ &pResult->Link, LL_ACCESS_NOLOCK);
+ (*count)++;
+ return status;
+ }
pTmpEntry = csr_ll_peek_head(&pRetList->List, LL_ACCESS_NOLOCK);
while (pTmpEntry) {
pTmpResult = GET_BASE_ADDR(pTmpEntry, tCsrScanResult, Link);
+
+ /* Skip the bssid hint AP, as it should be on head */
+ if (pFilter &&
+ !qdf_mem_cmp(pTmpResult->Result.BssDescriptor.bssId,
+ pFilter->bssid_hint.bytes, QDF_MAC_ADDR_SIZE)) {
+ pTmpEntry = csr_ll_next(&pRetList->List,
+ pTmpEntry, LL_ACCESS_NOLOCK);
+ continue;
+ }
if (csr_is_better_bss(pMac, pResult, pTmpResult)) {
csr_ll_insert_entry(&pRetList->List, pTmpEntry,
&pResult->Link, LL_ACCESS_NOLOCK);