Skip to content

Commit

Permalink
use radio.band instead of hwmode
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Oct 14, 2024
1 parent b827984 commit acab455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ if not sysconfig.gluon_version and has_client_radio then

local name = 'client_' .. radio_name

if wireless.supports_channel(radio, config.channel()) and (radio.hwmode == '11a' or radio.hwmode == '11na') then
-- disable client radio on the 5GHz band which supports the mesh channel
if wireless.supports_channel(radio, config.channel()) and radio.band == '5g' then
uci:set('wireless', name, 'disabled', true)
end
end)
Expand Down
5 changes: 3 additions & 2 deletions package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local iwinfo = require 'iwinfo'
local sysconfig = require 'gluon.sysconfig'
local site = require 'gluon.site'
local util = require 'gluon.util'
Expand Down Expand Up @@ -92,9 +93,9 @@ local function get_wlan_mac_from_driver(radio, vif)
end
end

local function supports_channel(radio, channel)
function M.supports_channel(radio, channel)
local phy = M.find_phy(radio)
for i, chan in ipairs(iwinfo.nl80211.freqlist(phy)) do
for _, chan in ipairs(iwinfo.nl80211.freqlist(phy)) do
if channel == chan.channel then
return true
end
Expand Down

0 comments on commit acab455

Please sign in to comment.