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>
This commit is contained in:
Felix Fietkau 2024-12-08 13:36:41 +01:00
parent 22d2aa65e8
commit 0286dfe394

View File

@ -438,11 +438,9 @@ function device_extended_features(data, flag) {
function device_capabilities(phy) { function device_capabilities(phy) {
let idx = +substr(phy, 3, 1);; 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 }); phy = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true });
if (!phy)
for (let phy in phys) { return;
if (!phy || phy.wiphy != idx)
continue;
for (let band in phy.wiphy_bands) { for (let band in phy.wiphy_bands) {
if (!band) if (!band)
continue; continue;
@ -459,8 +457,6 @@ function device_capabilities(phy) {
phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); 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); phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND);
break;
}
} }
function generate(config) { function generate(config) {