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:
Felix Fietkau 2025-10-02 13:29:57 +02:00
parent 915a57ccd9
commit 727d8b27ab
3 changed files with 26 additions and 0 deletions

View File

@ -2,4 +2,5 @@
[ "${ACTION}" = "add" ] && {
/sbin/wifi config
ubus call network.wireless retry
}

View File

@ -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,

View File

@ -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) {