ulli-kroll / rtw88-usb

rtw88 family usb driver for linux rtl8723du rtl8822bu rtl8821cu rtl8822cu
GNU General Public License v2.0
55 stars 15 forks source link

How to compile for ARM (raspberry) - only USB part #17

Open nikallian opened 3 years ago

nikallian commented 3 years ago

Hi,

I tried to compile for ARM (raspbeerry pi 3+ latest kernel) but the first attempt ended with an error

/root/rtw88-usb/rtw8822be.c:27:1: warning: data definition has no type or storage class
 module_pci_driver(rtw_8822be_driver);
 ^~~~~~~~~~~~~~~~~
/root/rtw88-usb/rtw8822be.c:27:1: error: type defaults to ‘int’ in declaration of ‘module_pci_driver’ [-Werror=implicit-int]
/root/rtw88-usb/rtw8822be.c:27:1: warning: parameter names (without types) in function declaration
/root/rtw88-usb/rtw8822be.c:19:26: warning: ‘rtw_8822be_driver’ defined but not used [-Wunused-variable]
 static struct pci_driver rtw_8822be_driver = {
                          ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

When I removed all the references to pci and all other drivers except the one I am interested to (8822bu) the compilation almost completed but this time another error occured

make[1]: Entering directory '/usr/src/linux-headers-5.10.17-v7+'
  CC [M]  /root/rtw88-usb/main.o
  CC [M]  /root/rtw88-usb/mac80211.o
  CC [M]  /root/rtw88-usb/util.o
  CC [M]  /root/rtw88-usb/debug.o
  CC [M]  /root/rtw88-usb/tx.o
  CC [M]  /root/rtw88-usb/rx.o
  CC [M]  /root/rtw88-usb/mac.o
  CC [M]  /root/rtw88-usb/phy.o
  CC [M]  /root/rtw88-usb/coex.o
  CC [M]  /root/rtw88-usb/efuse.o
  CC [M]  /root/rtw88-usb/fw.o
  CC [M]  /root/rtw88-usb/ps.o
  CC [M]  /root/rtw88-usb/sec.o
  CC [M]  /root/rtw88-usb/bf.o
  CC [M]  /root/rtw88-usb/wow.o
  CC [M]  /root/rtw88-usb/regd.o
  CC [M]  /root/rtw88-usb/rtw8822bu.o
  CC [M]  /root/rtw88-usb/usb.o
  LD [M]  /root/rtw88-usb/rtw88_core.o
  LD [M]  /root/rtw88-usb/rtw88_8822bu.o
  LD [M]  /root/rtw88-usb/rtw88_usb.o
  MODPOST /root/rtw88-usb/Module.symvers
ERROR: modpost: "rtw8822b_hw_spec" [/root/rtw88-usb/rtw88_8822bu.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:111: /root/rtw88-usb/Module.symvers] Error 1
make[2]: *** Deleting file '/root/rtw88-usb/Module.symvers'
make[1]: *** [Makefile:1708: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.17-v7+'
make: *** [Makefile:51: all] Error 2

Any help on how to proceed ?

Thanks in advance!

smutking commented 3 years ago

Try with EXTRA_CFLAGS+=-Wno-implicit-function-declaration or EXTRA_CFLAGS+=-Wno-implicit-int.

ulli-kroll commented 3 years ago

first don't compile as root second you the right kernel source/headers with .config

use this as "sample"

$ make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-uclibc- KSRC=~/linux-aarch64

koshkamau commented 3 years ago

I'm also trying to cross-compile this driver for my Allwinner A10 board and I'm getting errors. I have an "unfortunate" board :) This driver quickly fails on one type of usb ports and completely freezes the system on the other type of usb pots (though much slowly). So I'm in desperate search for a working driver... CFG80211, MAC80211 and Realtek ac support are enabled in kernel

user@virtualsrv:~/rtw88-usb$ make all
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/user/aw/linux-5.10.42 M=/home/user/rtw88-usb  modules
make[1]: Entering directory '/home/user/aw/linux-5.10.42'
  CC [M]  /home/user/rtw88-usb/main.o
  CC [M]  /home/user/rtw88-usb/mac80211.o
  CC [M]  /home/user/rtw88-usb/util.o
  CC [M]  /home/user/rtw88-usb/debug.o
  CC [M]  /home/user/rtw88-usb/tx.o
  CC [M]  /home/user/rtw88-usb/rx.o
  CC [M]  /home/user/rtw88-usb/mac.o
  CC [M]  /home/user/rtw88-usb/phy.o
  CC [M]  /home/user/rtw88-usb/coex.o
  CC [M]  /home/user/rtw88-usb/efuse.o
  CC [M]  /home/user/rtw88-usb/fw.o
  CC [M]  /home/user/rtw88-usb/ps.o
  CC [M]  /home/user/rtw88-usb/sec.o
  CC [M]  /home/user/rtw88-usb/bf.o
  CC [M]  /home/user/rtw88-usb/wow.o
  CC [M]  /home/user/rtw88-usb/regd.o
  LD [M]  /home/user/rtw88-usb/rtw88_core.o
  CC [M]  /home/user/rtw88-usb/rtw8821cu.o
  LD [M]  /home/user/rtw88-usb/rtw88_8821cu.o
  CC [M]  /home/user/rtw88-usb/pci.o
  LD [M]  /home/user/rtw88-usb/rtw88_pci.o
  CC [M]  /home/user/rtw88-usb/usb.o
  LD [M]  /home/user/rtw88-usb/rtw88_usb.o
  MODPOST /home/user/rtw88-usb/Module.symvers
ERROR: modpost: "ieee80211_rx_irqsafe" [/home/user/rtw88-usb/rtw88_usb.ko] undefined!
ERROR: modpost: "ieee80211_alloc_hw_nm" [/home/user/rtw88-usb/rtw88_usb.ko] undefined!
ERROR: modpost: "ieee80211_tx_status_irqsafe" [/home/user/rtw88-usb/rtw88_usb.ko] undefined!
ERROR: modpost: "ieee80211_free_hw" [/home/user/rtw88-usb/rtw88_usb.ko] undefined!
ERROR: modpost: "pci_free_irq_vectors" [/home/user/rtw88-usb/rtw88_pci.ko] undefined!
ERROR: modpost: "ieee80211_stop_queue" [/home/user/rtw88-usb/rtw88_pci.ko] undefined!
ERROR: modpost: "pci_iounmap" [/home/user/rtw88-usb/rtw88_pci.ko] undefined!
ERROR: modpost: "ieee80211_alloc_hw_nm" [/home/user/rtw88-usb/rtw88_pci.ko] undefined!
ERROR: modpost: "pci_clear_master" [/home/user/rtw88-usb/rtw88_pci.ko] undefined!
ERROR: modpost: "ieee80211_free_hw" [/home/user/rtw88-usb/rtw88_pci.ko] undefined!
ERROR: modpost: "rtw8821c_hw_spec" [/home/user/rtw88-usb/rtw88_8821cu.ko] undefined!
ERROR: modpost: "ieee80211_queue_work" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_beacon_get_tim" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_unregister_hw" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_iterate_active_interfaces_atomic" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_tx_dequeue" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_free_txskb" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_iter_keys_rcu" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_find_sta_by_ifaddr" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_proberesp_get" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_queue_delayed_work" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "wiphy_to_ieee80211_hw" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_stop_tx_ba_cb_irqsafe" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_tx_status_irqsafe" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_iter_keys" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_find_sta" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_restart_hw" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_register_hw" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_pspoll_get" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_nullfunc_get" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_start_tx_ba_session" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_iterate_stations_atomic" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_probereq_get" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
ERROR: modpost: "ieee80211_txq_get_depth" [/home/user/rtw88-usb/rtw88_core.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:124: /home/user/rtw88-usb/Module.symvers] Error 1
make[2]: *** Deleting file '/home/user/rtw88-usb/Module.symvers'
make[1]: *** [Makefile:1725: modules] Error 2
make[1]: Leaving directory '/home/user/aw/linux-5.10.42'
make: *** [Makefile:114: all] Error 2