From fb36a0c650e5a3e9fec829d03ac8d5a3d5dcda2e Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sun, 2 Dec 2018 20:34:37 +0100 Subject: [PATCH 1/3] Update kernel v4.19 support --- include/wifi.h | 8 ++++---- os_dep/linux/os_intfs.c | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/wifi.h b/include/wifi.h index b86a24c..d12d3d3 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -1067,10 +1067,10 @@ typedef enum _HT_CAP_AMPDU_DENSITY { * A-PMDU buffer sizes * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) */ -#define IEEE80211_MIN_AMPDU_BUF 0x8 -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)) -#define IEEE80211_MAX_AMPDU_BUF 0x40 -#endif +// #define IEEE80211_MIN_AMPDU_BUF 0x8 +// #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)) +// #define IEEE80211_MAX_AMPDU_BUF 0x40 +// #endif /* Spatial Multiplexing Power Save Modes */ #define WLAN_HT_CAP_SM_PS_STATIC 0 diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index b0d45f7..3ff7f3e 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1288,13 +1288,15 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) - , struct net_device *sb_dev -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) - , void *accel_priv -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) - , select_queue_fallback_t fallback +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) + , void *accel_priv + #else + , struct net_device *sb_dev + #endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + , select_queue_fallback_t fallback + #endif #endif ) { From f94c4f6fa5af6a4a6d3cb93bab1eecf4bc00c1db Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sun, 2 Dec 2018 20:36:54 +0100 Subject: [PATCH 2/3] Add kernel v4.20 support and minor compiler warning turned off --- Makefile | 2 ++ os_dep/linux/ioctl_cfg80211.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 274fbe0..5fbd933 100755 --- a/Makefile +++ b/Makefile @@ -26,6 +26,8 @@ ifeq ($(GCC_VER_49),1) EXTRA_CFLAGS += -Wno-date-time -Wno-error=date-time # Fix compile error && warning on gcc 4.9 and later endif +EXTRA_CFLAGS += -Wno-vla + EXTRA_CFLAGS += -I$(src)/include EXTRA_LDFLAGS += --strip-debug diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index f8b725f..bd2a396 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -588,7 +588,11 @@ static u64 rtw_get_systime_us(void) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) struct timespec ts; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) + getboottime(&ts); +#else get_monotonic_boottime(&ts); +#endif return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000; #else struct timeval tv; From 748553d51f652bfb20743336459911149046db1a Mon Sep 17 00:00:00 2001 From: kimocoder Date: Thu, 6 Dec 2018 17:39:58 +0100 Subject: [PATCH 3/3] Fix problem where interfaces are down at start --- dkms.conf | 2 +- os_dep/linux/os_intfs.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dkms.conf b/dkms.conf index df0846a..8532a26 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="realtek-rtl88xxau" -PACKAGE_VERSION="5.2.20.2~20180829" +PACKAGE_VERSION="5.2.20.2~20181106" CLEAN="'make' clean" BUILT_MODULE_NAME[0]=88XXau PROCS_NUM=`nproc` diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 3ff7f3e..e431d04 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -2632,6 +2632,8 @@ static int netdev_vir_if_close(struct net_device *pnetdev) #endif #ifdef CONFIG_IOCTL_CFG80211 + wdev->iftype = NL80211_IFTYPE_MONITOR; + wdev->current_bss = NULL; rtw_scan_abort(padapter); rtw_cfg80211_wait_scan_req_empty(padapter, 200); adapter_wdev_data(padapter)->bandroid_scan = _FALSE; @@ -3450,6 +3452,9 @@ int pm_netdev_open(struct net_device *pnetdev, u8 bnormal) static int netdev_close(struct net_device *pnetdev) { _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); +#ifdef CONFIG_IOCTL_CFG80211 + struct wireless_dev *wdev = padapter->rtw_wdev; +#endif struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_BT_COEXIST_SOCKET_TRX