diff -Nru rtl8812au-4.3.8.12175.20140902+dfsg/debian/changelog rtl8812au-4.3.8.12175.20140902+dfsg/debian/changelog --- rtl8812au-4.3.8.12175.20140902+dfsg/debian/changelog 2018-02-08 09:30:41.000000000 -0800 +++ rtl8812au-4.3.8.12175.20140902+dfsg/debian/changelog 2019-05-08 13:42:49.000000000 -0700 @@ -1,3 +1,13 @@ +rtl8812au (4.3.8.12175.20140902+dfsg-0ubuntu8.1) bionic; urgency=medium + + * Linux 4.20 and 5.0 compatibility (LP: #1813068) + - debian/patches/4.20-kernel-compatibility.patch + - debian/patches/5.0-kernel-compatibility.patch + * Linux 4.19 compatibility (LP: #1802012) + - debian/patches/4.19-kernel-compatibility.patch + + -- Connor Kuehl Wed, 08 May 2019 13:42:49 -0700 + rtl8812au (4.3.8.12175.20140902+dfsg-0ubuntu8) bionic; urgency=medium * Linux 4.15 compatibility (LP: #1737756) diff -Nru rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.19-kernel-compatibility.patch rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.19-kernel-compatibility.patch --- rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.19-kernel-compatibility.patch 1969-12-31 16:00:00.000000000 -0800 +++ rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.19-kernel-compatibility.patch 2019-05-08 13:42:49.000000000 -0700 @@ -0,0 +1,30 @@ +From: Thadeu Lima de Souza Cascardo +Subject: Fix build for 4.19 + +BugLink: https://bugs.launchpad.net/bugs/1802012 + +Signed-off-by: Thadeu Lima de Souza Cascardo +Signed-off-by: Connor Kuehl +--- +Index: rtl8812au-4.3.8.12175.20140902+dfsg/os_dep/linux/os_intfs.c +=================================================================== +--- rtl8812au-4.3.8.12175.20140902+dfsg.orig/os_dep/linux/os_intfs.c ++++ rtl8812au-4.3.8.12175.20140902+dfsg/os_dep/linux/os_intfs.c +@@ -657,13 +657,14 @@ unsigned int rtw_classify8021d(struct sk + + + static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) ++#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 + #endif +- +-#endif + ) + { + _adapter *padapter = rtw_netdev_priv(dev); diff -Nru rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.20-kernel-compatibility.patch rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.20-kernel-compatibility.patch --- rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.20-kernel-compatibility.patch 1969-12-31 16:00:00.000000000 -0800 +++ rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/4.20-kernel-compatibility.patch 2019-05-08 13:42:49.000000000 -0700 @@ -0,0 +1,23 @@ +From: Marcelo Cerri +Subject: Fix build for 4.20 + +BugLink: https://bugs.launchpad.net/bugs/1813068 + +Signed-off-by: Marcelo Cerri +Signed-off-by: Connor Kuehl +--- +--- a/os_dep/linux/ioctl_cfg80211.c ++++ b/os_dep/linux/ioctl_cfg80211.c +@@ -358,7 +358,11 @@ + + static u64 rtw_get_systime_us(void) + { +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) ++ struct timespec64 ts; ++ ktime_get_boottime_ts64(&ts); ++ return ((u64)ts.tv_sec*1000000) + ts.tv_nsec / 1000; ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + struct timespec ts; + get_monotonic_boottime(&ts); + return ((u64)ts.tv_sec*1000000) + ts.tv_nsec / 1000; diff -Nru rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/5.0-kernel-compatibility.patch rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/5.0-kernel-compatibility.patch --- rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/5.0-kernel-compatibility.patch 1969-12-31 16:00:00.000000000 -0800 +++ rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/5.0-kernel-compatibility.patch 2019-05-08 13:42:49.000000000 -0700 @@ -0,0 +1,22 @@ +From: Marcelo Cerri +Subject: Fix build for 5.0 + +BugLink: https://bugs.launchpad.net/bugs/1813068 + +Signed-off-by: Marcelo Cerri +Signed-off-by: Connor Kuehl +--- +--- a/os_dep/linux/rtw_android.c ++++ b/os_dep/linux/rtw_android.c +@@ -608,7 +608,11 @@ + goto exit; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) ++ if (!access_ok(priv_cmd.buf, priv_cmd.total_len)){ ++#else + if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){ ++#endif + DBG_871X("%s: failed to access memory\n", __FUNCTION__); + ret = -EFAULT; + goto exit; diff -Nru rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/series rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/series --- rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/series 2018-02-08 09:30:41.000000000 -0800 +++ rtl8812au-4.3.8.12175.20140902+dfsg/debian/patches/series 2019-05-08 13:42:09.000000000 -0700 @@ -15,3 +15,6 @@ 4.11.9-kernel-compatibility.patch 4.12-kernel-compatibility.patch 4.15-kernel-compatibility.patch +4.19-kernel-compatibility.patch +4.20-kernel-compatibility.patch +5.0-kernel-compatibility.patch