luci-mod-network: add 802.11ax HE support
authorDavid Bauer <mail@david-bauer.net>
Tue, 20 Apr 2021 15:42:02 +0000 (17:42 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 12 Jun 2021 18:01:57 +0000 (20:01 +0200)
This commit adds the ability to configure HE-modes for radios
(HE20 / HE40 / HE80 / HE160) as well as HE rate information in the
assiciation view.

Tested-on: Ubiquiti UniFi 6 Lite / LR

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f35e877dc65c727a6ce7f7972a5be4d15921827b)

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

index b1dfcfd77c4e686a4a081991f170b71889686c38..158976df962cc6e0a15bc6c96ec4529ac85a4f5a 100644 (file)
@@ -4021,6 +4021,17 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
         * @property {number} [nss]
         * Specifies the number of spatial streams used by the transmission.
         * Only applicable to VHT rates.
+        *
+        * @property {boolean} [he]
+        * Specifies whether this rate is an HE (IEEE 802.11ax) rate.
+        *
+        * @property {number} [he_gi]
+        * Specifies whether the guard interval used for the transmission.
+        * Only applicable to HE rates.
+        *
+        * @property {number} [he_dcm]
+        * Specifies whether dual concurrent modulation is used for the transmission.
+        * Only applicable to HE rates.
         */
 
        /**
index 748cb6254f4aeb67300a2e1130aae894717bb455..e9707e85abf9277aff365c05bdc3b83fdfe6ef45 100644 (file)
@@ -199,7 +199,9 @@ function format_wifirate(rate) {
        var s = '%.1f\xa0%s, %d\xa0%s'.format(rate.rate / 1000, _('Mbit/s'), rate.mhz, _('MHz')),
            ht = rate.ht, vht = rate.vht,
            mhz = rate.mhz, nss = rate.nss,
-           mcs = rate.mcs, sgi = rate.short_gi;
+           mcs = rate.mcs, sgi = rate.short_gi,
+           he = rate.he, he_gi = rate.he_gi,
+           he_dcm = rate.he_dcm;
 
        if (ht || vht) {
                if (vht) s += ', VHT-MCS\xa0%d'.format(mcs);
@@ -208,6 +210,13 @@ function format_wifirate(rate) {
                if (sgi) s += ', ' + _('Short GI').replace(/ /g, '\xa0');
        }
 
+       if (he) {
+               s += ', HE-MCS\xa0%d'.format(mcs);
+               if (nss) s += ', HE-NSS\xa0%d'.format(nss);
+               if (he_gi) s += ', HE-GI\xa0%d'.format(he_gi);
+               if (he_dcm) s += ', HE-DCM\xa0%d'.format(he_dcm);
+       }
+
        return s;
 }
 
@@ -320,7 +329,8 @@ var CBIWifiFrequencyValue = form.Value.extend({
                        this.modes = [
                                '', 'Legacy', true,
                                'n', 'N', hwmodelist.n,
-                               'ac', 'AC', hwmodelist.ac
+                               'ac', 'AC', hwmodelist.ac,
+                               'ax', 'AX', hwmodelist.ax
                        ];
 
                        var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null)
@@ -337,6 +347,12 @@ var CBIWifiFrequencyValue = form.Value.extend({
                                        'VHT40', '40 MHz', htmodelist.VHT40,
                                        'VHT80', '80 MHz', htmodelist.VHT80,
                                        'VHT160', '160 MHz', htmodelist.VHT160
+                               ],
+                               'ax': [
+                                       'HE20', '20 MHz', htmodelist.HE20,
+                                       'HE40', '40 MHz', htmodelist.HE40,
+                                       'HE80', '80 MHz', htmodelist.HE80,
+                                       'HE160', '160 MHz', htmodelist.HE160
                                ]
                        };
 
@@ -351,6 +367,10 @@ var CBIWifiFrequencyValue = form.Value.extend({
                                ],
                                'ac': [
                                        '11a', '5 GHz', true
+                               ],
+                               'ax': [
+                                       '11g', '2.4 GHz', this.channels['11g'].length > 3,
+                                       '11a', '5 GHz', this.channels['11a'].length > 3
                                ]
                        };
                }, this));