diff --git a/README.md b/README.md index af7e09e7e..9478afc7b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ The master branch is based on https://github.com/ulli-kroll/rtl8821au branch v4.3.22-beta/rework. According to rtw_version.c the real driver version is 4.3.20. +My fork is fixed version for kernel versions >4.11. Succesfully build that project on 4.13.11-1-ARCH + The branch v4.3.21 may be built for RTL8814AU or RTL8812AU/RTL8821AU chipset. for building RTL8812AU/RTL8821AU driver type: diff --git a/include/osdep_service.h b/include/osdep_service.h index 82e27c5b8..a61ba8cb6 100755 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -58,6 +58,11 @@ #define BIT(x) ( 1 << (x)) #endif +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#include +#endif + #define BIT0 0x00000001 #define BIT1 0x00000002 #define BIT2 0x00000004 diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index c92dd77e5..03bd4d608 100755 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -795,22 +795,37 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) struct ieee80211_channel *notify_channel; u32 freq; u16 channel = cur_network->network.Configuration.DSConfig; - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + struct cfg80211_roam_info roam_info = {}; +#endif freq = rtw_ch2freq(channel); notify_channel = ieee80211_get_channel(wiphy, freq); #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 rtw_ieee80211_hdr_3addr) + 2; + roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2; + roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6; + roam_info.resp_ie_len = pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6; +#endif + cfg80211_roamed(padapter->pnetdev - #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) - , notify_channel - #endif - , cur_network->network.MacAddress - , pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2 - , pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2 - , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 - , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 - , GFP_ATOMIC); +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)) || defined(COMPAT_KERNEL_RELEASE) + , notify_channel +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + , &roam_info, GFP_ATOMIC); +#else + , cur_network->network.MacAddress + , pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2 + , pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2 + , 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 { @@ -1875,7 +1890,7 @@ enum nl80211_iftype { */ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, struct net_device *ndev, - enum nl80211_iftype type, u32 *flags, + enum nl80211_iftype type, struct vif_params *params) { enum nl80211_iftype old_type; @@ -3951,7 +3966,12 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(mon_ndev->name, name, IFNAMSIZ); mon_ndev->name[IFNAMSIZ - 1] = 0; +#if(LINUX_VERSION_CODE>=KERNEL_VERSION(4,11,9)) + mon_ndev->needs_free_netdev = false; + mon_ndev->priv_destructor = rtw_ndev_destructor; +#else mon_ndev->destructor = rtw_ndev_destructor; +#endif #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops; @@ -4018,7 +4038,7 @@ 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) + enum nl80211_iftype type, struct vif_params *params) { int ret = 0; struct net_device* ndev = NULL; @@ -6475,7 +6495,7 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy) /* wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX | WIPHY_FLAG_HAVE_AP_SME; */ #endif -#if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) +#if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; #ifdef CONFIG_PNO_SUPPORT wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; @@ -6859,4 +6879,3 @@ void rtw_cfg80211_dev_res_unregister(struct dvobj_priv *dvobj) } #endif /* CONFIG_IOCTL_CFG80211 */ -