]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: fix rate settings
authorDavid Bauer <mail@david-bauer.net>
Thu, 30 Jul 2026 09:05:02 +0000 (11:05 +0200)
committerDavid Bauer <mail@david-bauer.net>
Thu, 30 Jul 2026 09:07:43 +0000 (11:07 +0200)
hostapd changed the configuration of basic and supported rates to a
per-bss setting. This left the current phy global settings unapplied.

Apply the rate settings in uci on each VAP of a PHY.

In the future, this setting can theoretically also be set per-bss
in uci. However it is not part of this patch.

Link: https://git.w1.fi/cgit/hostap/commit/?id=f7be1b53852a069f0d15eb471a6f9158467ab117
Signed-off-by: David Bauer <mail@david-bauer.net>
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc

index 56336a96fcb0a0b479e44f680b86deeb424b633d..51e2fe1db1c7ac91d2ea58c482072837c45c6ec1 100644 (file)
@@ -555,6 +555,11 @@ function iface_interworking(config) {
        append_list(config, [ 'anqp_elem', 'nai_realm', 'venue_name', 'venue_url' ]);
 }
 
+function iface_rates(config) {
+       for (let key in [ 'supported_rates', 'basic_rates' ])
+               append(key, map(config[key], x => x / 100))
+}
+
 export function generate(interface, data, config, vlans, stas, phy_features) {
        config.ctrl_interface = '/var/run/hostapd';
 
@@ -574,6 +579,8 @@ export function generate(interface, data, config, vlans, stas, phy_features) {
        if (config.auth_type in [ 'sae', 'psk-sae', 'psk-sae-compat' ])
                iface_sae_stations(config, stas);
 
+       iface_rates(data.config);
+
        iface_auth_type(config, data.config.band);
 
        iface_accounting_server(config);
index 2d0c7eed236c9ace8554df2cba81adbf07870854..457f540ef774ccb9632d841594a9146d7db79cba 100644 (file)
@@ -139,13 +139,6 @@ function device_cell_density_append(config) {
        }
 }
 
-function device_rates(config) {
-       for (let key in [ 'supported_rates', 'basic_rates' ])
-               config[key] = map(config[key], x => x / 100);
-
-       append_vars(config, [ 'beacon_rate', 'supported_rates', 'basic_rates' ]);
-}
-
 function device_htmode_append(config) {
        config.channel_offset = config.band == '6g' ? 1 : 0;
 
@@ -517,8 +510,6 @@ function generate(config) {
 
        device_cell_density_append(config);
 
-       device_rates(config);
-
        /* beacon */
        append_vars(config, [ 'beacon_int', 'beacon_rate', 'rnr_beacon' ]);