Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve build & installation + support kernels 5.13+ #5

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

warnes
Copy link

@warnes warnes commented Feb 22, 2022

  • Use standard kernel module build & install tools, including module signing.
  • Add modprobe configuration script
  • Rename module 'bladeRF-mac80211-hwsim' to distinguish it from the standard 'mac80211-hwsim' module.
  • Includes PR Fix compilation on 5.13+ kernels #1

foxtrot and others added 8 commits October 4, 2021 14:48
Starting with 5.13, the AMPDU alignment macros have been renamed.
(torvalds/linux@1f851b8)

This commit also fixes a typo that was corrected in 5.13 with the AMSDU related macros.
(torvalds/linux@2f51644)
Starting with kernels 5.14 and up, the
CFG80211_MAX_NUM_DIFFERENT_CHANNELS symbol has been removed upstream.
(torvalds/linux@21b7805).
@alphafox02
Copy link

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.

@alphafox02
Copy link

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.

@alphafox02
Copy link

alphafox02 commented May 30, 2022

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.

https://patches.linaro.org/project/linux-wireless/patch/20210506221159.d1d61db1d31c.Iac4da68d54b9f1fdc18a03586bbe06aeb9515425@changeid/

@alphafox02
Copy link

alphafox02 commented Nov 5, 2022

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.

@alphafox02
Copy link

The following steps while using your PR works for me.

#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants