qcacld-3.0: Clean up cfg80211 del_station for Kernel upgrade
Commit: 89c771e ("cfg80211: Convert del_station() callback to
use a param struct")
Commit: 9885686 ("cfg80211: Specify frame and reason code for
NL80211_CMD_DEL_STATION")
These two commits have been merged in Kernel 3.19.
Add a kernel version macro to support this.
And refactor the inclusion of CFG80211_DEL_STA_V2 by adding a
helper function to clean it up, that way we can keep the flag
only in wlan_hdd_cfg80211.h/c as this is the cfg80211 interface
related changes.
Change-Id: I811065b7fa1cf2aee68cfe63c5cf78c2270e5af7
CRs-fixed: 963651
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index 7d05c1b..eaa82be 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -106,6 +106,10 @@
#define CHANNEL_SWITCH_SUPPORTED
#endif
+#if defined(CFG80211_DEL_STA_V2) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) || defined(WITH_BACKPORTS)
+#define USE_CFG80211_DEL_STA_V2
+#endif
+
/**
* typedef struct qcom_ie_age - age ie
*
@@ -2324,7 +2328,9 @@
uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length,
uint8_t eid);
-#ifdef CFG80211_DEL_STA_V2
+void wlan_hdd_del_station(hdd_adapter_t *adapter);
+
+#if defined(USE_CFG80211_DEL_STA_V2)
int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
struct net_device *dev,
struct station_del_parameters *param);
@@ -2338,7 +2344,8 @@
struct net_device *dev,
uint8_t *mac);
#endif
-#endif
+#endif /* USE_CFG80211_DEL_STA_V2 */
+
#if defined(QCA_WIFI_FTM) && defined(CONFIG_NL80211_TESTMODE)
void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len);