Skip to content

Commit 4bcfa32

Browse files
committed
luci-wireless: Add 11be support
Tested with filogic banana rpi4 / QNAP qualcommax ipq8074 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com>
1 parent 8559119 commit 4bcfa32

4 files changed

Lines changed: 89 additions & 9 deletions

File tree

modules/luci-base/htdocs/luci-static/resources/network.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3371,6 +3371,7 @@ WifiDevice = baseclass.extend(/** @lends LuCI.network.WifiDevice.prototype */ {
33713371
* - `n` - IEEE 802.11n mode, 2.4 or 5 GHz, up to 600 Mbit/s
33723372
* - `ac` - IEEE 802.11ac mode, 5 GHz, up to 6770 Mbit/s
33733373
* - `ax` - IEEE 802.11ax mode, 2.4 or 5 GHz
3374+
* - 'be' - IEEE 802.11be mode, 2.4, 5 or 6 GHz
33743375
*/
33753376
getHWModes: function() {
33763377
var hwmodes = this.ubus('dev', 'iwinfo', 'hwmodes');
@@ -3396,6 +3397,11 @@ WifiDevice = baseclass.extend(/** @lends LuCI.network.WifiDevice.prototype */ {
33963397
* - `HE40` - applicable to IEEE 802.11ax, 40 MHz wide channels
33973398
* - `HE80` - applicable to IEEE 802.11ax, 80 MHz wide channels
33983399
* - `HE160` - applicable to IEEE 802.11ax, 160 MHz wide channels
3400+
* - `EHT20` - applicable to IEEE 802.11be, 20 MHz wide channels
3401+
* - `EHT40` - applicable to IEEE 802.11be, 40 MHz wide channels
3402+
* - `EHT80` - applicable to IEEE 802.11be, 80 MHz wide channels
3403+
* - `EHT160` - applicable to IEEE 802.11be, 160 MHz wide channels
3404+
* - `EHT320` - applicable to IEEE 802.11be, 320 MHz wide channels
33993405
*/
34003406
getHTModes: function() {
34013407
var htmodes = this.ubus('dev', 'iwinfo', 'htmodes');
@@ -4101,6 +4107,17 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
41014107
* @property {number} [he_dcm]
41024108
* Specifies whether dual concurrent modulation is used for the transmission.
41034109
* Only applicable to HE rates.
4110+
*
4111+
* @property {boolean} [eht]
4112+
* Specifies whether this rate is an EHT (IEEE 802.11be) rate.
4113+
*
4114+
* @property {number} [eht_gi]
4115+
* Specifies whether the guard interval used for the transmission.
4116+
* Only applicable to EHT rates.
4117+
*
4118+
* @property {number} [eht_dcm]
4119+
* Specifies whether dual concurrent modulation is used for the transmission.
4120+
* Only applicable to EHT rates.
41044121
*/
41054122

41064123
/**

modules/luci-base/root/usr/share/rpcd/ucode/luci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const methods = {
208208
relayd: access('/usr/sbin/relayd') == true,
209209
};
210210

211-
const wifi_features = [ 'eap', '11ac', '11ax', '11r', 'acs', 'sae', 'owe', 'suiteb192', 'wep', 'wps', 'ocv' ];
211+
const wifi_features = [ 'eap', '11ac', '11ax', '11be', '11r', 'acs', 'sae', 'owe', 'suiteb192', 'wep', 'wps', 'ocv' ];
212212

213213
if (access('/usr/sbin/hostapd')) {
214214
result.hostapd = { cli: access('/usr/sbin/hostapd_cli') == true };

modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
var modes = [
3030
'', 'Legacy', true,
3131
'n', 'N', hwmodes.n,
32-
'ac', 'AC', hwmodes.ac
32+
'ac', 'AC', hwmodes.ac,
33+
'ax', 'AX', hwmodes.ax,
34+
'be', 'BE', hwmodes.be
3335
];
3436

3537
var htmodes = {
@@ -45,6 +47,19 @@
4547
'VHT40', '40 MHz', htmodes.VHT40,
4648
'VHT80', '80 MHz', htmodes.VHT80,
4749
'VHT160', '160 MHz', htmodes.VHT160
50+
],
51+
'ax': [
52+
'HE20', '20 MHz', htmodes.HE20,
53+
'HE40', '40 MHz', htmodes.HE40,
54+
'HE80', '80 MHz', htmodes.HE80,
55+
'HE160', '160 MHz', htmodes.HE160
56+
],
57+
'be': [
58+
'EHT20', '20 MHz', htmodes.EHT20,
59+
'EHT40', '40 MHz', htmodes.EHT40,
60+
'EHT80', '80 MHz', htmodes.EHT80,
61+
'EHT160', '160 MHz', htmodes.EHT160,
62+
'EHT320', '320 MHz', htmodes.EHT320
4863
]
4964
};
5065

@@ -59,7 +74,16 @@
5974
],
6075
'ac': [
6176
'11a', '5 GHz', true
62-
]
77+
],
78+
'ax': [
79+
'11a', '2 GHz', true,
80+
'11a', '5 GHz', true
81+
],
82+
'be': [
83+
'11a', '2 GHz', true,
84+
'11a', '5 GHz', true,
85+
'11a', '6 GHz', true
86+
]
6387
};
6488

6589
function cbi_set_values(sel, vals)
@@ -129,7 +153,11 @@
129153

130154
cbi_set_values(mode, modes);
131155

132-
if (/VHT20|VHT40|VHT80|VHT160/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>))
156+
if (/EHT20|EHT40|EHT80|EHT160|EHT320/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>))
157+
mode.value = 'be';
158+
else if (/HE20|HE40|HE80|HE160/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>))
159+
mode.value = 'ax';
160+
else if (/VHT20|VHT40|VHT80|VHT160/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>))
133161
mode.value = 'ac';
134162
else if (/HT20|HT40/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>))
135163
mode.value = 'n';

modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ function format_wifirate(rate) {
201201
mhz = rate.mhz, nss = rate.nss,
202202
mcs = rate.mcs, sgi = rate.short_gi,
203203
he = rate.he, he_gi = rate.he_gi,
204-
he_dcm = rate.he_dcm;
204+
he_dcm = rate.he_dcm,
205+
eht = rate?.eht ?? false, eht_gi = rate?.eht_gi ?? 0,
206+
eht_dcm = rate?.eht_dcm ?? 0;
205207

206208
if (ht || vht) {
207209
if (vht) s += ', VHT-MCS\xa0%d'.format(mcs);
@@ -217,6 +219,13 @@ function format_wifirate(rate) {
217219
if (he_dcm) s += ', HE-DCM\xa0%d'.format(he_dcm);
218220
}
219221

222+
if (eht) {
223+
s += ', EHT-MCS\xa0%d'.format(mcs);
224+
if (nss) s += ', EHT-NSS\xa0%d'.format(nss);
225+
if (eht_gi) s += ', EHT-GI\xa0%d'.format(eht_gi);
226+
if (eht_dcm) s += ', EHT-DCM\xa0%d'.format(eht_dcm);
227+
}
228+
220229
return s;
221230
}
222231

@@ -298,14 +307,17 @@ function add_dependency_permutations(o, deps) {
298307
o.depends(res[i]);
299308
}
300309

310+
// Define a class CBIWifiFrequencyValue that extends form.Value
301311
var CBIWifiFrequencyValue = form.Value.extend({
312+
// Declare an RPC method to get the frequency list for a given device
302313
callFrequencyList: rpc.declare({
303314
object: 'iwinfo',
304315
method: 'freqlist',
305316
params: [ 'device' ],
306317
expect: { results: [] }
307318
}),
308319

320+
// Load method to fetch WiFi device details and frequency list
309321
load: function(section_id) {
310322
return Promise.all([
311323
network.getWifiDevice(section_id),
@@ -334,13 +346,16 @@ var CBIWifiFrequencyValue = form.Value.extend({
334346
var hwmodelist = L.toArray(data[0] ? data[0].getHWModes() : null)
335347
.reduce(function(o, v) { o[v] = true; return o }, {});
336348

349+
// Define supported modes
337350
this.modes = [
338351
'', 'Legacy', hwmodelist.a || hwmodelist.b || hwmodelist.g,
339352
'n', 'N', hwmodelist.n,
340353
'ac', 'AC', L.hasSystemFeature('hostapd', '11ac') && hwmodelist.ac,
341-
'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax
354+
'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax,
355+
'be', 'BE', L.hasSystemFeature('hostapd', '11be') && hwmodelist.be
342356
];
343357

358+
// Create a list of HT modes based on device capabilities
344359
var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null)
345360
.reduce(function(o, v) { o[v] = true; return o }, {});
346361

@@ -361,9 +376,18 @@ var CBIWifiFrequencyValue = form.Value.extend({
361376
'HE40', '40 MHz', htmodelist.HE40,
362377
'HE80', '80 MHz', htmodelist.HE80,
363378
'HE160', '160 MHz', htmodelist.HE160
379+
],
380+
'be': [
381+
'EHT20', '20 MHz', htmodelist.EHT20,
382+
'EHT40', '40 MHz', htmodelist.EHT40,
383+
'EHT80', '80 MHz', htmodelist.EHT80,
384+
'EHT160', '160 MHz', htmodelist.EHT160,
385+
'EHT320', '320 MHz', htmodelist.EHT320
364386
]
365387
};
366388

389+
// Define available bands for widget selection based on channel availability
390+
// AX and BE are available on 2/5/6G bands
367391
this.bands = {
368392
'': [
369393
'2g', '2.4 GHz', this.channels['2g'].length > 3,
@@ -381,11 +405,17 @@ var CBIWifiFrequencyValue = form.Value.extend({
381405
'2g', '2.4 GHz', this.channels['2g'].length > 3,
382406
'5g', '5 GHz', this.channels['5g'].length > 3,
383407
'6g', '6 GHz', this.channels['6g'].length > 3
384-
]
408+
],
409+
'be': [
410+
'2g', '2.4 GHz', this.channels['2g'].length > 3,
411+
'5g', '5 GHz', this.channels['5g'].length > 3,
412+
'6g', '6 GHz', this.channels['6g'].length > 3
413+
],
385414
};
386415
}, this));
387416
},
388417

418+
// Set values in the select element
389419
setValues: function(sel, vals) {
390420
if (sel.vals)
391421
sel.vals.selected = sel.selectedIndex;
@@ -445,7 +475,10 @@ var CBIWifiFrequencyValue = form.Value.extend({
445475

446476
this.setValues(mode, this.modes);
447477

448-
if (/HE20|HE40|HE80|HE160/.test(htval))
478+
// Determine mode based on htmode value
479+
if (/EHT20|EHT40|EHT80|EHT160|EHT320/.test(htval))
480+
mode.value = 'be';
481+
else if (/HE20|HE40|HE80|HE160/.test(htval))
449482
mode.value = 'ax';
450483
else if (/VHT20|VHT40|VHT80|VHT160/.test(htval))
451484
mode.value = 'ac';
@@ -459,7 +492,9 @@ var CBIWifiFrequencyValue = form.Value.extend({
459492
if (hwval != null) {
460493
this.useBandOption = false;
461494

462-
if (/a/.test(hwval))
495+
if (/be/.test(mode.value))
496+
band.value = '6g';
497+
else if (/ax/.test(mode.value))
463498
band.value = '5g';
464499
else
465500
band.value = '2g';

0 commit comments

Comments
 (0)