-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
Tested with filogic banana rpi4 / QNAP qualcommax ipq8074 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,9 @@ function format_wifirate(rate) { | |
mhz = rate.mhz, nss = rate.nss, | ||
mcs = rate.mcs, sgi = rate.short_gi, | ||
he = rate.he, he_gi = rate.he_gi, | ||
he_dcm = rate.he_dcm; | ||
he_dcm = rate.he_dcm, | ||
eht = rate?.eht ?? false, eht_gi = rate?.eht_gi ?? 0, | ||
eht_dcm = rate?.eht_dcm ?? 0; | ||
|
||
if (ht || vht) { | ||
if (vht) s += ', VHT-MCS\xa0%d'.format(mcs); | ||
|
@@ -217,6 +219,13 @@ function format_wifirate(rate) { | |
if (he_dcm) s += ', HE-DCM\xa0%d'.format(he_dcm); | ||
} | ||
|
||
if (eht) { | ||
s += ', EHT-MCS\xa0%d'.format(mcs); | ||
if (nss) s += ', EHT-NSS\xa0%d'.format(nss); | ||
if (eht_gi) s += ', EHT-GI\xa0%d'.format(eht_gi); | ||
if (eht_dcm) s += ', EHT-DCM\xa0%d'.format(eht_dcm); | ||
} | ||
|
||
return s; | ||
} | ||
|
||
|
@@ -298,14 +307,17 @@ function add_dependency_permutations(o, deps) { | |
o.depends(res[i]); | ||
} | ||
|
||
// Define a class CBIWifiFrequencyValue that extends form.Value | ||
var CBIWifiFrequencyValue = form.Value.extend({ | ||
// Declare an RPC method to get the frequency list for a given device | ||
callFrequencyList: rpc.declare({ | ||
object: 'iwinfo', | ||
method: 'freqlist', | ||
params: [ 'device' ], | ||
expect: { results: [] } | ||
}), | ||
|
||
// Load method to fetch WiFi device details and frequency list | ||
load: function(section_id) { | ||
return Promise.all([ | ||
network.getWifiDevice(section_id), | ||
|
@@ -334,13 +346,16 @@ var CBIWifiFrequencyValue = form.Value.extend({ | |
var hwmodelist = L.toArray(data[0] ? data[0].getHWModes() : null) | ||
.reduce(function(o, v) { o[v] = true; return o }, {}); | ||
|
||
// Define supported modes | ||
this.modes = [ | ||
'', 'Legacy', hwmodelist.a || hwmodelist.b || hwmodelist.g, | ||
'n', 'N', hwmodelist.n, | ||
'ac', 'AC', L.hasSystemFeature('hostapd', '11ac') && hwmodelist.ac, | ||
'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax | ||
'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax, | ||
'be', 'BE', L.hasSystemFeature('hostapd', '11be') && hwmodelist.be | ||
]; | ||
|
||
// Create a list of HT modes based on device capabilities | ||
var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null) | ||
.reduce(function(o, v) { o[v] = true; return o }, {}); | ||
|
||
|
@@ -361,9 +376,18 @@ var CBIWifiFrequencyValue = form.Value.extend({ | |
'HE40', '40 MHz', htmodelist.HE40, | ||
'HE80', '80 MHz', htmodelist.HE80, | ||
'HE160', '160 MHz', htmodelist.HE160 | ||
], | ||
'be': [ | ||
'EHT20', '20 MHz', htmodelist.EHT20, | ||
'EHT40', '40 MHz', htmodelist.EHT40, | ||
'EHT80', '80 MHz', htmodelist.EHT80, | ||
'EHT160', '160 MHz', htmodelist.EHT160, | ||
'EHT320', '320 MHz', htmodelist.EHT320 | ||
] | ||
}; | ||
|
||
// Define available bands for widget selection based on channel availability | ||
// AX and BE are available on 2/5/6G bands | ||
this.bands = { | ||
'': [ | ||
'2g', '2.4 GHz', this.channels['2g'].length > 3, | ||
|
@@ -381,11 +405,17 @@ var CBIWifiFrequencyValue = form.Value.extend({ | |
'2g', '2.4 GHz', this.channels['2g'].length > 3, | ||
'5g', '5 GHz', this.channels['5g'].length > 3, | ||
'6g', '6 GHz', this.channels['6g'].length > 3 | ||
] | ||
], | ||
'be': [ | ||
'2g', '2.4 GHz', this.channels['2g'].length > 3, | ||
'5g', '5 GHz', this.channels['5g'].length > 3, | ||
'6g', '6 GHz', this.channels['6g'].length > 3 | ||
], | ||
}; | ||
}, this)); | ||
}, | ||
|
||
// Set values in the select element | ||
setValues: function(sel, vals) { | ||
if (sel.vals) | ||
sel.vals.selected = sel.selectedIndex; | ||
|
@@ -445,7 +475,10 @@ var CBIWifiFrequencyValue = form.Value.extend({ | |
|
||
this.setValues(mode, this.modes); | ||
|
||
if (/HE20|HE40|HE80|HE160/.test(htval)) | ||
// Determine mode based on htmode value | ||
if (/EHT20|EHT40|EHT80|EHT160|EHT320/.test(htval)) | ||
mode.value = 'be'; | ||
else if (/HE20|HE40|HE80|HE160/.test(htval)) | ||
mode.value = 'ax'; | ||
else if (/VHT20|VHT40|VHT80|VHT160/.test(htval)) | ||
mode.value = 'ac'; | ||
|
@@ -459,7 +492,9 @@ var CBIWifiFrequencyValue = form.Value.extend({ | |
if (hwval != null) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Ansuel
Member
|
||
this.useBandOption = false; | ||
|
||
if (/a/.test(hwval)) | ||
if (/be/.test(mode.value)) | ||
band.value = '6g'; | ||
else if (/ax/.test(mode.value)) | ||
band.value = '5g'; | ||
else | ||
band.value = '2g'; | ||
|
This change is
total bullshitwrong (sorry for the offensive wording). "hwval" (hwmode in config files) is a deprecated option that can only contain "11b", "11g" or "11a". Anything that contains "a" is 5G, otherwise it's 2G. That is what this part of the code meant, before you broke it. Any check for "be" or "ax" has to go somewhere else, not here.