summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@qti.qualcomm.com>2016-07-07 15:44:09 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-07-12 15:12:13 +0530
commitc4819e6f4a2475f4e1959a22e7bd2d4fc6af0e26 (patch)
treeb4de1e8919e1f5ee4d09ef60c3b1426202644132
parent99a497c69fcd30e446323dc3d6471aab0335aa8b (diff)
qcacld-2.0: If BSS is unreachable remove it from scan cache
If BSS is present in kernel and driver scan cache, supplicant tries to connect to the BSS multiple time even if the BSS is unreachable. Due to multiple failures to connect supplicant disable the network. To avoid this, remove the BSS from scan cache: - If connect fails due to BSS unreachable i.e. probe resp/auth/assoc timeout and scan for ssid failure. - If disconnect is due to Link lost. Change-Id: I3263dd02691000d83d4aef61c75b72d78c28f582 CRS-Fixed: 1039104
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg80211.h2
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c31
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c48
-rw-r--r--CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c4
-rw-r--r--CORE/SME/inc/csrApi.h2
-rw-r--r--CORE/SME/inc/sme_Api.h3
-rw-r--r--CORE/SME/src/csr/csrApiScan.c48
-rw-r--r--CORE/SME/src/csr/csrInsideApi.h3
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c25
9 files changed, 114 insertions, 52 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 86225855b675..45d2bf2cc79f 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -2033,7 +2033,7 @@ void hdd_rssi_threshold_breached(void *hddctx,
struct rssi_breach_event *data);
struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_list(
- hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo);
+ hdd_adapter_t *pAdapter, tSirMacAddr bssid);
int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
struct cfg80211_wowlan *wow);
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 92af328f73ef..cbef5df7accd 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -1157,6 +1157,16 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *
}
} else {
sta_id = pHddStaCtx->conn_info.staId[0];
+
+ /* clear scan cache for Link Lost */
+ if (pRoamInfo && !pRoamInfo->reasonCode &&
+ (eCSR_ROAM_RESULT_DEAUTH_IND == roamResult)) {
+ wlan_hdd_cfg80211_update_bss_list(pAdapter,
+ pHddStaCtx->conn_info.bssId);
+ sme_remove_bssid_from_scan_list(pHddCtx->hHal,
+ pHddStaCtx->conn_info.bssId);
+ }
+
//We should clear all sta register with TL, for now, only one.
vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id );
if (!VOS_IS_STATUS_SUCCESS(vstatus)) {
@@ -2139,6 +2149,17 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
}
}
+ if ((eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE == roamResult) ||
+ (pRoamInfo &&
+ ((eSIR_SME_JOIN_TIMEOUT_RESULT_CODE == pRoamInfo->statusCode) ||
+ (eSIR_SME_AUTH_TIMEOUT_RESULT_CODE == pRoamInfo->statusCode) ||
+ (eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE == pRoamInfo->statusCode)))) {
+ wlan_hdd_cfg80211_update_bss_list(pAdapter,
+ pRoamInfo ? pRoamInfo->bssid : pWextState->req_bssId);
+ sme_remove_bssid_from_scan_list(hHal,
+ pRoamInfo ? pRoamInfo->bssid : pWextState->req_bssId);
+ }
+
/* CR465478: Only send up a connection failure result when CSR has
* completed operation - with a ASSOCIATION_FAILURE status.*/
if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress )
@@ -2154,7 +2175,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
__func__, MAC_ADDR_ARRAY(pWextState->req_bssId),
roamResult, roamStatus);
- hddLog(LOGE, FL("Invoking packetdump deregistration API"));
+ hddLog(LOG1, FL("Invoking packetdump deregistration API"));
wlan_deregister_txrx_packetdump();
/* inform association failure event to nl80211 */
@@ -2191,14 +2212,6 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
}
- if (pRoamInfo) {
- if ((eSIR_SME_JOIN_TIMEOUT_RESULT_CODE == pRoamInfo->statusCode) ||
- (eSIR_SME_AUTH_TIMEOUT_RESULT_CODE == pRoamInfo->statusCode) ||
- (eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE == pRoamInfo->statusCode)) {
- wlan_hdd_cfg80211_update_bss_list(pAdapter, pRoamInfo);
- }
- }
-
hdd_wmm_init( pAdapter );
hddLog(LOG1, FL("Disabling queues"));
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index f77e2946abd4..7116e93f918f 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -16493,50 +16493,24 @@ static int wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy,
}
/*
- * FUNCTION: wlan_hdd_cfg80211_update_bss_list
- * This function is used to inform nl80211 interface that BSS might have
- * been lost.
+ * wlan_hdd_cfg80211_update_bss_list :to inform nl80211
+ * interface that BSS might have been lost.
+ * @pAdapter: adaptor
+ * @bssid: bssid which might have been lost
+ *
+ * Return: bss which is unlinked from kernel cache
*/
struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_list(
- hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo)
+ hdd_adapter_t *pAdapter, tSirMacAddr bssid)
{
struct net_device *dev = pAdapter->dev;
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
- tSirBssDescription *pBssDesc = pRoamInfo->pBssDesc;
- int chan_no;
- unsigned int freq;
- struct ieee80211_channel *chan;
struct cfg80211_bss *bss = NULL;
- if (NULL == pBssDesc) {
- hddLog(LOGE, FL("pBssDesc is NULL"));
- return bss;
- }
-
- if (NULL == pRoamInfo->pProfile) {
- hddLog(LOGE, FL("Roam profile is NULL"));
- return bss;
- }
-
- chan_no = pBssDesc->channelId;
-
- if (chan_no <= ARRAY_SIZE(hdd_channels_2_4_GHZ)) {
- freq = ieee80211_channel_to_frequency(chan_no, IEEE80211_BAND_2GHZ);
- } else {
- freq = ieee80211_channel_to_frequency(chan_no, IEEE80211_BAND_5GHZ);
- }
-
- chan = __ieee80211_get_channel(wiphy, freq);
-
- if (!chan) {
- hddLog(LOGE, FL("chan pointer is NULL"));
- return NULL;
- }
-
- bss = cfg80211_get_bss(wiphy, chan, pBssDesc->bssId,
- &pRoamInfo->pProfile->SSIDs.SSIDList->SSID.ssId[0],
- pRoamInfo->pProfile->SSIDs.SSIDList->SSID.length,
+ bss = cfg80211_get_bss(wiphy, NULL, bssid,
+ NULL,
+ 0,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) && !defined(WITH_BACKPORTS) \
&& !defined(IEEE80211_PRIVACY)
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
@@ -16547,7 +16521,7 @@ struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_list(
hddLog(LOGE, FL("BSS not present"));
} else {
hddLog(LOG1, FL("cfg80211_unlink_bss called for BSSID "
- MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pBssDesc->bssId));
+ MAC_ADDRESS_STR), MAC_ADDR_ARRAY(bssid));
cfg80211_unlink_bss(wiphy, bss);
}
return bss;
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
index f00bee1b0cb5..10255771f83b 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
@@ -4270,6 +4270,8 @@ limProcessAuthFailureTimeout(tpAniSirGlobal pMac)
break;
}
+ /* Reinit scan results to remove the unreachable BSS*/
+ limReInitScanResults(pMac);
} /*** limProcessAuthFailureTimeout() ***/
@@ -4508,6 +4510,8 @@ limProcessAssocFailureTimeout(tpAniSirGlobal pMac, tANI_U32 MsgType)
eSIR_SME_REASSOC_TIMEOUT_RESULT_CODE, eSIR_MAC_UNSPEC_FAILURE_STATUS,psessionEntry);
}
}
+ /* Reinit scan results to remove the unreachable BSS*/
+ limReInitScanResults(pMac);
} /*** limProcessAssocFailureTimeout() ***/
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index df54359ea5dc..953a54022542 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -653,6 +653,8 @@ typedef enum
eCSR_ROAM_RESULT_NDP_END_RSP,
eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND,
eCSR_ROAM_RESULT_NDP_END_IND,
+ /* If Scan for SSID failed to found proper BSS */
+ eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE,
}eCsrRoamResult;
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 796fb5e5accc..c322d390ed76 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -4577,7 +4577,8 @@ VOS_STATUS sme_is_session_valid(tHalHandle hal_handle, uint8_t session_id);
eHalStatus sme_enable_disable_chanavoidind_event(tHalHandle hHal,
tANI_U8 set_value);
-
+eHalStatus sme_remove_bssid_from_scan_list(tHalHandle hal,
+ tSirMacAddr bssid);
eHalStatus sme_update_sta_roam_policy(tHalHandle hal_handle,
enum sta_roam_policy_dfs_mode dfs_mode,
bool skip_unsafe_channels,
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 01f2300ded05..64f3ba4ba8fe 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -1730,8 +1730,10 @@ eHalStatus csrScanHandleSearchForSSID(tpAniSirGlobal pMac, tSmeCmd *pCommand)
csrScanResultPurge(pMac, hBSSList);
}
//We haven't done anything to this profile
- csrRoamCallCallback(pMac, sessionId, NULL, pCommand->u.scanCmd.roamId,
- eCSR_ROAM_ASSOCIATION_FAILURE, eCSR_ROAM_RESULT_FAILURE);
+ csrRoamCallCallback(pMac, sessionId, NULL,
+ pCommand->u.scanCmd.roamId,
+ eCSR_ROAM_ASSOCIATION_FAILURE,
+ eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE);
//In case we have nothing else to do, restart idle scan
if(csrIsConnStateDisconnected(pMac, sessionId) && !csrIsRoamCommandWaiting(pMac))
{
@@ -1825,14 +1827,14 @@ eHalStatus csrScanHandleSearchForSSIDFailure(tpAniSirGlobal pMac, tSmeCmd *pComm
csrRoamCallCallback(pMac, sessionId, pRoamInfo,
pCommand->u.scanCmd.roamId,
eCSR_ROAM_ASSOCIATION_COMPLETION,
- eCSR_ROAM_RESULT_FAILURE);
+ eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE);
}
else
{
csrRoamCallCallback(pMac, sessionId, NULL,
pCommand->u.scanCmd.roamId,
eCSR_ROAM_ASSOCIATION_FAILURE,
- eCSR_ROAM_RESULT_FAILURE);
+ eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE);
}
}
else
@@ -6927,6 +6929,44 @@ static void csrScanResultCfgAgingTimerHandler(void *pv)
CSR_SCAN_RESULT_CFG_AGING_INTERVAL/VOS_TIMER_TO_MS_UNIT);
}
+/**
+ * csr_remove_bssid_from_scan_list() - remove the bssid from
+ * scan list
+ * @mac_tx: mac context.
+ * @bssid: bssid to be removed
+ *
+ * This function remove the given bssid from scan list.
+ *
+ * Return: void.
+ */
+void csr_remove_bssid_from_scan_list(tpAniSirGlobal mac_ctx,
+ tSirMacAddr bssid)
+{
+ tListElem *entry,*free_elem;
+ tCsrScanResult *bss_desc;
+ tDblLinkList *list = &mac_ctx->scan.scanResultList;
+
+ csrLLLock(list);
+ entry = csrLLPeekHead(list, LL_ACCESS_NOLOCK);
+ while (entry != NULL) {
+ bss_desc = GET_BASE_ADDR( entry, tCsrScanResult, Link);
+ if (vos_mem_compare(bss_desc->Result.BssDescriptor.bssId,
+ bssid, sizeof(tSirMacAddr))) {
+ free_elem = entry;
+ entry = csrLLNext(list, entry, LL_ACCESS_NOLOCK);
+ csrLLRemoveEntry(list, free_elem, LL_ACCESS_NOLOCK);
+ csrFreeScanResultEntry(mac_ctx, bss_desc);
+ smsLog(mac_ctx, LOGW, FL("Removed BSS entry:%pM"),
+ bssid);
+ continue;
+ }
+
+ entry = csrLLNext(list, entry, LL_ACCESS_NOLOCK);
+ }
+
+ csrLLUnlock(list);
+}
+
eHalStatus csrScanStartIdleScanTimer(tpAniSirGlobal pMac, tANI_U32 interval)
{
eHalStatus status;
diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h
index f42fca4f31a9..1987e39ffe7e 100644
--- a/CORE/SME/src/csr/csrInsideApi.h
+++ b/CORE/SME/src/csr/csrInsideApi.h
@@ -1093,6 +1093,9 @@ void csrRoamPrepareBssParams(tpAniSirGlobal mac_ctx, uint32_t session_id,
tCsrRoamProfile *profile, tSirBssDescription *bss_desc,
tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies);
+void csr_remove_bssid_from_scan_list(tpAniSirGlobal mac_ctx,
+ tSirMacAddr bssid);
+
eHalStatus csrRoamSetBssConfigCfg(tpAniSirGlobal mac_ctx, uint32_t session_id,
tCsrRoamProfile *profile, tSirBssDescription *bss_desc,
tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies,
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index a3813c53a9fe..3e22124377d4 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -19113,6 +19113,31 @@ VOS_STATUS sme_oem_get_capability(tHalHandle hal,
}
/**
+ * sme_remove_bssid_from_scan_list() - wrapper to remove the bssid from
+ * scan list
+ * @hal: hal context.
+ * @bssid: bssid to be removed
+ *
+ * This function remove the given bssid from scan list.
+ *
+ * Return: hal status.
+ */
+eHalStatus sme_remove_bssid_from_scan_list(tHalHandle hal,
+ tSirMacAddr bssid)
+{
+ eHalStatus status = eHAL_STATUS_FAILURE;
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ status = sme_AcquireGlobalLock(&mac_ctx->sme);
+ if (HAL_STATUS_SUCCESS(status)) {
+ csr_remove_bssid_from_scan_list(mac_ctx, bssid);
+ sme_ReleaseGlobalLock(&mac_ctx->sme);
+ }
+
+ return status;
+}
+
+/**
* sme_sta_roam_offload_scan() - update sta roam policy for
* unsafe and DFS channels for roaming.
* @hal_handle: hal handle for getting global mac struct