mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-08-05 23:36:58 +02:00
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 <nbd@nbd.name>
This commit is contained in:
parent
de447b93e0
commit
640c3984e3
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user