1
0
Fork 0
forked from mirror/openwrt

wifi-scripts: ucode: add support for the legacy hwmode option

Some configs that are many years old still have it set instead of band

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2025-09-25 09:40:47 +02:00
parent 3db08ebaa7
commit ce3ab2646b

View file

@ -175,7 +175,30 @@ function setup() {
log('Starting');
validate('device', data.config);
let config = data.config;
if (!config.band) {
switch (config.hwmode) {
case 'a':
case '11a':
config.band = '5g';
break;
case 'ad':
case '11ad':
config.band = '60g';
break;
case 'b':
case 'g':
case '11b':
case '11g':
default:
config.band = '2g';
break;
}
}
delete config.hwmode;
validate('device', config);
setup_phy(data.phy, data.config, data.data);
let supplicant_mesh;