Message ID | 20210709164148.48510-1-alexhenrie24@gmail.com |
---|---|
State | New |
Headers | show |
Series | [luci] luci-mod-network: wireless.js: allow changing the 60 GHz radio's frequency | expand |
Hi Alex, thank you for this patch. Based on your submission I pushed a somewhat smaller fix to LuCI master which omits the last two hunks: https://github.com/openwrt/luci/commit/e5626ece12236f6be9dbb6da6eb90fcbb469a1f0 The code related to the `hwmode` option is there for backwards compatibility reasons and should only deal with 11a and 11g. OpenWrt master uses the new `option band` to specify wireless frequency bands and that should be handled correctly already without the additional changes. ~ Jo
On Fri, Jul 9, 2021 at 1:50 PM Jo-Philipp Wich <jo@mein.io> wrote: > > Hi Alex, > > thank you for this patch. Based on your submission I pushed a somewhat > smaller fix to LuCI master which omits the last two hunks: > https://github.com/openwrt/luci/commit/e5626ece12236f6be9dbb6da6eb90fcbb469a1f0 > > The code related to the `hwmode` option is there for backwards > compatibility reasons and should only deal with 11a and 11g. > > OpenWrt master uses the new `option band` to specify wireless frequency > bands and that should be handled correctly already without the > additional changes. Thanks Jo, your commit fixed part of the problem, but the last two hunks are still needed to fix the JavaScript error. If you'd like, I can give you a TP-Link AD7200 to play around with so that you can see what's going on for yourself. -Alex
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 5115a69eb6..35d76d965b 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -327,7 +327,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ band = '5g'; else if (data[1][i].mhz >= 5925 && data[1][i].mhz <= 7125) band = '6g'; - else if (data[1][i].mhz >= 58329 && data[1][i].mhz <= 69120) + else if (data[1][i].mhz >= 58320 && data[1][i].mhz <= 69120) band = '60g'; else continue; @@ -375,7 +375,8 @@ var CBIWifiFrequencyValue = form.Value.extend({ this.bands = { '': [ '2g', '2.4 GHz', this.channels['2g'].length > 3, - '5g', '5 GHz', this.channels['5g'].length > 3 + '5g', '5 GHz', this.channels['5g'].length > 3, + '60g', '60 GHz', this.channels['60g'].length > 3 ], 'n': [ '2g', '2.4 GHz', this.channels['2g'].length > 3, @@ -465,7 +466,9 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (hwval != null) { this.useBandOption = false; - if (/a/.test(hwval)) + if (hwval == '11ad') + band.value = '60g'; + else if (/a/.test(hwval)) band.value = '5g'; else band.value = '2g'; @@ -554,7 +557,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (this.useBandOption) uci.set('wireless', section_id, 'band', value[1]); else - uci.set('wireless', section_id, 'hwmode', (value[1] == '2g') ? '11g' : '11a'); + uci.set('wireless', section_id, 'hwmode', (value[1] == '2g') ? '11g' : (value[1] == '60g') ? '11ad' : '11a'); uci.set('wireless', section_id, 'channel', value[2]); }
The text "Operating frequency" was still on the form, but there was no drop-down next to it. Also, it was only possible to edit the 60 GHz radio's settings once: After that, instead of a settings dialog, an error dialog would appear that said "TypeError: chan.options[0] is undefined". "mhz >= 58329" appears to have been a typo. The TP-Link AD7200 reports a channel at 58320 MHz, exactly where the 802.11 specification says it should be. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> --- .../luci-static/resources/view/network/wireless.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)