FomalhautWeisszwerg / rtl8822bu

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

Building fails with "error: ‘WIPHY_FLAG_SUPPORTS_SCHED_SCAN’ undeclared" #4

Closed FomalhautWeisszwerg closed 7 years ago

FomalhautWeisszwerg commented 7 years ago

Found at [49821e5].

OS

$ uname -a
Linux debian-server 4.13.0-1-amd64 #1 SMP Debian 4.13.10-1 (2017-10-30) 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.2.0-12' --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.2.1 20171025 (Debian 7.2.0-12)

Log

$ git show
commit 49821e5beee8e424ac00ae8c5a9725554ca7287e (HEAD -> chase_to_linux-4.12, origin/chase_to_linux-4.12)
Author: Fomalhaut Weisszwerg <weisszwerg@gmail.com>
Date:   Sun Nov 5 02:21:28 2017 +0900

    Adapt `rtw_cfg80211_add_monitor_if()` to the change of Linux kernel [cf124db566e6b036b8bcbe8decbed740bdfac8c6].

diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
index 4b9bb7c..e2a4032 100644
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -3614,7 +3614,15 @@ 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 KERNEL_VERSION(4, 12, 0) < LINUX_VERSION_CODE
+       /* struct `net_device` was changed by commit [cf124db5] in Linux kernel.
+        * See https://github.com/torvalds/linux/commit/cf124db566e6b036b8bcbe8decbed740bdfac8c6
+        */
+       mon_ndev->needs_free_netdev = false;
+       mon_ndev->priv_destructor   = rtw_ndev_destructor;
+#elif
        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;
$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.13.0-1-amd64/build M=/home/working/rtl8822bu modules
make[1]: Entering directory '/usr/src/linux-headers-4.13.0-1-amd64'
  CC [M]  /home/working/rtl8822bu/core/rtw_cmd.o
  CC [M]  /home/working/rtl8822bu/core/rtw_security.o
  CC [M]  /home/working/rtl8822bu/core/rtw_debug.o
  CC [M]  /home/working/rtl8822bu/core/rtw_io.o
  CC [M]  /home/working/rtl8822bu/core/rtw_ioctl_query.o
  CC [M]  /home/working/rtl8822bu/core/rtw_ioctl_set.o
  CC [M]  /home/working/rtl8822bu/core/rtw_ieee80211.o
  CC [M]  /home/working/rtl8822bu/core/rtw_mlme.o
  CC [M]  /home/working/rtl8822bu/core/rtw_mlme_ext.o
  CC [M]  /home/working/rtl8822bu/core/rtw_mi.o
  CC [M]  /home/working/rtl8822bu/core/rtw_wlan_util.o
  CC [M]  /home/working/rtl8822bu/core/rtw_vht.o
  CC [M]  /home/working/rtl8822bu/core/rtw_pwrctrl.o
  CC [M]  /home/working/rtl8822bu/core/rtw_rf.o
  CC [M]  /home/working/rtl8822bu/core/rtw_recv.o
  CC [M]  /home/working/rtl8822bu/core/rtw_sta_mgt.o
  CC [M]  /home/working/rtl8822bu/core/rtw_ap.o
  CC [M]  /home/working/rtl8822bu/core/rtw_xmit.o
  CC [M]  /home/working/rtl8822bu/core/rtw_p2p.o
  CC [M]  /home/working/rtl8822bu/core/rtw_tdls.o
  CC [M]  /home/working/rtl8822bu/core/rtw_br_ext.o
  CC [M]  /home/working/rtl8822bu/core/rtw_iol.o
  CC [M]  /home/working/rtl8822bu/core/rtw_sreset.o
  CC [M]  /home/working/rtl8822bu/core/rtw_btcoex.o
  CC [M]  /home/working/rtl8822bu/core/rtw_beamforming.o
  CC [M]  /home/working/rtl8822bu/core/rtw_odm.o
  CC [M]  /home/working/rtl8822bu/core/efuse/rtw_efuse.o
  CC [M]  /home/working/rtl8822bu/os_dep/osdep_service.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/os_intfs.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/usb_intf.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/usb_ops_linux.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/ioctl_linux.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/xmit_linux.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/mlme_linux.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/recv_linux.o
  CC [M]  /home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.o
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c: In function ‘rtw_cfg80211_indicate_connect’:
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:755:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   struct cfg80211_roam_info roam_info;
   ^~~~~~
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c: In function ‘rtw_cfg80211_preinit_wiphy’:
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:6124:18: error: ‘WIPHY_FLAG_SUPPORTS_SCHED_SCAN’ undeclared (first use in this function)
  wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:6124:18: note: each undeclared identifier is reported only once for each function it appears in
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c: At top level:
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:6157:25: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .change_virtual_intf = cfg80211_rtw_change_iface,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:6157:25: note: (near initialization for ‘rtw_cfg80211_ops.change_virtual_intf’)
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:6180:22: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .add_virtual_intf = cfg80211_rtw_add_virtual_intf,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.c:6180:22: note: (near initialization for ‘rtw_cfg80211_ops.add_virtual_intf’)
cc1: some warnings being treated as errors
/usr/src/linux-headers-4.13.0-1-common/scripts/Makefile.build:307: recipe for target '/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.o' failed
make[4]: *** [/home/working/rtl8822bu/os_dep/linux/ioctl_cfg80211.o] Error 1
/usr/src/linux-headers-4.13.0-1-common/Makefile:1529: recipe for target '_module_/home/working/rtl8822bu' failed
make[3]: *** [_module_/home/working/rtl8822bu] Error 2
Makefile:145: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.13.0-1-amd64'
Makefile:1318: recipe for target 'modules' failed
make: *** [modules] Error 2
FomalhautWeisszwerg commented 7 years ago

Later kernel 4.12, concurrently scheduled scan is default. See https://github.com/torvalds/linux/commit/ca986ad9bcd3893c8b0b4cc2cafcc8cf1554409c