diff --git a/luci-base/po/zh_Hans/base.po b/luci-base/po/zh_Hans/base.po index 4255a821b..c5e4f4c3c 100644 --- a/luci-base/po/zh_Hans/base.po +++ b/luci-base/po/zh_Hans/base.po @@ -14228,3 +14228,9 @@ msgstr "目标唤醒时间(TWT)" msgid "MU-MIMO" msgstr "多用户 MIMO(MU-MIMO)" + +msgid "Enable CSA" +msgstr "启用 CSA" + +msgid "Announce channel switches to clients. Automatic channel selection remains available when disabled." +msgstr "向客户端通告信道切换。关闭后仍可自动选择信道。" diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 1f4b08cdc..85329d7bb 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -523,7 +523,7 @@ function formatConfigEncryption(enc) { } // Keep an incompatible saved value visible as invalid, never silently replace it. -function restrictQca6GHzChoices(option, getBand, allowed, message) { +function restrict6GHzChoices(option, getBand, allowed, message) { let widget, section; const update = function() { if (!widget) @@ -2034,7 +2034,11 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (Number.isInteger(vals?.selected)) sel.selectedIndex = vals.selected; - sel.parentNode.style.display = (sel.options.length <= (sel.classList.contains('band') ? 0 : 1)) ? 'none' : ''; + const showFixedWidth = this.hwtype == 'mt_dbdc' && + sel.classList.contains('htmode') && sel.options.length == 1 && + sel.options[0].value == 'EHT320'; + const minOptions = (sel.classList.contains('band') || showFixedWidth) ? 0 : 1; + sel.parentNode.style.display = sel.options.length <= minOptions ? 'none' : ''; sel.vals = vals; }, @@ -2120,6 +2124,10 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (bandName == '2g' && /(80_80|80|160|320)/.test(valueName)) meta.available = false; + if (this.hwtype == 'mt_dbdc' && bandName == '6g' && + /^EHT/.test(valueName) && valueName != 'EHT320') + meta.available = false; + if (bandName != '6g' && /320/.test(valueName)) meta.available = false; @@ -2371,6 +2379,13 @@ var CBIWifiFrequencyValue = form.Value.extend({ ]; }, + validate: function(section_id, value) { + if (this.hwtype == 'mt_dbdc' && value && value[2] == '6g' && + value[0] == 'be' && value[1] != 'EHT320') + return _('This 6 GHz Wi-Fi 7 profile requires 320 MHz.'); + return true; + }, + write: function(section_id, value) { const config_name = this.uciconfig ?? this.section.uciconfig ?? this.map.config; const config_section = this.getDeviceSection(section_id); @@ -2978,6 +2993,12 @@ return view.extend({ o.default = o.enabled; o.rmempty = false; + o = ss.taboption('advanced', form.Flag, 'csa', _('Enable CSA'), _('Announce channel switches to clients. Automatic channel selection remains available when disabled.')); + o.depends({ '_freq': '6g', '!contains': true }); + o.ucisection = radioNet.getWifiDeviceName(); + o.default = o.disabled; + o.rmempty = false; + o = ss.taboption('advanced', form.Flag, 'mu_beamformer', _('MU-MIMO')); if (uci.get('wireless', radioNet.getWifiDeviceName(), 'dbdc_main') == '1') { @@ -3348,6 +3369,9 @@ return view.extend({ if ((e == 'sae' || e == 'sae-mixed') && (!c || c == 'auto')) c = 'ccmp'; + if (hwtype == 'mt_dbdc' && getSecurityBand() == '6g') + uci.set('wireless', section_id, 'ieee80211w', '2'); + if (isQcaWifiHwtype(hwtype)) { if (e == 'owe') { stored_e = 'ccmp'; @@ -3584,11 +3608,13 @@ return view.extend({ encr.value(crypto_mode[0], '%s (%s)'.format(crypto_mode[1], security_level)); }); - if (isQcaWifiHwtype(hwtype)) { - const updateEncryption = restrictQca6GHzChoices(encr, getSecurityBand, - ['sae', 'owe'], _('6 GHz requires WPA3-SAE or OWE.')); - const updateCipher = restrictQca6GHzChoices(cipherOption, getSecurityBand, - ['auto', 'ccmp', 'ccmp256', 'gcmp', 'gcmp256'], _('TKIP is not supported on 6 GHz.')); + if (isQcaWifiHwtype(hwtype) || hwtype == 'mt_dbdc') { + const updateEncryption = restrict6GHzChoices(encr, getSecurityBand, + ['sae', 'owe'], + _('6 GHz requires WPA3-SAE or OWE.')); + const updateCipher = restrict6GHzChoices(cipherOption, getSecurityBand, + hwtype == 'mt_dbdc' ? ['auto', 'ccmp'] : ['auto', 'ccmp', 'ccmp256', 'gcmp', 'gcmp256'], + hwtype == 'mt_dbdc' ? _('This 6 GHz profile requires CCMP (AES).') : _('TKIP is not supported on 6 GHz.')); frequencyOption.onBandChange = function() { updateEncryption(); updateCipher();