import * as uci from 'uci';
const bands_order = [ "6G", "5G", "2G" ];
-const htmode_order = [ "HE", "VHT", "HT" ];
+const htmode_order = [ "EHT", "HE", "VHT", "HT" ];
let board = json(readfile("/etc/board.json"));
if (!board.wlan)
if (band.vht_capa > 0)
band_info.vht = true;
let he_phy_cap = 0;
+ let eht_phy_cap = 0;
for (let ift in band.iftype_data) {
if (!ift.he_cap_phy)
band_info.he = true;
he_phy_cap |= ift.he_cap_phy[0];
- /* TODO: EHT */
+
+ if (!ift.eht_cap_phy)
+ continue;
+
+ band_info.eht = true;
+ eht_phy_cap |= ift.eht_cap_phy[0];
}
if (band_name != "2G" &&
push(modes, "VHT20");
if (band_info.he)
push(modes, "HE20");
+ if (band_info.eht)
+ push(modes, "EHT20");
if (band.ht_capa & 0x2) {
push(modes, "HT40");
if (band_info.vht)
push(modes, "VHT40")
}
- if (he_phy_cap & 0x2)
+ if (he_phy_cap & 2)
push(modes, "HE40");
+ if (eht_phy_cap && he_phy_cap & 2)
+ push(modes, "EHT40");
+
for (let freq in band.freqs) {
if (freq.disabled)
continue;
if (band_name == "2G")
continue;
+
+ if (he_phy_cap & 4)
+ push(modes, "HE40");
+ if (eht_phy_cap && he_phy_cap & 4)
+ push(modes, "EHT40");
if (band_info.vht)
push(modes, "VHT80");
if (he_phy_cap & 4)
push(modes, "HE80");
+ if (eht_phy_cap && he_phy_cap & 4)
+ push(modes, "EHT80");
if ((band.vht_capa >> 2) & 0x3)
push(modes, "VHT160");
if (he_phy_cap & 0x18)
push(modes, "HE160");
+ if (eht_phy_cap && he_phy_cap & 0x18)
+ push(modes, "EHT160");
+
+ if (eht_phy_cap & 2)
+ push(modes, "ETH320");
}
let entry = wiphy_get_entry(name, path);