Open warnes opened 2 years ago
Exactly what I've been looking for! Excellent. Just compiled on 2.04 w/ 5.13 kernel. This will allow me to do some upgrades I've been wanting to do.
I may have missed this, but after looking closer I notice with the 5.13.0.35 Kernel I'm getting the following result when running make. This is on 20.04 w/ HWE kernel.
dragon@dragon:~/bladeRF-mac80211_hwsim$ make
make -C /lib/modules/5.13.0-35-generic/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-35-generic'
CC [M] /home/dragon/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.o
MODPOST /home/dragon/bladeRF-mac80211_hwsim/Module.symvers
CC [M] /home/dragon/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.mod.o
LD [M] /home/dragon/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.ko
BTF [M] /home/dragon/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.ko
Skipping BTF generation for /home/dragon/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-35-generic'
If I try to insmod the .ko file I end up with this,
insmod: ERROR: could not insert module bladeRF_mac80211_hwsim.ko: Unknown symbol in module
Doing some searching to see how to get around the initial issue.
The following occurs while trying to build against the kernel mentioned on a Pi4
sudo make -C /lib/modules/5.15.43-v8+/build M=$PWD make: Entering directory '/usr/src/linux-headers-5.15.43-v8+' CC [M] /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.o /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c: In function ‘hwsim_new_radio_nl’: /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:3539:23: error: ‘CFG80211_MAX_NUM_DIFFERENT_CHANNELS’ undeclared (first use in this function) 3539 | if (param.channels > CFG80211_MAX_NUM_DIFFERENT_CHANNELS) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:3539:23: note: each undeclared identifier is reported only once for each function it appears in /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c: In function ‘init_mac80211_hwsim’: /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:4009:21: warning: this statement may fall through [-Wimplicit-fallthrough=] 4009 | param.reg_strict = true; | ~~~~~~~~~~~~~~~~~^~~~~~ /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:4011:3: note: here 4011 | case HWSIM_REGTEST_DRIVER_REG_ALL: | ^~~~ make[1]: *** [scripts/Makefile.build:288: /home/ubuntu/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.o] Error 1 make: *** [Makefile:1868: /home/ubuntu/bladeRF-mac80211_hwsim] Error 2 make: Leaving directory '/usr/src/linux-headers-5.15.43-v8+'
A quick search turned this up, but to be honest maybe it's just this custom kernel/config I'm trying. Commenting out the few lines starting at 3539 allow it to compile.
On Lubuntu 22.04 w/ kernel 5.15.0-52-generic I get the following while trying to compile
/usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c: In function ‘hwsim_new_radio_nl’:
/usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:3539:30: error: ‘CFG80211_MAX_NUM_DIFFERENT_CHANNELS’ undeclared (first use in this function)
3539 | if (param.channels > CFG80211_MAX_NUM_DIFFERENT_CHANNELS) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:3539:30: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c: In function ‘init_mac80211_hwsim’:
/usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:4009:42: warning: this statement may fall through [-Wimplicit-fallthrough=]
4009 | param.reg_strict = true;
| ~~~~~~~~~~~~~~~~~^~~~~~
/usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.c:4011:17: note: here
4011 | case HWSIM_REGTEST_DRIVER_REG_ALL:
| ^~~~
make[2]: *** [scripts/Makefile.build:297: /usr/src/wiphy-build/bladeRF-mac80211_hwsim/bladeRF_mac80211_hwsim.o] Error 1
make[1]: *** [Makefile:1900: /usr/src/wiphy-build/bladeRF-mac80211_hwsim] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-52-generic'
make: *** [Makefile:26: default] Error 2
Commented out the lines starting at 3539, compiles afterwards.
The following steps while using your PR works for me.