From ed7134fae6007713d2ea6a3b54e0f8b236d43673 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 13 Sep 2021 17:43:16 +0200 Subject: [PATCH] gluon-web-wifi-config: reuse device_uses_11a() instead of reimplementing it less efficiently --- .../gluon/config-mode/model/admin/wifi-config.lua | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua index 49580413..9915a40b 100644 --- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua +++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua @@ -24,18 +24,6 @@ local function txpower_list(phy) return new end -local function has_5ghz_radio() - local result = false - uci:foreach('wireless', 'wifi-device', function(config) - local radio = config['.name'] - local hwmode = uci:get('wireless', radio, 'hwmode') - - result = result or (hwmode == '11a' or hwmode == '11na') - end) - - return result -end - local f = Form(translate("WLAN")) f:section(Section, nil, translate( @@ -142,7 +130,7 @@ uci:foreach('wireless', 'wifi-device', function(config) end) -if has_5ghz_radio() and not wireless.preserve_channels(uci) then +if wireless.device_uses_11a(uci) and not wireless.preserve_channels(uci) then local r = f:section(Section, translate("Outdoor Installation"), translate( "Configuring the node for outdoor use tunes the 5 GHz radio to a frequency " .. "and transmission power that conforms with the local regulatory requirements. "