diff options
author | Jo-Philipp Wich <jo@mein.io> | 2024-04-21 00:57:16 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2024-04-21 00:57:16 +0200 |
commit | ea7452df5e8b755fd808bdfd51bfd95f1222368e (patch) | |
tree | 20ee275b971c14282de0edcef281d4301a7b1565 /modules/luci-mod-network/htdocs | |
parent | 744564d58cb34ac0cd78b637134eb17b09d89d26 (diff) |
luci-mod-network: wireless.js: match AP channel and htmode on join
Set a matching HT mode and channel number on joining a wireless network.
Fixes: #7066
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js | 20 |
1 files changed, 20 insertions, 0 deletions
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 7269a1fb45..97f46ec9cf 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 @@ -2030,6 +2030,26 @@ return view.extend({ uci.unset('wireless', radioDev.getName(), 'disabled'); } + var htmodes = radioDev.getHTModes(); + + if (bss.vht_operation && htmodes && htmodes.indexOf('VHT20') !== -1) { + for (var w = bss.vht_operation.channel_width; w >= 20; w /= 2) { + if (htmodes.indexOf('VHT'+w) !== -1) { + uci.set('wireless', radioDev.getName(), 'htmode', 'VHT'+w); + break; + } + } + } + else if (bss.ht_operation && htmodes && htmodes.indexOf('HT20') !== -1) { + var w = (bss.ht_operation.secondary_channel_offset == 'no secondary') ? 20 : 40; + uci.set('wireless', radioDev.getName(), 'htmode', 'HT'+w); + } + else { + uci.remove('wireless', radioDev.getName(), 'htmode'); + } + + uci.set('wireless', radioDev.getName(), 'channel', bss.channel); + section_id = next_free_sid(wifi_sections.length); uci.add('wireless', 'wifi-iface', section_id); |