summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h5
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c31
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c15
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c52
4 files changed, 67 insertions, 36 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index e6d6d360b6cc..d41a45f58e44 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -2352,6 +2352,11 @@ wlan_hdd_clean_tx_flow_control_timer(hdd_context_t *hddctx,
}
#endif
+struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy,
+ struct ieee80211_channel *channel,
+ const u8 *bssid,
+ const u8 *ssid, size_t ssid_len);
+
void hdd_connect_result(struct net_device *dev, const u8 *bssid,
tCsrRoamInfo *roam_info, const u8 *req_ie,
size_t req_ie_len, const u8 * resp_ie,
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 97db2a909ef2..4fb300446b56 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -1539,15 +1539,10 @@ static void hdd_SendReAssocEvent(struct net_device *dev,
(int)pCsrRoamInfo->pBssDesc->channelId);
memset(&roam_profile, 0, sizeof(tCsrRoamConnectedProfile));
sme_RoamGetConnectProfile(hal_handle, pAdapter->sessionId, &roam_profile);
- bss = cfg80211_get_bss(pAdapter->wdev.wiphy, chan, pCsrRoamInfo->bssid,
- &roam_profile.SSID.ssId[0], roam_profile.SSID.length,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) && !defined(WITH_BACKPORTS) \
- && !defined(IEEE80211_PRIVACY)
- WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
-#else
- IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
-#endif
-
+ bss = hdd_cfg80211_get_bss(pAdapter->wdev.wiphy,
+ chan, pCsrRoamInfo->bssid,
+ &roam_profile.SSID.ssId[0],
+ roam_profile.SSID.length);
if (bss == NULL)
hddLog(LOGE, FL("Get BSS returned NULL"));
buf_ptr = buf_ssid_ie;
@@ -1961,6 +1956,8 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
{
if ( !hddDisconInProgress )
{
+ struct cfg80211_bss *roam_bss;
+
/* After roaming is completed, active session count is
* incremented as a part of connect indication but
* effectively the active session count should still
@@ -1975,9 +1972,19 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
(int)pRoamInfo->pBssDesc->channelId);
hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen,
assocRsplen);
- cfg80211_roamed(dev,chan, pRoamInfo->bssid,
- pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen,
- GFP_KERNEL);
+ roam_bss =
+ hdd_cfg80211_get_bss(
+ pAdapter->wdev.wiphy,
+ chan,
+ pRoamInfo->bssid,
+ pRoamInfo->u.
+ pConnectedProfile->SSID.ssId,
+ pRoamInfo->u.
+ pConnectedProfile->SSID.length);
+ cfg80211_roamed_bss(dev, roam_bss,
+ pFTAssocReq, assocReqlen,
+ pFTAssocRsp, assocRsplen,
+ GFP_KERNEL);
}
if (sme_GetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId))
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index ed8dcc152e2f..cb51f9dfa221 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -18972,20 +18972,9 @@ struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_list(
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_bss *bss = NULL;
- bss = cfg80211_get_bss(wiphy, NULL, bssid,
+ bss = hdd_cfg80211_get_bss(wiphy, NULL, bssid,
NULL,
- 0,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) && !defined(WITH_BACKPORTS) \
- && !defined(IEEE80211_PRIVACY)
- (pAdapter->device_mode == WLAN_HDD_IBSS) ? \
- WLAN_CAPABILITY_IBSS : WLAN_CAPABILITY_ESS,
- (pAdapter->device_mode == WLAN_HDD_IBSS) ? \
- WLAN_CAPABILITY_IBSS : WLAN_CAPABILITY_ESS);
-#else
- (pAdapter->device_mode == WLAN_HDD_IBSS) ? \
- IEEE80211_BSS_TYPE_IBSS : IEEE80211_BSS_TYPE_ESS,
- IEEE80211_PRIVACY_ANY);
-#endif
+ 0);
if (bss == NULL) {
hddLog(LOGE, FL("BSS not present"));
} else {
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 7212d52b2149..b70e3eff77e7 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -11903,6 +11903,44 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx )
return VOS_STATUS_SUCCESS;
}
+/**
+ * hdd_get_bss_entry() - Get the bss entry matching the chan, bssid and ssid
+ * @wiphy: wiphy
+ * @channel: channel of the BSS to find
+ * @bssid: bssid of the BSS to find
+ * @ssid: ssid of the BSS to find
+ * @ssid_len: ssid len of of the BSS to find
+ *
+ * The API is a wrapper to get bss from kernel matching the chan,
+ * bssid and ssid
+ *
+ * Return: bss structure if found else NULL
+ */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) \
+ && !defined(WITH_BACKPORTS) && !defined(IEEE80211_PRIVACY)
+struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy,
+ struct ieee80211_channel *channel,
+ const u8 *bssid, const u8 *ssid,
+ size_t ssid_len)
+{
+ return cfg80211_get_bss(wiphy, channel, bssid,
+ ssid, ssid_len,
+ WLAN_CAPABILITY_ESS,
+ WLAN_CAPABILITY_ESS);
+}
+#else
+struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy,
+ struct ieee80211_channel *channel,
+ const u8 *bssid, const u8 *ssid,
+ size_t ssid_len)
+{
+ return cfg80211_get_bss(wiphy, channel, bssid,
+ ssid, ssid_len,
+ IEEE80211_BSS_TYPE_ESS,
+ IEEE80211_PRIVACY_ANY);
+}
+#endif
+
#if defined CFG80211_CONNECT_BSS
/**
* hdd_connect_bss() - API to send connection status to supplicant
@@ -11990,17 +12028,9 @@ void hdd_connect_result(struct net_device *dev,
IEEE80211_BAND_5GHZ);
chan = ieee80211_get_channel(padapter->wdev.wiphy, freq);
- bss = cfg80211_get_bss(padapter->wdev.wiphy, chan, bssid,
- roam_info->u.pConnectedProfile->SSID.ssId,
- roam_info->u.pConnectedProfile->SSID.length,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) \
- && !defined(WITH_BACKPORTS) && !defined(IEEE80211_PRIVACY)
- WLAN_CAPABILITY_ESS
- WLAN_CAPABILITY_ESS);
-#else
- IEEE80211_BSS_TYPE_ESS,
- IEEE80211_PRIVACY_ANY);
-#endif
+ bss = hdd_cfg80211_get_bss(padapter->wdev.wiphy, chan, bssid,
+ roam_info->u.pConnectedProfile->SSID.ssId,
+ roam_info->u.pConnectedProfile->SSID.length);
}
hdd_connect_bss(dev, bssid, bss, req_ie,