Hi,
I was trying to cross compile the morse_driver with the OpenWrt kernel and toolchain. I first cloned the openwrt repo from github and checked out the mm/v23.05.3 branch. I was able to build the openwrt image, and I could see the kernel files and toolchain files created. I then cloned the morse_driver repo and tried to build it using the following commands:
cd morse_driver
export ARCH=mips
export CROSS_COMPILE=$HOME/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/bin/mipsel-openwrt-linux-musl-
export KERNEL_SRC=$HOME/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-5.15.150
make MORSE_TRACE_PATH=$(pwd) \
CONFIG_WLAN_VENDOR_MORSE=m \
CONFIG_MORSE_SDIO=y \
CONFIG_MORSE_USER_ACCESS=y
The problem was, I got the following error messages toward the end of the build:
mipsel-openwrt-linux-musl-gcc: warning: environment variable 'STAGING_DIR' not defined
LD [M] /home/uu/morse_driver/morse.o
MODPOST /home/uu/morse_driver/Module.symvers
ERROR: modpost: "ieee80211_channel_to_freq_khz" [/home/uu/morse_driver/dot11ah/dot11ah.ko] undefined!
ERROR: modpost: "ieee80211_freq_khz_to_channel" [/home/uu/morse_driver/dot11ah/dot11ah.ko] undefined!
ERROR: modpost: "ieee80211_operating_class_to_band" [/home/uu/morse_driver/dot11ah/dot11ah.ko] undefined!
ERROR: modpost: "cfg80211_find_elem_match" [/home/uu/morse_driver/dot11ah/dot11ah.ko] undefined!
ERROR: modpost: "ieee80211_chandef_to_operating_class" [/home/uu/morse_driver/dot11ah/dot11ah.ko] undefined!
ERROR: modpost: "ieee80211_rx_irqsafe" [/home/uu/morse_driver/morse.ko] undefined!
ERROR: modpost: "ieee80211_csa_finish" [/home/uu/morse_driver/morse.ko] undefined!
ERROR: modpost: "regulatory_set_wiphy_regd" [/home/uu/morse_driver/morse.ko] undefined!
ERROR: modpost: "ieee80211_return_txq" [/home/uu/morse_driver/morse.ko] undefined!
ERROR: modpost: "ieee80211_hdrlen" [/home/uu/morse_driver/morse.ko] undefined!
WARNING: modpost: suppressed 47 unresolved symbol warnings because there were too many)
make[2]: *** [scripts/Makefile.modpost:133: /home/uu/morse_driver/Module.symvers] Error 1
make[2]: *** Deleting file '/home/uu/morse_driver/Module.symvers'
make[1]: *** [Makefile:1827: modules] Error 2
make[1]: Leaving directory '/home/uu/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-5.15.150'
make: *** [Makefile:151: all] Error 2
I am wondering if there is anything I did wrong?