Compile and load own mac80211

Since mac80211 is a kernel module, I should be able to compile my own version and load it into my kernel.
E.g. I want to checkout this mac80211:
https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git/

There is no INSTALL.md and the README explains, how you can compile the whole linux kernel. Can somebody give me a quick howto?

I do not want to run that on an OpenWrt. First I want to deploy that on my own system.

General Linux question then. Look into resources around building for your target OS. Typically you will need to build and install a complete kernel and all modules. Some OSes will allow you to build a single module using the matching kernel headers, which often are not installed by default.

That you are building from “next” makes things much more complicated. "Production" OSes generally use an older kernel and kernel interfaces may have changed relative to the merge base of the changes. Changing the kernel version may require rebuilding of "all" applications (at least all that use kernel APIs/ABIs).

2 Likes

But how do mac80211 developers handle that?

You don't. It's in Linus' hands.

You wait for it to be accepted to mainline Linux (if it ever is), then for your OS to change its kernel version to one at or beyond the point that it was committed.

But they have to test their stuff and develop? So each time they compile a new kernel? :confused:

Just like OpenWrt, once you get the environment and source trees set up, it's the equivalent of the familiar make -j12 clean download world (Edit: though during development, since they're likely on the same, upstream Linux version, they probably don't clean each time.)

1 Like

Just to (hopefully) clear up the question(s) a bit. Johannes is the subsystem maintainer for mac80211, so whatever is in his for-next branch will end up in the next upstream kernel (so v5.5 at this point, as v5.4 is currently for-linus) via davem's net(-next) tree. While it's possible that Linus und Dave might object against individual issues or that some patches will reveal themselves to be buggy over time, a subsystem maintainer is generally not micro-managed and trusted to do the right thing.

If you're on a platform that doesn't require out-of-tree patches (so anything x86/ x86_64, some of the well supported ARM SBCs; sadly basically none of the routers supported by OpenWrt fall into this category), it's very simple to follow upstream development of the linux kernel. While make is an archaic buildsystem, it's pretty smart in only recompiling modified parts of a larger project, which makes continuous development easy and quick. Out-of-tree patches or modules (graphics drivers, etc. - or worse, the target specific patch stacks necessary to support many OpenWrt devices) however would be a nightmare in such a situation.

Edit: Depending on what feature exactly you're looking for, it might be easier -for-you- to backport it to a stable kernel (and maintain it as a small personal patch/ patch series) for the time being (on top of v5.3 or v5.4~). Be aware that Johannes only tends to the mac80211 subsystem, the wireless stack itself. Wireless driver development is fed to davem individually by kvalo, so if you're looking for new device support, that would be your point of contact. Given that both Johannes and Kalle are regularly (every ~week) merging into davem's net(-next) tree, it might make sense to follow that tree instead of the subtrees.

2 Likes