wlan: Modify wlan driver to support msm-4.9 kernel
Upgrade wlan driver to support msm-4.9 kernel and also
maintain backward compatibility with previous kernel versions.
Change-Id: Iaae91fe559bfba05b1da4be9b9ef9a12d6f9df28
CRs-Fixed: 2180168
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 7739afa..46da26c 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -9754,7 +9754,7 @@
hdd_hostapd_state_t *pHostapdState;
VOS_STATUS vos_status;
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(ap_adapter);
-#ifdef CFG80211_DEL_STA_V2
+#ifdef USE_CFG80211_DEL_STA_V2
struct station_del_parameters delStaParams;
#endif
tsap_Config_t *pConfig;
@@ -9764,7 +9764,7 @@
mutex_lock(&pHddCtx->sap_lock);
if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
-#ifdef CFG80211_DEL_STA_V2
+#ifdef USE_CFG80211_DEL_STA_V2
delStaParams.mac = NULL;
delStaParams.subtype = SIR_MAC_MGMT_DEAUTH >> 4;
delStaParams.reason_code = eCsrForcedDeauthSta;
@@ -10182,6 +10182,74 @@
}
#endif
+#if defined(CFG80211_CONNECT_BSS) || \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || \
+ defined (CFG80211_CONNECT_TIMEOUT_REASON_CODE)
+/**
+ * hdd_connect_bss() - helper function to send connection status to supplicant
+ * @dev: network device
+ * @bssid: bssid to which we want to associate
+ * @bss: information about connected bss
+ * @req_ie: Request Information Element
+ * @req_ie_len: len of the req IE
+ * @resp_ie: Response IE
+ * @resp_ie_len: len of ht response IE
+ * @status: status
+ * @gfp: Kernel Flag
+ *
+ * This is a helper function to send connection status to supplicant
+ * and gets invoked from wrapper API
+ *
+ * Return: Void
+ */
+static void hdd_connect_bss(struct net_device *dev,
+ const u8 *bssid,
+ struct cfg80211_bss *bss,
+ const u8 *req_ie,
+ size_t req_ie_len,
+ const u8 *resp_ie,
+ size_t resp_ie_len,
+ u16 status,
+ gfp_t gfp)
+{
+ cfg80211_connect_bss(dev, bssid, bss, req_ie, req_ie_len,
+ resp_ie, resp_ie_len, status, gfp, NL80211_TIMEOUT_UNSPECIFIED);
+}
+#else
+/**
+ * hdd_connect_bss() - helper function to send connection status to supplicant
+ * @dev: network device
+ * @bssid: bssid to which we want to associate
+ * @bss: information about connected bss
+ * @req_ie: Request Information Element
+ * @req_ie_len: len of the req IE
+ * @resp_ie: Response IE
+ * @resp_ie_len: len of ht response IE
+ * @status: status
+ * @gfp: Kernel Flag
+ *
+ * This is a helper function to send connection status to supplicant
+ * and gets invoked from wrapper API
+ *
+ * Return: Void
+ */
+static void hdd_connect_bss(struct net_device *dev,
+ const u8 *bssid,
+ struct cfg80211_bss *bss,
+ const u8 *req_ie,
+ size_t req_ie_len,
+ const u8 *resp_ie,
+ size_t resp_ie_len,
+ u16 status,
+ gfp_t gfp)
+{
+ cfg80211_connect_bss(dev, bssid, bss, req_ie, req_ie_len,
+ resp_ie, resp_ie_len, status, gfp);
+}
+#endif
+
/**
* hdd_connect_result() - API to send connection status to supplicant
* @dev: network device
@@ -10198,7 +10266,6 @@
*
* Return: Void
*/
-#if defined CFG80211_CONNECT_BSS
void hdd_connect_result(struct net_device *dev,
const u8 *bssid,
tCsrRoamInfo *roam_info,
@@ -10219,10 +10286,10 @@
if (chan_no <= 14)
freq = ieee80211_channel_to_frequency(chan_no,
- IEEE80211_BAND_2GHZ);
+ HDD_NL80211_BAND_2GHZ);
else
freq = ieee80211_channel_to_frequency(chan_no,
- IEEE80211_BAND_5GHZ);
+ HDD_NL80211_BAND_5GHZ);
chan = ieee80211_get_channel(padapter->wdev.wiphy, freq);
bss = hdd_get_bss_entry(padapter->wdev.wiphy,
@@ -10231,10 +10298,26 @@
roam_info->u.pConnectedProfile->SSID.length);
}
- cfg80211_connect_bss(dev, bssid, bss, req_ie, req_ie_len,
- resp_ie, resp_ie_len, status, gfp);
+ hdd_connect_bss(dev, bssid, bss, req_ie, req_ie_len, resp_ie, resp_ie_len,
+ status, gfp);
}
#else
+/**
+ * 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
+ * @resp_ie_len: len of ht response IE
+ * @status: status
+ * @gfp: Kernel Flag
+ *
+ * The API is a wrapper to send connection status to supplicant
+ *
+ * Return: Void
+ */
void hdd_connect_result(struct net_device *dev,
const u8 *bssid,
tCsrRoamInfo *roam_info,
@@ -11115,7 +11198,7 @@
void hdd_wlan_free_wiphy_channels(struct wiphy *wiphy)
{
int i =0;
- for (i = 0; i < IEEE80211_NUM_BANDS; i++)
+ for (i = 0; i < HDD_NUM_NL80211_BANDS; i++)
{
if (NULL != wiphy->bands[i] &&
(NULL != wiphy->bands[i]->channels))