summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2024-12-08 12:36:41 +0000
committerFelix Fietkau2024-12-08 13:11:14 +0000
commit0286dfe394cbad2a736160fec784b024ce4040bd (patch)
treec0935f93a5d480014eaa9d8cd9f492bae5ea2205
parent22d2aa65e87130a597e9f9c970bfece4232dba72 (diff)
downloadopenwrt-0286dfe394cbad2a736160fec784b024ce4040bd.tar.gz
wifi-scripts: fix regression with ucode update
nl80211.request with GET_WIPHY for a single wiphy no longer returns an array Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc32
1 files changed, 14 insertions, 18 deletions
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
index 78b38ff633..2f6c4ddc40 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
@@ -438,29 +438,25 @@ function device_extended_features(data, flag) {
function device_capabilities(phy) {
let idx = +substr(phy, 3, 1);;
- let phys = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true });
-
- for (let phy in phys) {
- if (!phy || phy.wiphy != idx)
+ phy = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true });
+ if (!phy)
+ return;
+ for (let band in phy.wiphy_bands) {
+ if (!band)
continue;
- for (let band in phy.wiphy_bands) {
- if (!band)
+ phy_capabilities.ht_capa = band.ht_capa ?? 0;
+ phy_capabilities.vht_capa = band.vht_capa ?? 0;
+ for (let iftype in band.iftype_data) {
+ if (!iftype.iftypes.ap)
continue;
- phy_capabilities.ht_capa = band.ht_capa ?? 0;
- phy_capabilities.vht_capa = band.vht_capa ?? 0;
- for (let iftype in band.iftype_data) {
- if (!iftype.iftypes.ap)
- continue;
- phy_capabilities.he_mac_cap = iftype.he_cap_mac;
- phy_capabilities.he_phy_cap = iftype.he_cap_phy;
- }
- break;
+ phy_capabilities.he_mac_cap = iftype.he_cap_mac;
+ phy_capabilities.he_phy_cap = iftype.he_cap_phy;
}
-
- phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
- phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND);
break;
}
+
+ phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
+ phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND);
}
function generate(config) {