Skip to content

Refuse Wi-Fi radio settings the hardware cannot do, offer only valid ones in the WebUI - #1811

Open
mattiaswal wants to merge 11 commits into
mainfrom
wifi-radio-validate
Open

mattiaswal wants to merge 11 commits into
mainfrom
wifi-radio-validate

Conversation

@mattiaswal

@mattiaswal mattiaswal commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Wi-Fi radio settings the hardware cannot do are now refused when configured, instead of leaving an access point that never comes up. The WebUI radio forms offer only the bands and channels the radio reports.

confd checks every changed radio against what yangerd reports and fails the commit with an error naming the radio or interface and the setting:

  • the band must be one the radio has
  • the channel must belong to the configured band and be in that band's channel list
  • 40 MHz needs HT or HE on the band, 80/160 MHz needs VHT or HE
  • the number of enabled access points must not exceed what the radio supports
  • the interface mode must be one the radio supports, e.g. no mesh point on a radio without 802.11s

The radio data is read with a single yangerctl get /ietf-hardware:hardware per change, and only when a Wi-Fi radio is part of it. The check is skipped when yangerd does not answer, as at boot, when the radio is not present, and for channel auto. The channel list check is also skipped when the country code changes in the same commit, since the list follows the regulatory domain and that is not applied yet.

yangerd

  • supported-channels held only the last frequency of each band. A split wiphy dump carries one frequency per message and each one replaced the band's list. 2484 MHz was reported as channel 15 and is now 14, and the 5 GHz range reaches channel 177.
  • New supported-modes leaf-list on the radio.
  • New channels leaf-list in each entry of bands. The flat list cannot tell 2.4 GHz channel 1 from 6 GHz channel 1.
  • A band where the country code disables every channel was dropped, so 6 GHz looked unsupported in the world domain. It is now reported with an empty channel list.

YANG (infix-hardware, same revision 2026-11-04)

A radio without a band no longer takes a channel, channel-width or legacy-rates. Only a station radio goes without a band, and it follows its access point. A migration drops the three leaves from such a radio on upgrade.

WebUI

  • The radio forms on the interfaces and hardware pages list only the bands the radio reports, and the channel is a select with auto plus the channels of the chosen band. Without a band only auto is offered.
  • The country code is no longer part of the radio forms. It is one setting in a WiFi card on the interfaces page, shown when a radio is detected, and still on the hardware page. It is saved when changed, there is no Save button.
  • The band and channel lists follow the applied country code. When the candidate holds another code the card and the radio forms say so.
  • Interface types are shown as the model names them. A table in the handler capitalized some and passed the rest through, so the list mixed "Bridge" and "VXLAN" with "wifi".

qemu: make run on DDI images passes the number of mac80211_hwsim radios to the guest again.

Known gaps:

  • yangerd has no 160 MHz capability flag, so 160 MHz passes on any VHT or HE radio
  • no station limit is reported, so only the access point count is checked
  • yangerd updates the channel list asynchronously after a country code change, a channel set in a commit right after one can be checked against the old list
  • a radio that reports no bands gets only auto and its current channel in the WebUI channel select
  • the WebUI lists do not follow a country code that is selected but not applied

The test wifi_radio_validation covers a channel outside the band and a channel the country code does not allow. The band, width and access point checks cannot be made to fail on hwsim, which has HE everywhere and 2048 access points. The new YANG rule is not covered by a test: it was checked with yanglint and a RESTCONF PUT on a QEMU guest, and the migration on a sample file only. The WebUI forms were checked in headless Chromium against a QEMU guest with two hwsim radios.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@mattiaswal mattiaswal added the ci:main Build default defconfig, not minimal label Nov 20, 2026
@mattiaswal mattiaswal changed the title Wifi radio validate Refuse Wi-Fi radio settings the hardware cannot do Nov 20, 2026
A split wiphy dump carries one frequency per message and each one
replaced the band's list, so only the last frequency of a band was
kept.  2484 MHz is channel 14, and 5 GHz reaches channel 177.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
hostapd fails to start on a band, channel or width the radio lacks and
the operator only sees an access point that never comes up.  Ask
yangerd once per change, and skip the check when it does not answer,
as at boot.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Needed to tell whether a radio can carry a mesh point before an
interface is created on it.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
A mesh point on a radio without 802.11s support was accepted and the
interface never came up.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
The run script for DDI images never passed opt/wifi to the guest, so
make run on x86 lost the option to start with mac80211_hwsim radios.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
The flat channel list cannot tell 2.4 GHz channel 1 from 6 GHz channel 1.
A band the country code disables every channel of was dropped, so 6 GHz
looked unsupported in the world domain.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
The flat list accepted a channel number on 6 GHz that the radio only
has on 2.4 GHz.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Only a station radio goes without a band, and it follows its access
point, so a channel, width or legacy rates did nothing there.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
A free-text channel and every band of the model let the operator pick
what confd then refuses.  The lists follow the applied country code, so
it becomes one setting on the interfaces page, saved on change, and the
forms say when it is not applied yet.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
A table in the handler capitalized some types and passed the rest
through, so the list mixed "Bridge" and "VXLAN" with "wifi".

Signed-off-by: Mattias Walström <lazzer@gmail.com>
@mattiaswal mattiaswal changed the title Refuse Wi-Fi radio settings the hardware cannot do Refuse Wi-Fi radio settings the hardware cannot do, offer only valid ones in the WebUI Nov 20, 2026
@mattiaswal
mattiaswal requested a review from troglobit November 20, 2026 21:33
@mattiaswal
mattiaswal marked this pull request as ready for review November 20, 2026 21:40

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

ci:main Build default defconfig, not minimal

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant