]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: emit frequency and STA-channel markers in hostapd config
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 10:26:55 +0000 (12:26 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:21 +0000 (11:50 +0200)
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 <nbd@nbd.name>
package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc

index fa924cb1db18c6ba6508d2cfd33a42b7ada39bc4..5d3a99c7fc54f7f93200bf40689068a3db21f9ed 100755 (executable)
@@ -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);
index 64d52cb7543174c143c5718d8c9f7c3fcf93638c..32b0b007750692a76aedf5bbd2d1c2f54df9bd17 100644 (file)
@@ -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) {