Skip to content
Snippets Groups Projects
Commit 427c8375 authored by Martin Weinelt's avatar Martin Weinelt Committed by Matthias Schiffer
Browse files

gluon-core: 200-wireless: upgrade 11ac radios to VHT20 (#1328)

Patch originally authored by @oleeander.

Fixes #424
parent d61f6a1e
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,8 @@ define Package/gluon-core
CATEGORY:=Gluon
TITLE:=Base files of Gluon
DEPENDS:= \
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +lua-jsonc +luci-lib-nixio \
+vxlan +odhcp6c +firewall +pretty-hostname
+gluon-site +libgluonutil +libiwinfo-lua +lua-platform-info +lua-simple-uci +lua-hash +lua-jsonc \
+luci-lib-nixio +vxlan +odhcp6c +firewall +pretty-hostname
endef
define Package/gluon-core/description
......
......@@ -3,6 +3,7 @@
local util = require 'gluon.util'
local site = require 'gluon.site'
local sysconfig = require 'gluon.sysconfig'
local iwinfo = require 'iwinfo'
local uci = require('simple-uci').cursor()
......@@ -20,6 +21,15 @@ local function get_channel(radio, config)
return channel or config.channel()
end
local function get_htmode(radio)
local phy = util.find_phy(radio)
if iwinfo.nl80211.hwmodelist(phy).ac then
return 'VHT20'
else
return 'HT20'
end
end
local function is_disabled(name)
if uci:get('wireless', name) then
return uci:get_bool('wireless', name, 'disabled')
......@@ -152,11 +162,12 @@ util.foreach_radio(uci, function(radio, index, config)
end
local channel = get_channel(radio, config)
local htmode = get_htmode(radio)
uci:delete('wireless', radio_name, 'disabled')
uci:set('wireless', radio_name, 'channel', channel)
uci:set('wireless', radio_name, 'htmode', 'HT20')
uci:set('wireless', radio_name, 'htmode', htmode)
uci:set('wireless', radio_name, 'country', site.regdom())
uci:set_list('wireless', radio_name, 'supported_rates', config.supported_rates())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment