From: Felix Fietkau Date: Mon, 4 Aug 2025 10:08:27 +0000 (+0200) Subject: wifi-scripts: add support for passing wifi-device settings via procd X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=640c3984e31670be2aff1b60dd15c04a84bbbb7f;p=thirdparty%2Fopenwrt.git wifi-scripts: add support for passing wifi-device settings via procd Allows either overriding individual device settings, or passing complete devices Signed-off-by: Felix Fietkau --- diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc index a1ec40d79e3..956ca54413e 100644 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc @@ -183,6 +183,41 @@ function config_init(uci) } let udata = ubus.call({ + object: "service", + method: "get_data", + data: { + type: "wifi-device" + }, + }); + for (let svcname, svc in udata) { + for (let typename, data in svc) { + for (let radio, config in data) { + if (type(config) != "object") + continue; + + let dev = devices[radio]; + if (dev) { + dev.config = { ...dev.config, ...config }; + continue; + } + + let handler = wireless.handlers[config.type]; + if (!handler) + continue; + + dev = devices[radio] = { + name, + config, + + vif: [], + }; + handlers[radio] = handler; + } + } + } + + + udata = ubus.call({ object: "service", method: "get_data", data: { @@ -193,6 +228,9 @@ function config_init(uci) for (let svcname, svc in udata) { for (let typename, data in svc) { for (let radio, vifs in data) { + if (type(vifs) != "object") + continue; + for (let name, vif in vifs) { let devs = vif.device; if (type(devs) != "array")