From b0d8ab4fef7e1feb21d020f4aa5ff8b6d27913c3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 10 Jul 2026 12:26:55 +0200 Subject: [PATCH] wifi-scripts: emit frequency and STA-channel markers in hostapd config Emit #frequency (the target channel frequency, already computed during phy setup) and #channel_owned_by_sta (set when a co-located STA/mesh/adhoc on the same band dictates the runtime channel) into the generated config. The hostapd daemon uses these to decide whether a channel change can be applied via CSA instead of a full restart. Signed-off-by: Felix Fietkau --- .../wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh | 1 + .../wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index fa924cb1db..5d3a99c7fc 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -256,6 +256,7 @@ function setup() { // fallthrough case 'sta': data.ap_start_disabled = true; + data.channel_follow = true; let config = supplicant.generate(supplicant_data, data, v); if (mode == "mesh") config_add_mesh_params(config, v.config); diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index 64d52cb754..32b0b00775 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -589,6 +589,10 @@ export function setup(data) { append('\n#num_global_macaddr', data.config.num_global_macaddr); if (data.config.macaddr_base) append('\n#macaddr_base', data.config.macaddr_base); + if (data.config.frequency) + append('\n#frequency', data.config.frequency); + if (data.channel_follow) + append('\n#channel_follow', 1); let has_ap; for (let k, interface in data.interfaces) {