From 0f5044b779957012543bd77849418969876f81b2 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Tue, 26 Sep 2017 20:12:53 -0700 Subject: [PATCH] Fix build on 4.13 Signed-off-by: Vasily Khoruzhick --- core/rtw_ieee80211.c | 1 + os_dep/linux/ioctl_cfg80211.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index a1193f1..b0a3a86 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -23,6 +23,7 @@ #include #endif #include +#include u8 RTW_WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 }; diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 69b40ed..4b44a78 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -792,6 +792,9 @@ check_bss: #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) struct wiphy *wiphy = pwdev->wiphy; struct ieee80211_channel *notify_channel; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) + struct cfg80211_roam_info roam_info = {}; +#endif u32 freq; u16 channel = cur_network->network.Configuration.DSConfig; @@ -800,6 +803,19 @@ check_bss: #endif DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) + roam_info.channel = notify_channel; + roam_info.bssid = cur_network->network.MacAddress; + roam_info.req_ie = + pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2; + roam_info.req_ie_len = + pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2; + roam_info.resp_ie = + pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6; + roam_info.resp_ie_len = + pmlmepriv->assoc_rsp_len-sizeof(struct ieee80211_hdr_3addr)-6; + cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); +#else cfg80211_roamed(padapter->pnetdev #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) , notify_channel @@ -810,6 +826,7 @@ check_bss: , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 , GFP_ATOMIC); +#endif } else { @@ -1882,7 +1899,11 @@ enum nl80211_iftype { */ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, struct net_device *ndev, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) + enum nl80211_iftype type, +#else enum nl80211_iftype type, u32 *flags, +#endif struct vif_params *params) { enum nl80211_iftype old_type; @@ -3996,7 +4017,12 @@ static int #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) unsigned char name_assign_type, #endif - enum nl80211_iftype type, u32 *flags, struct vif_params *params) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) + enum nl80211_iftype type, struct vif_params *params + #else + enum nl80211_iftype type, u32 *flags, struct vif_params *params + #endif + ) { int ret = 0; struct net_device* ndev = NULL; @@ -6486,7 +6512,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy) #endif #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) + wiphy->max_sched_scan_reqs = 1; +#else wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; +#endif #ifdef CONFIG_PNO_SUPPORT wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; #endif