wifi-scripts: retry setup of wireless devices that show up late
When a phy appears after setup has already been attempted, tell netifd to retry setup for all failed wireless devices. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
915a57ccd9
commit
727d8b27ab
@ -2,4 +2,5 @@
|
||||
|
||||
[ "${ACTION}" = "add" ] && {
|
||||
/sbin/wifi config
|
||||
ubus call network.wireless retry
|
||||
}
|
||||
|
||||
@ -405,6 +405,19 @@ function start()
|
||||
this.setup();
|
||||
}
|
||||
|
||||
|
||||
function retry_setup()
|
||||
{
|
||||
if (this.delete)
|
||||
return;
|
||||
|
||||
if (this.state != "down" || !this.autostart)
|
||||
return;
|
||||
|
||||
this.start();
|
||||
}
|
||||
|
||||
|
||||
function stop()
|
||||
{
|
||||
this.dbg("stop, state=" + this.state);
|
||||
@ -604,6 +617,7 @@ function dbg(msg)
|
||||
const wdev_proto = {
|
||||
update,
|
||||
destroy,
|
||||
retry_setup,
|
||||
start,
|
||||
stop,
|
||||
setup,
|
||||
|
||||
@ -446,6 +446,17 @@ const ubus_obj = {
|
||||
});
|
||||
}
|
||||
},
|
||||
retry: {
|
||||
args: wdev_args,
|
||||
call: function(req) {
|
||||
hostapd_update_mlo();
|
||||
|
||||
return wdev_call(req, (dev) => {
|
||||
dev.retry_setup();
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
reconf: {
|
||||
args: wdev_args,
|
||||
call: function(req) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user