diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e2b4d893ce56..9332e403d936 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -8288,6 +8288,12 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, struct cfg80211_connect_params *req) { int status; + u16 channel; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) + const u8 *bssid_hint = req->bssid_hint; +#else + const u8 *bssid_hint = NULL; +#endif hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev); hdd_context_t *pHddCtx; @@ -8359,31 +8365,13 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, return status; } - if (req->channel) { - status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, - req->ssid_len, - req->bssid, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) || \ - defined(CFG80211_BSSID_HINT_BACKPORT) - req->bssid_hint, -#else - NULL, -#endif - req->channel-> - hw_value); - } else { - status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, - req->ssid_len, - req->bssid, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) || \ - defined(CFG80211_BSSID_HINT_BACKPORT) - req->bssid_hint, -#else - NULL, -#endif - 0); - } - + if (req->channel) + channel = req->channel->hw_value; + else + channel = 0; + status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, + req->ssid_len, req->bssid, + bssid_hint, channel); if (0 > status) { hddLog(LOGE, FL("connect failed")); return status;