$ 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
Found at [49821e5].
OS
Compiler
Log