wifi-scripts: fix phy index lookup in device_capabilities

For renamed phys, the index cannot be derived from the name

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2024-12-19 06:44:30 +01:00
parent 8943430b9f
commit 2e03c7d53e

View File

@ -437,7 +437,7 @@ function device_extended_features(data, flag) {
}
function device_capabilities(phy) {
let idx = +substr(phy, 3, 1);;
let idx = +fs.readfile(`/sys/class/ieee80211/${phy}/index`);
phy = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true });
if (!phy)
return;