FomalhautWeisszwerg / rtl8822bu

RTL8822BU Wireless Driver for Linux >= 4.12
GNU General Public License v2.0
34 stars 12 forks source link

building failed with "error: ‘_timer {aka struct timer_list}’ has no member named ‘data’" on Linux-4.15 #10

Closed FomalhautWeisszwerg closed 6 years ago

FomalhautWeisszwerg commented 6 years ago

Found on the commit [92b91ec8635177c5a373b73bc878c4c385165dc8]

$ git show
commit 92b91ec8635177c5a373b73bc878c4c385165dc8 (HEAD -> linux-4.15, origin/master, origin/linux-4.15, origin/develop, origin/HEAD, master, develop)
Author: Fomalhaut Weisszwerg <weisszwerg@gmail.com>
Date:   Tue Jan 9 12:18:21 2018 +0900

    Update: readme.

    Now supports "Linksys WUSB6400M AC1200 MU-MIMO USB Wi-Fi Adapter".

diff --git a/README.md b/README.md
index 0ec71db..17eb350 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Currently, only STA/Monitor Mode is supported, no AP.
 A few known wireless cards that use this driver include
 * [Edimax EW-7822ULC](http://us.edimax.com/edimax/merchandise/merchandise_detail/data/edimax/us/wireless_adapters_ac1200_dual-band/ew-7822ulc/)
 * [ASUS AC-53 NANO](https://www.asus.com/Networking/USB-AC53-Nano/)
-
+* [Linksys WUSB6400M](https://www.linksys.com/us/p/P-WUSB6400M/)

 ## Prerequisite

OS

$ uname -a
Linux debian-server 4.15.0-1-amd64 #1 SMP Debian 4.15.4-1 (2018-02-18) x86_64 GNU/Linux

Compiler

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.3.0-5' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Debian 7.3.0-5)

log

$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.15.0-1-amd64/build M=/home/working/rtl8822bu modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-1-amd64'
  CC [M]  /home/working/rtl8822bu/core/rtw_cmd.o
In file included from /home/working/rtl8822bu/include/osdep_service.h:41:0,
                 from /home/working/rtl8822bu/include/drv_types.h:32,
                 from /home/working/rtl8822bu/core/rtw_cmd.c:22:
/home/working/rtl8822bu/include/osdep_service_linux.h: In function ‘_init_timer’:
/home/working/rtl8822bu/include/osdep_service_linux.h:257:8: error: ‘_timer {aka struct timer_list}’ has no member named ‘data’
  ptimer->data = (unsigned long)cntx;
        ^~
/home/working/rtl8822bu/include/osdep_service_linux.h:258:2: error: implicit declaration of function ‘init_timer’; did you mean ‘_init_timer’? [-Werror=implicit-function-declaration]
  init_timer(ptimer);
  ^~~~~~~~~~
  _init_timer
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-headers-4.15.0-1-common/scripts/Makefile.build:322: /home/working/rtl8822bu/core/rtw_cmd.o] Error 1
make[3]: *** [/usr/src/linux-headers-4.15.0-1-common/Makefile:1523: _module_/home/working/rtl8822bu] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:8: all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-1-amd64'
make: *** [Makefile:1318: modules] Error 2
FomalhautWeisszwerg commented 6 years ago

The timer interface seems to have been changed so much. https://lkml.org/lkml/2017/11/25/90 https://github.com/torvalds/linux/commit/844056fd74ebdd826bd23a7d989597e15f478acb#diff-ba8897e9349509c7ca4d37b0704bee9c

FomalhautWeisszwerg commented 6 years ago

In < Linux-4.15, the init_timer is a macro defined as following:

#define init_timer(timer)                       \
    __init_timer((timer), 0)

And __init_timer macro is defined as:

#define __init_timer(_timer, _flags)                    \
    init_timer_key((_timer), (_flags), NULL, NULL)

Since Linux-4.15, the timer_setup is a macro defined as following:

#define timer_setup(timer, callback, flags)         \
    __init_timer((timer), (callback), (flags))

And __init_timer macro is defined as:

#define __init_timer(_timer, _fn, _flags)               \
    init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
divinitus commented 6 years ago

Are you going to fix that issue? Fedora 27 runs 4.15 and having that driver would be very nice.

I hereby declare the will to stress test it and send stability/performance feedback

FomalhautWeisszwerg commented 6 years ago

Yes, I'm fixing this issue but not works yet.

FomalhautWeisszwerg commented 6 years ago

On 745701ac181ad5396183b3df14344e51e9f539c6, this driver support the new timer interface on Linux-4.15.

Thanks @alecdotninja :-)