Skip to content

xm530: bring up the AltoBeam ATBM6032 USB WiFi chip - #2316

Open
yatotoshka wants to merge 1 commit into
OpenIPC:masterfrom
yatotoshka:xiongmai-atbm60xx-wifi
Open

yatotoshka wants to merge 1 commit into
OpenIPC:masterfrom
yatotoshka:xiongmai-atbm60xx-wifi

Conversation

@yatotoshka

@yatotoshka yatotoshka commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Some XM530 boards (e.g. IPC-RB-BLK530AI-0235P-AB0 V1.03) carry an AltoBeam
ATBM6032 USB WiFi (007a:8888) with a power-down gpio. The stock xm530 image has
neither the driver nor a /etc/wireless/usb case for it, so WiFi is not usable
on these boards.

What this change does

  • Adds the atbm603x-xm530 case to general/overlay/etc/wireless/usb (the
    same table and shape as the existing atbm603x-t31-zte-k540 case):
    modprobe dwc_otg, then modprobe wifi_pdn value="$pdn" where the PDN
    gpio is read from the per-board wifipdn env (set e.g. by a builder
    profile's customizer), then modprobe atbm603x_wifi_usb; S40network
    then applies the MAC and runs ifup wlan0 exactly as for every other
    wlandev.
  • Re-runs depmod in xiongmai-osdrv-xm530's target-finalize: the vendor
    kernel ships a modules.dep that lists only its own modules, leaving
    dwc_otg, wifi_pdn and the atbm module invisible to modprobe (same
    pattern as hisilicon-opensdk).
  • Installs the vendor cfg80211 rewrite as cfg80211_xm711.ko instead of
    over the in-tree cfg80211 (CONFIG_CFG80211=m) at the canonical module
    path, and loads it from there in the wifi xm711 helper. atbm60xx — and
    the kernel-built mac80211 — build against the in-tree module, so both
    WiFi stacks stay usable in one image.
  • Pins ATBM60XX_VERSION to a full 40-character SHA instead of moving
    HEAD.
  • Does not touch xm530_lite_defconfig: enabling atbm60xx is the
    device profile's business (companion profile in
    OpenIPC/builder#130,
    xm530_lite_anbiux-a8b-3mp), so stock xm530 images are unchanged.

