summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKanchanapally, Vidyullatha <vkanchan@qti.qualcomm.com>2016-04-28 18:56:39 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-05-03 12:29:10 +0530
commit9c87d3d0e6b54c342bf76900bd8c8be6b91ceaab (patch)
treeb0605896aa4a4beefe98b3d03baeff16705b4bac
parentb2ab75a7ada5882a653596afa50d267526fd0097 (diff)
qcacld-2.0: Add support for new cfg80211 connect api
The new cfg80211 connect api 'cfg80211_connect_bss' takes a new input parameter, the connected bss. This is required for the kernel to map its current_bss to the bss on the correct channel when more than one bssid, ssid pair is present on different channels with the kernel. Without this the kernel might report a wrong channel as the associated channel. Hence add support in driver to use the new connect api. Change-Id: I1e5ded1b40ca324469917acebf17a03cc1e1c679 CRs-Fixed: 1008794
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h6
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c8
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c51
3 files changed, 56 insertions, 9 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index ce8c8895739b..0fd2ed9ed98e 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -2111,9 +2111,9 @@ wlan_hdd_clean_tx_flow_control_timer(hdd_context_t *hddctx,
#endif
void hdd_connect_result(struct net_device *dev, const u8 *bssid,
- const u8 *req_ie, size_t req_ie_len,
- const u8 * resp_ie, size_t resp_ie_len,
- u16 status, gfp_t gfp);
+ tCsrRoamInfo *roam_info, const u8 *req_ie,
+ size_t req_ie_len, const u8 * resp_ie,
+ size_t resp_ie_len, u16 status, gfp_t gfp);
int wlan_hdd_init_tx_rx_histogram(hdd_context_t *pHddCtx);
void wlan_hdd_deinit_tx_rx_histogram(hdd_context_t *pHddCtx);
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index da8f8875dd0b..16234d95182f 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -1918,7 +1918,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
hddLog(LOG1, "%s ft_carrier_on is %d, sending connect "
"indication", __FUNCTION__, ft_carrier_on);
- hdd_connect_result(dev, pRoamInfo->bssid,
+ hdd_connect_result(dev, pRoamInfo->bssid, pRoamInfo,
pFTAssocReq, assocReqlen,
pFTAssocRsp, assocRsplen,
WLAN_STATUS_SUCCESS,
@@ -1953,7 +1953,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
roamResult, roamStatus);
/* inform connect result to nl80211 */
- hdd_connect_result(dev, pRoamInfo->bssid,
+ hdd_connect_result(dev, pRoamInfo->bssid, pRoamInfo,
reqRsnIe, reqRsnLength,
rspRsnIe, rspRsnLength,
WLAN_STATUS_SUCCESS,
@@ -2148,12 +2148,12 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
if ( eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL == roamResult )
{
if (pRoamInfo)
- hdd_connect_result(dev, pRoamInfo->bssid,
+ hdd_connect_result(dev, pRoamInfo->bssid, NULL,
NULL, 0, NULL, 0,
WLAN_STATUS_ASSOC_DENIED_UNSPEC,
GFP_KERNEL);
else
- hdd_connect_result(dev, pWextState->req_bssId,
+ hdd_connect_result(dev, pWextState->req_bssId, NULL,
NULL, 0, NULL, 0,
WLAN_STATUS_ASSOC_DENIED_UNSPEC,
GFP_KERNEL);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 8f91ba2738f1..7b04621644db 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -11635,6 +11635,7 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx )
* hdd_connect_result() - API to send connection status to supplicant
* @dev: network device
* @bssid: bssid to which we want to associate
+ * @roam_info: information about connected bss
* @req_ie: Request Information Element
* @req_ie_len: len of the req IE
* @resp_ie: Response IE
@@ -11647,9 +11648,55 @@ VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx )
*
* Return: Void
*/
+#if defined CFG80211_CONNECT_BSS
+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,
+ size_t resp_ie_len,
+ u16 status,
+ gfp_t gfp)
+{
+ hdd_adapter_t *padapter = (hdd_adapter_t *) netdev_priv(dev);
+ struct cfg80211_bss *bss = NULL;
+ if (WLAN_STATUS_SUCCESS == status) {
+ struct ieee80211_channel *chan;
+ int freq;
+ int chan_no = roam_info->pBssDesc->channelId;;
+
+ if (chan_no <= 14)
+ 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(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
+ }
+
+ cfg80211_connect_bss(dev, bssid, bss, req_ie, req_ie_len,
+ resp_ie, resp_ie_len, status, gfp);
+
+ vos_runtime_pm_allow_suspend(padapter->runtime_context.connect);
+}
+#else
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,
@@ -11664,7 +11711,7 @@ void hdd_connect_result(struct net_device *dev,
vos_runtime_pm_allow_suspend(padapter->runtime_context.connect);
}
-
+#endif
VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx )
{
@@ -11724,7 +11771,7 @@ VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx )
* Indicate connect failure to supplicant if we were in the
* process of connecting
*/
- hdd_connect_result(pAdapter->dev, NULL,
+ hdd_connect_result(pAdapter->dev, NULL, NULL,
NULL, 0, NULL, 0,
WLAN_STATUS_ASSOC_DENIED_UNSPEC,
GFP_KERNEL);