From c63d8eaba9030fc30a20070cd3b88bd89e7ff2f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Tue, 30 Jan 2018 10:10:57 +0100 Subject: [PATCH] - starting point of kernel 4.15 fixes --- kernel-4.15.patch | 37 +++++++++++++++++++++++++++++++++++++ rtl8812au.spec | 4 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 kernel-4.15.patch diff --git a/kernel-4.15.patch b/kernel-4.15.patch new file mode 100644 index 0000000..8ffbe10 --- /dev/null +++ b/kernel-4.15.patch @@ -0,0 +1,37 @@ +diff -ur rtl8812au-5.1.5/include/osdep_service_linux.h rtl8812au-5.1.5-4.15/include/osdep_service_linux.h +--- rtl8812au-5.1.5/include/osdep_service_linux.h 2017-07-30 13:07:06.000000000 +0200 ++++ rtl8812au-5.1.5-4.15/include/osdep_service_linux.h 2018-01-30 09:39:19.303035056 +0100 +@@ -273,9 +273,13 @@ + __inline static void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx) + { + /* setup_timer(ptimer, pfunc,(u32)cntx); */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ timer_setup(ptimer, pfunc, 0); ++#else + ptimer->function = pfunc; + ptimer->data = (unsigned long)cntx; + init_timer(ptimer); ++#endif + } + + __inline static void _set_timer(_timer *ptimer, u32 delay_time) +diff -ur rtl8812au-5.1.5/os_dep/linux/recv_linux.c rtl8812au-5.1.5-4.15/os_dep/linux/recv_linux.c +--- rtl8812au-5.1.5/os_dep/linux/recv_linux.c 2017-07-30 13:07:06.000000000 +0200 ++++ rtl8812au-5.1.5-4.15/os_dep/linux/recv_linux.c 2018-01-30 10:00:34.479700310 +0100 +@@ -789,10 +789,15 @@ + #endif + + } +-void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) ++void _rtw_reordering_ctrl_timeout_handler(struct timer_list *timer) ++{ ++ struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, timer, reordering_ctrl_timer); ++#else + void _rtw_reordering_ctrl_timeout_handler(void *FunctionContext) + { + struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)FunctionContext; ++#endif + rtw_reordering_ctrl_timeout_handler(preorder_ctrl); + } + diff --git a/rtl8812au.spec b/rtl8812au.spec index 6c58ba3..18349e7 100644 --- a/rtl8812au.spec +++ b/rtl8812au.spec @@ -5,7 +5,7 @@ # nothing to be placed to debuginfo package %define _enable_debug_packages 0 -%define rel 1 +%define rel 1.1 %define snap 20171010 %define pname rtl8812au Summary: Driver for AC1200 (802.11ac) Wireless Dual-Band USB Adapter @@ -21,6 +21,7 @@ Source0: https://github.com/zebulon2/rtl8812au/archive/v5.1.5/%{pname}-%{version #URL: http://www.tenda.com.cn/product/download/U12.html URL: https://github.com/zebulon2/rtl8812au Patch0: gcc-4.9.patch +Patch1: kernel-4.15.patch BuildRequires: rpmbuild(macros) >= 1.701 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2} BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n) @@ -62,6 +63,7 @@ Driver for AC1200 (802.11ac) Wireless Dual-Band USB Adapter\ %prep %setup -q -n %{pname}-5.1.5 %patch0 -p1 +%patch1 -p1 %build %{expand:%build_kernel_packages} -- 2.43.0