hi3519v101: drop the Wi-Fi driver with no firmware, and build mac80211's crypto in - #2404
Conversation
…1's crypto in hi3519v101_lite has been failing its 5120KB squashfs cap on master since 2026-09-12 (5128KB in CI, 5124KB here), with nothing in the tree to blame - majestic and majestic-webui are unpinned moving refs and grew under it, the same shape as #2397 and #2399 one nightly earlier. rtl8192cu wants rtlwifi/rtl8192cufw*.bin. No package in this tree installs that file on any board, and the only firmware this board ships is mediatek/mt7601u.bin, so /lib/firmware/rtlwifi does not exist and the driver could never finish probing. It was costing 274KB of .ko across rtl8192cu, rtlwifi, rtl8192c-common and rtl_usb, inflated further by RTLWIFI_DEBUG=y. ccm/ctr/seqiv/arc4 are the algorithms mac80211 selects, so they are resident whenever a dongle is; building them in moves another 29KB out of the rootfs into the uImage, which has 238KB of headroom. R8188EU stays. It cannot load its firmware either, but it is the only symbol selecting WIRELESS_EXT on this board, and dropping it takes the wext ioctl ABI that iwconfig, wpa_supplicant's wext driver and every out-of-tree Realtek driver need with it. mac80211 and cfg80211 stay modular for the same reason. rootfs.squashfs 5124KB -> 5028KB (92KB under the cap), uImage 1805 -> 1809KB.
PR Summary by QodoTrim hi3519v101 rootfs and build mac80211 crypto into kernel
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Camera operation remains unverified
|
The 2026-09-18 master matrix (run 35375141337, at 49908b5) failed on three boards, each at 5124KB against the 5120KB squashfs cap -- over by exactly 4KB. All three were reproduced locally from a clean worktree at that commit before anything here was changed, and the cause is the same fleet-wide drift in the unpinned majestic and majestic-webui refs that #2404, #2410, #2421, #2433, #2437 and #2440 have each answered on other boards. #2437 landed one day ago and left these two Goke boards 8KB of headroom while saying in as many words that the drift would take them again; it did. hi3516cv200 shipped two Realtek drivers waiting on firmware the image does not carry. rtl8192cu asks for rtlwifi/rtl8192cufw*.bin, and rtl8xxxu -- with RTL8XXXU_UNTESTED off, so RTL8723AU only -- asks for rtlwifi/rtl8723aufw*.bin. The only Wi-Fi blobs this board installs are mediatek/mt7601u.bin and rtlwifi/rtl8188eufw.bin, so neither could finish probing, and nothing loads them either: /etc/wireless/usb, dispatched by S40network from the wlandev U-Boot variable, is the one entry point and names mt7601u and 8188eu. That was 350KB of .ko (rtl8xxxu 104KB, rtl8192cu 90KB, rtlwifi 85KB, rtl8192c-common 54KB, rtl_usb 15KB), and RTLWIFI_DEBUG=y is why rtlwifi.ko was as large as it was. Same argument as #2404 made for hi3519v101. R8188EU stays, and the line is drawn where the firmware is: rtl8188eufw.bin is what drivers/staging/rtl8188eu/hal/fw.c requests by name, and R8188EU is the only symbol on this board selecting WIRELESS_EXT and WEXT_PRIV, which the out-of-tree drivers a camera may add still need. This is #2410 in reverse -- there the same driver went, because that board had no wext consumer left. gk7205v200 and gk7605v100 are out of free levers: #2376 took their SCSI stack, #2421 stripped the modules they cannot load, #2437 built their crypto helpers in, and every module left is named by a script or dependency-loaded by one that is. So they take the cheaper half of the one lever #2420 found remaining, the same half #2440 gave gk7205v300. Only cfg80211 moves; mac80211 and mt7601u stay modules, because moving those too would trade "one commit from red on rootfs" for the same on uImage. The cost is worth stating: cfg80211 is now permanently resident, so every camera pays for the wireless core whether a dongle is ever plugged in or not. The load path survives being built in -- modules.builtin now lists kernel/net/wireless/cfg80211.ko, which busybox modprobe consults, and mac80211.ko's modules.dep line no longer names it. Measured locally, clean builds of both the before and the after -- an incremental rebuild keeps the old .ko in target/ and reports a nonsensical saving, which is the trap #2437 documented: hi3516cv200_lite rootfs 5124 -> 5012KB uImage 1656 -> 1657KB gk7205v200_lite rootfs 5124 -> 5044KB uImage 1821 -> 1876KB gk7605v100_lite rootfs 5124 -> 5044KB uImage 1799 -> 1855KB None of the three prints a headroom warning any more.
What broke
hi3519v101_litefails the rootfs cap on master:Nothing in this repository grew to do it. The failing master nightly sits on
d87dae1, and #2401's build on the same base commit passed this board at
11:36 UTC and failed at 19:16 UTC with byte-identical numbers.
majesticandmajestic-webuiare unpinned moving refs —MAJESTIC_SITEhas no version inthe URL — so the growth lands with no pull request to point at. Exactly the
shape of #2397 and #2399 one nightly earlier.
This board has been living on the line for a while: the
CHECK_SIZEheadroomcomment in the
Makefileis written about it ("sat at exactly 5120KB of a5120KB cap for weeks"), and #2308/#2309/#2310 bought its last reprieve.
What changes
One file,
hi3519v101.generic.config, which backs exactly one defconfig(
hi3519v101_lite_defconfig—grep -rloverbr-ext-chip-*/configs).1. The in-kernel Realtek USB Wi-Fi stack is dropped.
rtl8192cuasks forrtlwifi/rtl8192cufw{,_A,_B,_TMSC}.bin. Nothing in this tree installs any ofthose on any board —
grep -rn 8192cufwover the repository returns nothing —and the only firmware this board ships is
mediatek/mt7601u.bin, becausehi3519v101_lite_defconfigselects..._MEDIATEK_MT7601Uand not..._RTL_8188EU. So/lib/firmware/rtlwifidoes not exist in the image andthe driver could never finish probing. In the built baseline rootfs it cost:
rtl8192cu.kortlwifi.kortl8192c-common.kortl_usb.koCONFIG_RTLWIFI_DEBUG=ywas set, which is whyrtlwifi.kowas that large.Same argument and same shape as #2376 and #2399. There is no
wlandevprofilefor this family in
general/overlay/etc/wireless/usbat all, so nothing in thetree modprobes any of these names.
2.
ccm,ctr,seqivandarc4are built in instead of shipping asmodules. These are the algorithms
mac80211selects, so they are residentwhenever a dongle is and idle code the rest of the time either way — this moves
29KB from the size-capped rootfs into the uImage, which has 238KB of headroom.
The #2397 trade, and the same reason FAT is built in on this board already.
After the build,
modules.builtincarriescrypto/{ccm,ctr,arc4,seqiv}.koandmodules.depformac80211.kolists onlycfg80211.ko.CONFIG_CRYPTO_{AEAD,BLKCIPHER,RNG}follow to=y; that is whatolddefconfigderives, not a hand edit.What deliberately does not change
CONFIG_R8188EUstays, even though the staging driver cannot load itsfirmware either (
rtlwifi/rtl8188eufw.bin, ships only whenBR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_RTL_8188EUis selected, which this boarddoes not do) and
/etc/wireless/usb'srtl8188eu-genericprofile modprobesthe out-of-tree
8188eu, notr8188eu. It is 461KB — by far the biggestsingle item — and dropping it would be wrong anyway:
WIRELESS_EXTis a prompt-less bool reachable only byselect, and on thisboard
R8188EUis the only thing selecting it.olddefconfigconfirms it:drop
R8188EUandCONFIG_WIRELESS_EXT,WEXT_CORE,WEXT_PROCandWEXT_PRIVall go with it, takingnet/wireless/wext-core.oand thenet_device.wireless_handlersfield out of the kernel. That is the ioctl ABIiwconfig(this board shipswireless-tools), wpa_supplicant'swextdriver(selected here via the MT7601U firmware option) and every out-of-tree Realtek
driver in
general/package/are built against.CONFIG_CFG80211_WEXT=yis nota substitute — it gives
WEXT_COREbut notCONFIG_WIRELESS_EXT. Bothhi3518ev200andhi3518ev300keepWIRELESS_EXTthe same accidental way,which is presumably why #2399 left
R8188EUalone there too.mac80211andcfg80211stay modular for the same reason: they are what anout-of-tree driver added downstream would sit on.
Evidence
Full clean builds of
hi3519v101_lite, before and after, same tree, same hour:(Local baseline reads 5124KB against CI's 5128KB; both overflow, and the delta
is what matters.) CI on this branch, run 34718966712, agrees:
— 84KB under the cap, no headroom warning, and
hi3516av200_{lite,neo,ultimate}(the rest of the matrix this file selects) pass unchanged.
make BOARD=hi3519v101_lite size-reportafter:Module count 63 → 59. In the built tree
kernel/drivers/net/wireless/andkernel/crypto/are gone from/lib/modules, whiler8188eu.ko(461,524),mac80211.ko(322,708),cfg80211.ko(214,592),wireguard.koand the 30hisilicon/vendor modulesare all still there.
CONFIG_WIRELESS_EXT=y,WEXT_CORE=y,WEXT_PROC=yandWEXT_PRIV=ysurvive in the built.config.The committed file derives exactly the
.configthat was built — copying itover
build/linux-custom/.configand runningolddefconfigproduces abyte-identical file, so nothing was re-enabled behind the change.
Checks run:
Not tested on hardware
There is no hi3519v101 unit on the bench, so this is measured from builds only.
Both moves are the ones #2376, #2397 and #2399 already made on Goke,
hi3518ev300 and hi3518ev200, and the reasoning for each dropped symbol is
stated above so it can be checked rather than taken on trust. Worth exercising
on a real camera before this is trusted:
ccm/arc4register, not whether;
in-kernel
rtl8192cu(which would mean they are supplying/lib/firmware/rtlwifi/from outside this tree), say so and I will keepCONFIG_RTL_CARDS.Follow-up, not in this PR
Twenty other board configs still carry
CONFIG_RTL_CARDS=mwith the samemissing firmware, including
hi3516av200.generic.confignext door. That is afleet-wide sweep that would widen the CI matrix to most of the tree, so it is
better done deliberately than smuggled into a red-master fix.