If I switch to more recent kernel (4.16) and build Openwrt, backports package breaks (obviously). Creating a new backports package and then porting 200+ patches is a huge challenge.
How can I disable OpenWrt backported wireless drivers? Are these needed when I'm using more recent mainline kernel?
You can't, at least not reasonably, as the required wlan packages are only packaged from backports and not (alternatively) from the base kernel. You'd have to replicate this packaging for the kernel - and introduce corresponding dependencies/ conflicts. This is possible, but would duplicate a massive amount of packaging code - which is also a constantly moving target, having to do this for two similar but indepently moving code bases would be a maintenance nightmare.
However I feel backported drivers should have been an alternative to base drivers. Rather having no alternative at all.
@hnyman
No doubt and I agree 100%. Someone (Smartsmurf) already did this for gemini based NAS: https://github.com/Smartsmurf/openwrt-ib4220/. I have managed to port bcm53xx specific changes both configs and patches. Although, I haven't been able to test it because I've hit a dead end with backports.
Just want to say, I have huge appreciation for work you both do here. Thank you!
Note: The this probably will require more work in order to be usable.
But if you looking for leads I guess you can start from there and make
your own version/customization. At least, I know it did work back then.
Did anyone try to compiling the wireless drivers and mac80211 with the kernel?
For example for a ath9k card trying to start wpad_supplicant will result in:
root@OpenWrt:~# wpa_supplicant -iwlan0 -c wpa.conf
Successfully initialized wpa_supplicant
Could not set interface wlan0 flags (UP): I/O error
nl80211: Could not set interface 'wlan0' UP
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface
wlan0: CTRL-EVENT-DSCP-POLICY clear_all
For an mt7615 card it is even worse and I can not even bringup the card:
root@OpenWrt:~# ip l set wlan0 up
ip: SIOCSIFFLAGS: I/O error
Actually, I just did. I wanted to have "latest" kernel (which is 6.1.1 at the time of writing) and I added the CFG80211 plus MAC80211 into the kernel, as well as the MT7603 and MT76x2 (for the MT7612) drivers from "mainline kernel". For those I needed to add the firmware.bin files (see my other post: add firmware to kernel
I did add the patches from the MAC80211/Backport marked as v6.2 (not sure I needed them, but I added them anyways).. And I had to patch the Makefile for hostapd/wpad-basic-wolfssl to get it to work. Mainly since CFG80211 was in kernel, the kmod-cfd80211 wasn't "yes" so I missed some dependencies.
Additionally I had to add the files that the backport MAC80211 was adding (scripts) for OpenWrt so everything was added to UCI and hospapd would get the proper config automatically.
Bottomline: it works just fine. It probably would work "just fine" for the kernel 5.10 or 5.15 if you can do without the patches after that.