[openwrt/openwrt] wifi-scripts: ucode: add support for the legacy hwmode option
LEDE Commits
lede-commits at lists.infradead.org
Thu Sep 25 00:41:44 PDT 2025
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ce3ab2646b1e1f14f1d7d4d67698bd7fd85c821f
commit ce3ab2646b1e1f14f1d7d4d67698bd7fd85c821f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Sep 25 09:40:47 2025 +0200
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 at nbd.name>
---
.../files-ucode/lib/netifd/wireless/mac80211.sh | 25 +++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
index ab8b2d15f9..7acff9be8f 100755
--- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh
@@ -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;
More information about the lede-commits
mailing list