Status (2026-09-30)

  • Rebased onto current master (e484a42d); single commit.
  • Narrowed per the maintainer's guidance: the shared xm530_lite_defconfig
    is untouched — selecting atbm60xx moved to the builder device profile
    (Added support for bridge and vlan initialization to /etc/network/interfaces #130); the bring-up case moved from a package post-build hook into the
    shared wireless/usb table, next to the existing atbm cases, with the
    PDN gpio read from the wifipdn env rather than hardcoded.
  • CI is blocked on maintainer approval: the workflow runs are in
    "awaiting approval from a maintainer" state, so no compile/size
    verification has run yet in OpenIPC CI.
  • Clean-build path still unverified on-device (see Evidence); planned via
    builder#130's build-one with firmware_repo=yatotoshka/firmware,
    firmware_ref=xiongmai-atbm60xx-wifi once CI is unblocked.

Hardware tested on

XM530AI (marking 30WX1), board IPC-RB-BLK530AI-0235P-AB0 V1.03, SmartSens
SC3335, AltoBeam ATBM6032 USB WiFi (007a:8888), PDN on gpio 96

Evidence

The chip, the PDN gpio and the exact load order used by the new case
(dwc_otg → wifi_pdn → atbm603x) are proven on this hardware — the camera is
currently associated:

Before (stock image, no driver for the chip at all):

# dmesg — no atbm driver registered, wlan0 never appears
ls /sys/class/net/
eth0  lo

After (radio driven, wlan0 up):

wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether f4:b1:9c:a8:ca:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.243/24 brd 192.168.1.255 scope global wlan0
[atbm_log]:wlan0: authenticated
[atbm_log]:wlan0: associated
default via 192.168.1.1 dev wlan0

The Web UI is reachable both over the wlan0 address (192.168.1.243) and the
Ethernet address (192.168.1.242).

Honest status: the running camera currently loads the driver from a prebuilt
blob (built from the same atbm_60xx revision this PR pins) plus a local init
script, not from the clean-build path of this patch (compiled atbm60xx +
wlandev + S40network + the wireless/usb case). That path is still
unverified on-device; CI confirms atbm60xx compiles against the xm530 kernel,
and the size report says whether the 5M rootfs still fits (the image now also
carries the #2315 SD module). To close the gap: build an image from this branch
— possible today via builder#130's build-one with firmware_repo pointed at
this fork and firmware_ref=xiongmai-atbm60xx-wifi, or right after this PR is
merged — flash it and verify.

Notes: stock xm530 images are unchanged by this PR — the case in
/etc/wireless/usb only runs when wlandev is set to atbm603x-xm530, and
the cfg80211 rename leaves every xm530 image carrying the vendor rewrite as
cfg80211_xm711.ko alongside the in-tree cfg80211 (previously it
overwrote it), with the wifi xm711 helper loading the renamed copy, so
xm711/lynx boards keep working at the cost of one extra module file. The
only xm530 profile proposed in OpenIPC/builder today ([builder#130]) is the
ATBM board; no xm711-equipped xm530 is registered or known to be deployed.
The rename, the depmod pass and the SHA pin each stand alone and can be
split out if reviewers prefer.

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • The driver itself is selected by device profiles (builder#130) and by t31_ultimate, so CI compiles atbm60xx; the xm530-kernel compile + 5M rootfs size are covered by the builder device build

Note on the overlay checkbox: the new wireless/usb case is purely additive
and matches the file's established per-board pattern (driver, SoC, board
bring-up — like the ~40 existing cases); it changes no existing board's
behaviour and only runs when wlandev is set to atbm603x-xm530. The PDN
gpio is read from the per-board wifipdn env at run time — set by the builder
profile's customizer or the user, not hardcoded in the shared script.

@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch 2 times, most recently from 2048269 to e0af350 Compare August 26, 2026 13:50
@yatotoshka
yatotoshka marked this pull request as ready for review August 26, 2026 14:03
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Bring up ATBM6032 USB WiFi on XM530 boards

✨ Enhancement 🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Add XM530 USB WiFi bring-up using a per-board power-down GPIO.
• Rebuild module dependencies so the new driver stack is discoverable by modprobe.
• Preserve both WiFi stacks by separating vendor cfg80211 and pinning the ATBM driver revision.
Diagram

graph TD
  ENV["Board environment"] --> NET["S40network"] --> USB["USB dispatch"] --> RADIO["USB and PDN"] --> ATBM["ATBM driver"] --> CFG["In-tree cfg80211"]
  FINAL["XM530 finalize"] --> INDEX["Module index"] --> RADIO
  INDEX --> VENDOR["XM711 vendor cfg"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Package vendor cfg80211 only in XM711-specific images
  • ➕ Avoids carrying the additional vendor module in ATBM-only images.
  • ➖ Requires profile-specific packaging and prevents one image from supporting both WiFi stacks.

Recommendation: Keep the shared, separately named vendor module for now: it preserves the canonical cfg80211 path needed by ATBM without changing XM711's intended loading path. Profile-specific packaging is worth considering only if rootfs size becomes a constraint. Clean-build and XM711 regression testing remain important before merge.

Files changed (4) +28 / -4

Enhancement (1) +10 / -0
usbAdd the XM530 ATBM6032 USB bring-up case +10/-0

Add the XM530 ATBM6032 USB bring-up case

• Adds an opt-in wlandev case that loads DWC OTG, applies the PDN GPIO from the per-board wifipdn environment value when present, and loads the ATBM603x USB driver.

general/overlay/etc/wireless/usb

Bug fix (2) +17 / -3
wifiLoad the separately named XM711 cfg80211 module +1/-1

Load the separately named XM711 cfg80211 module

• Changes the XM711 helper to modprobe cfg80211_xm711 rather than loading the vendor rewrite from the canonical cfg80211 path.

general/package/xiongmai-osdrv-xm530/files/script/wifi

xiongmai-osdrv-xm530.mkSeparate vendor cfg80211 and refresh module dependencies +16/-2

Separate vendor cfg80211 and refresh module dependencies

• Installs the XM711 vendor rewrite as cfg80211_xm711.ko without replacing the in-tree module. Adds a target-finalize depmod pass so modprobe can discover the installed XM530 and ATBM modules.

general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk

Other (1) +1 / -1
atbm60xx.mkPin the ATBM driver source revision +1/-1

Pin the ATBM driver source revision

• Replaces the moving HEAD version with a full commit SHA for reproducible driver builds.

general/package/atbm60xx/atbm60xx.mk

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. The board profile cannot start WiFi 🐞 Bug ≡ Correctness
Description
/etc/wireless/usb matches atbm603x-xm530, but the PR says the companion profile sets
wlandev=atbm603x-xm530-usb. With that documented value, S40network finds no matching wireless
case and never runs ifup wlan0.
Code

general/overlay/etc/wireless/usb[329]

+if [ "$1" = "atbm603x-xm530" ]; then
Evidence
The new case accepts only atbm603x-xm530, while the PR description specifies atbm603x-xm530-usb
for both the companion profile and manual setup. S40network passes wlandev to this script and
calls ifup wlan0 only when a wireless script succeeds.

general/overlay/etc/wireless/usb[329-335]
general/overlay/etc/init.d/S40network[2-11]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new case does not match the `wlandev` value documented for the companion board profile, so boot does not bring up WiFi.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[327-335]
- general/overlay/etc/init.d/S40network[2-11]
## Recommended Fix
Use `atbm603x-xm530-usb` as the case selector, matching the documented profile and manual setup instructions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. A hook comment merely narrates code ⊘ Outdated
Description
post-build-hook.sh labels the duplicate guard with `Idempotent: skip if the case is already
present, merely paraphrasing the immediately following grep` command. The nearby board-scope and
placement comments already preserve the non-obvious rationale, so this label adds no maintenance
context and can become stale if the guard changes.
Code

general/package/atbm60xx/post-build-hook.sh[28]

+# Idempotent: skip if the case is already present.
Evidence
Compliance rule 40 requires new comments to explain rationale rather than narrate adjacent
operations. The cited comment says the case is skipped when already present, while the next line
directly implements that same operation with grep and exit.

CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations: CLAUDE.md: Code Comments Must Explain Rationale Rather Than Restate Operations
general/package/atbm60xx/post-build-hook.sh[28-29]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The comment above the duplicate guard only restates what the following command does rather than explaining a non-obvious rationale.
## Fix Focus Areas
- general/package/atbm60xx/post-build-hook.sh[28-29]
## Recommended Fix
Remove the narrating comment, leaving the self-explanatory guard in place. Preserve the earlier comments that explain why the hook is conditional and why insertion occurs before the final exit.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Other cameras ship unusable WiFi logic ✓ Resolved
Description
general/overlay/etc/wireless/usb installs the new atbm603x-xm530-usb branch unconditionally
instead of keying it to BR2_PACKAGE_ATBM60XX through a late overlay or hook. On an image where
that optional package is disabled, selecting this shipped branch still reaches the dwc_otg,
wifi_pdn, and atbm603x_wifi_usb loads even though the driver is not part of that build.
Code

general/overlay/etc/wireless/usb[R329-332]

+if [ "$1" = "atbm603x-xm530-usb" ]; then
+	modprobe dwc_otg
+	pdn=$(fw_printenv -n wifipdn)
+	[ -n "$pdn" ] && modprobe wifi_pdn value="$pdn"
Evidence
Compliance rule 27 requires files and actions associated with optional packages to be included
conditionally through the late-overlay or late-hook mechanisms. The added ATBM6032 actions reside in
the shared overlay, while ATBM60XX remains an optional Kconfig package and no corresponding
conditional entry exists in the late-overlay list.

CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files: CLAUDE.md: Use Conditional Late Overlays and Hooks for Package-Specific Files
general/overlay/etc/wireless/usb[327-335]
general/package/atbm60xx/Config.in[1-7]
general/scripts/late-overlays.list[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The ATBM6032-specific branch is shipped through the unconditional shared overlay, including in images that do not enable the ATBM60XX package.
## Issue Context
Relocate or generate this branch through a configuration-keyed late overlay or post-build hook so it is present only in applicable XM530 builds with ATBM60XX enabled.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[327-335]
- general/scripts/late-post-build-hooks.list[1-4]
- general/package/atbm60xx/atbm60xx.mk[10-13]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View action required (7)
4. Camera WiFi can miss dependencies ✓ Resolved
Description
The modified wifi helper invokes insmod for cfg80211_xm711.ko instead of the tree's
dependency-aware modprobe convention. When the xm711 branch runs, dependencies are not resolved
from the regenerated module metadata, so an unmet prerequisite prevents that WiFi stack from
loading.
Code

general/package/xiongmai-osdrv-xm530/files/script/wifi[10]

+    insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko     # vendor rewrite, kept off the in-tree cfg80211 path
Evidence
The changed shipped-script line directly invokes insmod. Compliance rules 10 and 51 require
shipped scripts to use dependency-aware modprobe where this tree follows that convention.

Rule 10: Shipped scripts follow tree conventions
general/package/xiongmai-osdrv-xm530/files/script/wifi[10-10]
Best Practice: Repository guidelines

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The modified shipped WiFi helper loads `cfg80211_xm711.ko` directly with `insmod`, bypassing dependency-aware module loading.
## Issue Context
The package now regenerates module dependency metadata, so the renamed module should be loaded by module name through `modprobe`.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530/files/script/wifi[10-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. atbm60xx path remains untested ⊘ Outdated
Description
The PR enables the clean-built atbm60xx path globally, but the description explicitly says the
demonstrated camera used a prebuilt blob and local init script and that an image built from this
patch has not yet been flashed. The supplied before/after output therefore does not verify the
behavior-changing path introduced here, contrary to the hardware-evidence requirement.
Code

br-ext-chip-xiongmai/configs/xm530_lite_defconfig[R70-72]

+BR2_PACKAGE_ATBM60XX=y
+BR2_PACKAGE_ATBM60XX_MODEL_603X=y
+BR2_PACKAGE_ATBM60XX_INTERFACE_USB=y
Evidence
Compliance ID 1 treats an explicit statement that the change was not tested on hardware as a
failure. The cited defconfig lines activate the driver path for xm530_lite images, while the PR
description states that this exact compiled-driver and wlandev path has not yet been flashed and
verified.

Rule 1: Hardware evidence is present and honest
br-ext-chip-xiongmai/configs/xm530_lite_defconfig[70-72]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly enabled `atbm60xx` clean-build and startup path lacks hardware verification from an image produced by this PR.
## Issue Context
The existing evidence comes from a prebuilt driver blob and local init script, while Compliance ID 1 requires board output proving the behavior-changing implementation under review.
## Fix Focus Areas
- br-ext-chip-xiongmai/configs/xm530_lite_defconfig[70-72]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. PDN module is missing 🐞 Bug ≡ Correctness
Description
The new ATBM6032 path runs modprobe wifi_pdn when wifipdn is configured, but the XM530 package
installs no wifi_pdn.ko, so the required PDN GPIO is never asserted and the USB radio may not
enumerate. The script ignores the failed modprobe and continues, leaving boot to report success from
this case even though wlan0 cannot appear on the tested hardware path.
Code

general/overlay/etc/wireless/usb[332]

+	[ -n "$pdn" ] && modprobe wifi_pdn value="$pdn"
Evidence
The changed case conditionally requires wifi_pdn before loading ATBM. The XM530 installation
commands only copy module globs from files/kmod, files/kmod/usb, and files/kmod/xm711, while
the repository's USB module directory contains only dwc_common_port_lib.ko and dwc_otg.ko; the
existing XM711 loader also references the same absent target path, corroborating that the package
does not currently supply this module.

general/overlay/etc/wireless/usb[329-334]
general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[19-22]
general/package/xiongmai-osdrv-xm530/files/script/wifi[7-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new ATBM6032 USB initialization invokes `wifi_pdn`, but no `wifi_pdn.ko` is installed into the XM530 image. Supply the required driver from rebuildable source and make initialization fail when the mandatory PDN setup fails.
## Issue Context
The XM530 package currently installs top-level, `usb`, and `xm711` module globs. The `usb` directory contains only `dwc_common_port_lib.ko` and `dwc_otg.ko`; do not solve this by importing an unrebuildable factory binary.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[331-333]
- general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[19-22]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. GPIO 96 enters shared overlay ✓ Resolved
Description
The new shared /etc/wireless/usb case hardcodes board-specific PDN GPIO 96. Because
general/overlay/ ships broadly, this board value violates the overlay blast-radius rules and
should be supplied through board-specific configuration instead.
Code

general/overlay/etc/wireless/usb[331]

+	insmod /lib/modules/3.10.103+/xiongmai/wifi_pdn.ko value=96 2>/dev/null
Evidence
Rules 5 and 13 explicitly prohibit adding a board-specific GPIO number under general/overlay/. The
added wifi_pdn.ko value=96 command introduces exactly such a value in the shared USB wireless
script.

Rule 5: No device-specific values in generic configuration
general/overlay/etc/wireless/usb[331-331]
Best Practice: Repository guidelines

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The shared wireless overlay hardcodes the board-specific PDN GPIO value `96`.
## Issue Context
Shared overlay files must remain board-agnostic; board-specific GPIO selection must come from per-board configuration or builder integration.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[331-331]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. USB stack uses insmod ✓ Resolved
Description
The new shipped script loads dwc_common_port_lib, dwc_otg, and wifi_pdn with direct-path
insmod calls even though repository policy requires dependency-aware modprobe. This bypasses the
standardized module-loading convention for on-device scripts.
Code

general/overlay/etc/wireless/usb[R329-331]

+	insmod /lib/modules/3.10.103+/xiongmai/dwc_common_port_lib.ko 2>/dev/null
+	insmod /lib/modules/3.10.103+/xiongmai/dwc_otg.ko 2>/dev/null
+	insmod /lib/modules/3.10.103+/xiongmai/wifi_pdn.ko value=96 2>/dev/null
Evidence
Rules 10 and 28 require shipped scripts to use modprobe where the tree follows that convention.
Lines 329-331 add three insmod calls, while the same case and surrounding wireless cases use
modprobe for WiFi modules.

Rule 10: Shipped scripts follow tree conventions
general/overlay/etc/wireless/usb[329-332]
Best Practice: Repository guidelines

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new on-device wireless case loads three kernel modules using direct-path `insmod` commands.
## Issue Context
Shipped scripts must use dependency-aware `modprobe` according to the repository's kernel-module loading convention.
## Fix Focus Areas
- general/overlay/etc/wireless/usb[329-331]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. XM711 WiFi path breaks ✓ Resolved
Description
Because xm530_lite now enables ATBM60XX globally, this condition stops replacing the in-tree
cfg80211.ko even though the same image still installs the xm711 driver and a helper that loads
that exact path as xm711's required vendor cfg80211. Any xm711-equipped XM530 using the shared lite
image will therefore load the incompatible in-tree module and lose WiFi after upgrade.
Code

general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[R27-29]

+	@if [ "$(BR2_PACKAGE_ATBM60XX)" != "y" ]; then \
+		$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless; \
+		$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/rewrite/cfg80211.ko; \
Evidence
The shared defconfig simultaneously selects the XM530 OS-driver package and ATBM60XX. The changed
package rule then withholds the vendor rewrite that its own comment says xm711 needs, while still
installing xm711 modules and the wifi helper; that helper explicitly insmods cfg80211 from the
rewritten path before xm711. The XM530 kernel config provides CONFIG_CFG80211=m, so after the skip
that path contains the in-tree implementation intended for ATBM rather than the vendor
implementation required by xm711.

br-ext-chip-xiongmai/configs/xm530_lite_defconfig[66-72]
general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[20-30]
general/package/xiongmai-osdrv-xm530/files/script/wifi[5-12]
br-ext-chip-xiongmai/board/xm530/xm530.generic.config[1054-1059]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Enabling ATBM60XX for the shared XM530 image prevents installation of the vendor cfg80211 required by the still-bundled xm711 WiFi stack, breaking that existing device path.
## Issue Context
The kernel already supplies its modular cfg80211 for ATBM, while `/usr/bin/wifi xm711` explicitly expects the vendor replacement at the same path. Keep both boot-time choices viable, or avoid enabling ATBM60XX in the shared defconfig and select it only for the applicable device profile.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[24-30]
- general/package/xiongmai-osdrv-xm530/files/script/wifi[5-12]
- br-ext-chip-xiongmai/configs/xm530_lite_defconfig[69-72]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Driver source tracks HEAD ✓ Resolved
Description
The new BR2_PACKAGE_ATBM60XX=y selection makes every xm530_lite build fetch openipc/atbm_60xx at
the package's moving HEAD revision. Identical firmware commits can therefore compile different,
unreviewed kernel-driver sources or stop building when that branch changes, so this addition is not
reproducible.
Code

br-ext-chip-xiongmai/configs/xm530_lite_defconfig[70]

+BR2_PACKAGE_ATBM60XX=y
Evidence
The added defconfig line activates ATBM60XX for xm530_lite, and the package definition constructs
its GitHub source URL using ATBM60XX_VERSION = HEAD; no stable source revision is recorded for the
driver now entering this image.

br-ext-chip-xiongmai/configs/xm530_lite_defconfig[69-72]
general/package/atbm60xx/atbm60xx.mk[7-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly selected ATBM60XX package uses a moving HEAD revision, making XM530 images non-reproducible and allowing later upstream changes to enter builds without a firmware review.
## Issue Context
The SITE is an OpenIPC repository, but `ATBM60XX_VERSION` must be a stable tag or full 40-character commit SHA before another shared board configuration depends on it.
## Fix Focus Areas
- br-ext-chip-xiongmai/configs/xm530_lite_defconfig[69-72]
- general/package/atbm60xx/atbm60xx.mk[7-8]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

11. Switching radios prevents XM711 WiFi 🐞 Bug ≡ Correctness
Description
The install rule renames the vendor cfg80211.ko file without changing its embedded module
identity, and wifi xm711 tries to load it as a second cfg80211 module. If the in-tree cfg80211
module was loaded for another radio first, the vendor module cannot load while it remains active, so
the subsequent XM711 load cannot work.
Code

general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[29]

+	$(INSTALL) -m 644 $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/rewrite/cfg80211.ko $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko
Evidence
The rule copies a prebuilt file named cfg80211.ko under a different filename; it does not rebuild
or rename the module internally. The kernel configuration also builds its own cfg80211 as a module,
and the changed XM711 helper attempts to load the renamed vendor copy before xm711.ko.

general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[24-29]
general/package/xiongmai-osdrv-xm530/files/script/wifi[5-12]
br-ext-chip-xiongmai/board/xm530/xm530.generic.config[584-597]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Renaming the vendor cfg80211 file does not make it loadable alongside the in-tree cfg80211 module.
## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[24-29]
- general/package/xiongmai-osdrv-xm530/files/script/wifi[5-12]
## Recommended Fix
Make the XM711 loading path ensure the in-tree wireless driver stack and cfg80211 are unloaded before loading the vendor module. If switching without a reboot is unsupported, enforce and document that limitation rather than treating the renamed file as an independent module.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 5/18, lines 32/200; both must reach the floor). Router rationale: This behavioral firmware change spans shared wireless startup, module packaging/dependency regeneration, and cfg80211 compatibility paths, with multiple independent high-blast-radius defects already indicated by pending findings.

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread general/overlay/etc/wireless/usb Outdated
Comment thread general/overlay/etc/wireless/usb Outdated
Comment thread general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk Outdated
Comment thread br-ext-chip-xiongmai/configs/xm530_lite_defconfig Outdated
@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from e0af350 to e46f92f Compare August 26, 2026 14:43
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Aug 26, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite. The customizer sets wlandev to the atbm603x-xm530-usb
case in firmware's /etc/wireless/usb (dwc + wifi_pdn value=96 +
modprobe, after which S40network applies the MAC and runs ifup) and
points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: xiongmai-osdrv-xm530 must not
install the vendor cfg80211 rewrite when atbm60xx is enabled, as the
atbm driver is built against the in-tree cfg80211.
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Aug 26, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530-usb case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio (after which
S40network applies the MAC and runs ifup), and points the upgrade url
at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module).

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft August 26, 2026 17:39
@yatotoshka
yatotoshka marked this pull request as ready for review August 26, 2026 17:39
Comment on lines +70 to +72
BR2_PACKAGE_ATBM60XX=y
BR2_PACKAGE_ATBM60XX_MODEL_603X=y
BR2_PACKAGE_ATBM60XX_INTERFACE_USB=y

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. atbm60xx path remains untested 📘 Rule violation ☼ Reliability

The PR enables the clean-built atbm60xx path globally, but the description explicitly says the
demonstrated camera used a prebuilt blob and local init script and that an image built from this
patch has not yet been flashed. The supplied before/after output therefore does not verify the
behavior-changing path introduced here, contrary to the hardware-evidence requirement.
Agent Prompt
## Issue description
The newly enabled `atbm60xx` clean-build and startup path lacks hardware verification from an image produced by this PR.

## Issue Context
The existing evidence comes from a prebuilt driver blob and local init script, while Compliance ID 1 requires board output proving the behavior-changing implementation under review.

## Fix Focus Areas
- br-ext-chip-xiongmai/configs/xm530_lite_defconfig[70-72]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread general/overlay/etc/wireless/usb
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e46f92f

@flyrouter

Copy link
Copy Markdown
Member

Good afternoon
Thank you for your interest in our project and the PR you sent.
Unfortunately, we won't be able to accept it because we have a separate repository for board customisation - Builder. Please take a look at it and create your model profile there, that would be the right approach.
Thanks.

@flyrouter

Copy link
Copy Markdown
Member

By the way, I found a few patches in Builder that I haven't sent yet, and I'll try to upload them tomorrow or at the latest in the next few days. And maybe this will help us create a stable solution together. Thanks.

@yatotoshka
yatotoshka marked this pull request as draft August 27, 2026 22:55
widgetii pushed a commit that referenced this pull request Aug 29, 2026
MT7601U_OPENIPC_VERSION was HEAD, so the same tree produced different artifacts
over time and the package could break with no change in this repo. Pin it to an
immutable ref instead.

0ac46553f3190d788b01c15cbeaa14f2951c55a3 is the current tip of openipc/mt7601u
and has been since 2023-08-11, so this is behaviourally a no-op today and purely
protective against future drift. It is also the lineage runtime-verified on a
Hi3518EV200: WPA2 join, RTSP streaming, 15-17 Mbps TX.

The package is enabled in four defconfigs, so this is a live path rather than a
dead one.

Rescoped after review: the original PR also enabled BR2_PACKAGE_MT7601U_OPENIPC
in hi3518ev200_ultimate_defconfig. Per review, firmware images ship WiFi
utilities and not drivers, and per-device selection belongs in Builder, so that
part was dropped on 2026-08-12 and only the pin remains. The changes-requested
predated that rescope and was dismissed as stale, not overridden.

Second instance of an unpinned package found this month; #2316
carries the same fix for atbm60xx. Worth a sweep for other VERSION = HEAD.
@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from e46f92f to d8ca418 Compare September 6, 2026 20:35
@yatotoshka
yatotoshka marked this pull request as ready for review September 6, 2026 20:57
insmod /lib/modules/3.10.103+/xiongmai/wifi_pdn.ko value=96
insmod /lib/modules/3.10.103+/xiongmai/compat.ko
insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211.ko # grab from original firmware
insmod /lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko # vendor rewrite, kept off the in-tree cfg80211 path

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Camera wifi can miss dependencies 📘 Rule violation ☼ Reliability

The modified wifi helper invokes insmod for cfg80211_xm711.ko instead of the tree's
dependency-aware modprobe convention. When the xm711 branch runs, dependencies are not resolved
from the regenerated module metadata, so an unmet prerequisite prevents that WiFi stack from
loading.
Agent Prompt
## Issue description
The modified shipped WiFi helper loads `cfg80211_xm711.ko` directly with `insmod`, bypassing dependency-aware module loading.

## Issue Context
The package now regenerates module dependency metadata, so the renamed module should be loaded by module name through `modprobe`.

## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530/files/script/wifi[10-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d8ca418

@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from d8ca418 to 406f923 Compare September 7, 2026 18:14
@yatotoshka
yatotoshka marked this pull request as draft September 7, 2026 18:33
@yatotoshka
yatotoshka marked this pull request as ready for review September 7, 2026 18:33
Comment thread general/overlay/etc/wireless/usb Outdated
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 406f923

@yatotoshka
yatotoshka marked this pull request as draft September 19, 2026 18:41
@yatotoshka
yatotoshka marked this pull request as ready for review September 19, 2026 18:42
Comment thread general/package/atbm60xx/post-build-hook.sh Outdated
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7893b9e

Some XM530 boards (e.g. IPC-RB-BLK530AI-0235P-AB0) carry an AltoBeam
ATBM6032 on USB (007a:8888) with a power-down gpio. Add the
atbm603x-xm530 case to /etc/wireless/usb: load the DWC OTG controller,
power the radio through the PDN gpio read from the per-board wifipdn
env (set e.g. by a builder profile customizer), then modprobe the
driver; S40network applies the MAC and runs ifup as for every other
wlandev. Selecting the atbm60xx driver stays the device profile's
business in OpenIPC/builder; the shared xm530_lite_defconfig is not
touched.

Supporting changes:
- re-run depmod in xiongmai-osdrv-xm530's target-finalize: the vendor
  kernel ships a modules.dep that only lists its own modules, leaving
  dwc_otg, wifi_pdn and atbm603x invisible to modprobe (same pattern as
  hisilicon-opensdk);
- install the vendor cfg80211 rewrite as cfg80211_xm711.ko instead of
  over the in-tree cfg80211, and load it from there in the 'wifi xm711'
  helper: atbm60xx (and the kernel-built mac80211) need the in-tree
  module at the canonical path, so both WiFi stacks stay usable in one
  image;
- pin atbm60xx to a fixed revision instead of moving HEAD.
@yatotoshka
yatotoshka force-pushed the xiongmai-atbm60xx-wifi branch from 7893b9e to 683a548 Compare September 30, 2026 19:32
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530-usb case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio (after which
S40network applies the MAC and runs ifup), and points the upgrade url
at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module).

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530-usb case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio (after which
S40network applies the MAC and runs ifup), and points the upgrade url
at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module).

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm603x uses the in-tree module).

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft September 30, 2026 20:55
@yatotoshka
yatotoshka marked this pull request as ready for review September 30, 2026 20:56
Comment thread general/overlay/etc/wireless/usb
# does the kernel-built mac80211. `wifi xm711` loads the renamed copy.
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/rewrite/cfg80211.ko
$(INSTALL) -m 644 $(XIONGMAI_OSDRV_XM530_PKGDIR)/files/kmod/rewrite/cfg80211.ko $(TARGET_DIR)/lib/modules/3.10.103+/kernel/net/wireless/cfg80211_xm711.ko

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

11. Switching radios prevents xm711 wifi 🐞 Bug ≡ Correctness

The install rule renames the vendor cfg80211.ko file without changing its embedded module
identity, and wifi xm711 tries to load it as a second cfg80211 module. If the in-tree cfg80211
module was loaded for another radio first, the vendor module cannot load while it remains active, so
the subsequent XM711 load cannot work.
Agent Prompt
## Issue description
Renaming the vendor cfg80211 file does not make it loadable alongside the in-tree cfg80211 module.

## Fix Focus Areas
- general/package/xiongmai-osdrv-xm530/xiongmai-osdrv-xm530.mk[24-29]
- general/package/xiongmai-osdrv-xm530/files/script/wifi[5-12]

## Recommended Fix
Make the XM711 loading path ensure the in-tree wireless driver stack and cfg80211 are unloaded before loading the vendor module. If switching without a reboot is unsupported, enforce and document that limitation rather than treating the renamed file as an independent module.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 683a548

yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module). Until that PR
merges, master.yml builds this target against the branch carrying it
(OPENIPC_FW_REPO/REV, matrix-conditional, empty for every other
target) so the published archive is functional; remove the pin once
firmware#2316 lands.

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft September 30, 2026 21:03
@yatotoshka
yatotoshka marked this pull request as ready for review September 30, 2026 21:03
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 683a548

yatotoshka pushed a commit to yatotoshka/builder that referenced this pull request Sep 30, 2026
The defconfig selects the atbm60xx driver (603x, USB) on top of
xm530_lite, and drops the MT7601U firmware this radio does not use.
The customizer sets wlandev to the atbm603x-xm530 case in
firmware's /etc/wireless/usb and wifipdn to the PDN gpio the case
reads at run time (after which S40network applies the MAC and runs
ifup), and points the upgrade url at this device's builder release.

Depends on OpenIPC/firmware#2316: it provides the bring-up case, the
depmod pass that makes the driver stack resolvable by modprobe, and
the cfg80211 coexistence (the vendor rewrite ships as
cfg80211_xm711.ko, atbm60xx uses the in-tree module). This profile
stays a draft until firmware#2316 merges; once it lands, the regular
CI builds a functional image for this device from upstream firmware.

xm530_lite_anbiux-a8b-3mp joins SMOKE_TARGETS: the vendor:xiongmai
trait must be covered or ci-matrix.py's self-test refuses to select a
build matrix.
@yatotoshka
yatotoshka marked this pull request as draft September 30, 2026 22:20
@yatotoshka
yatotoshka marked this pull request as ready for review September 30, 2026 22:20
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 683a548

@flyrouter

Copy link
Copy Markdown
Member

Good afternoon
This PR is frozen until it merges with another branch, which will first be merged into Builder, explored, and only then global joint changes may be possible.
Thank you

This branch has not been deployed

No deployments
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.

3 participants