Skip to content

Commit

Permalink
gluon-web-wifi-config: remove mesh checkbox if channel is unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Dec 30, 2024
1 parent db78fa8 commit d89e26d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local function is_disabled(config, name)
return config.disabled(false)
end

local has_client_radio = false
local has_client_only_radio = false

local function configure_ap(radio, index, config, radio_name)
local name = 'client_' .. radio_name
Expand All @@ -24,7 +24,7 @@ local function configure_ap(radio, index, config, radio_name)
local disabled = is_disabled(ap, name)

if not wireless.supports_channel(radio, config.channel()) then
has_client_radio = true
has_client_only_radio = true
end

uci:delete('wireless', name)
Expand Down Expand Up @@ -119,7 +119,7 @@ wireless.foreach_radio(uci, function(radio, index, config)
configure_owe_transition_mode(config, radio_name)
end)

if not sysconfig.gluon_version and has_client_radio then
if not sysconfig.gluon_version and has_client_only_radio then
wireless.foreach_radio(uci, function(radio, _, config)
local radio_name = radio['.name']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ uci:foreach('wireless', 'wifi-device', function(config)

vif_option('client', {'client', 'owe'}, translate('Enable client network (access point)'))

local mesh_vif = vif_option('mesh', {'mesh'}, translate("Enable mesh network (802.11s)"))
if is_5ghz then
table.insert(mesh_vifs_5ghz, mesh_vif)
-- disable setting mesh iface setting if radio does not support configured mesh channel
if wireless.supports_channel(config, tonumber(config.channel)) then
local mesh_vif = vif_option('mesh', {'mesh'}, translate("Enable mesh network (802.11s)"))

if is_5ghz then
table.insert(mesh_vifs_5ghz, mesh_vif)
end
end

local phy = wireless.find_phy(config)
Expand Down

0 comments on commit d89e26d

Please sign in to comment.