Disable RTS by default in ath10k devices 02/11/2023 (#706)

This commit is contained in:
Tim Wilkinson 2023-02-11 11:44:10 -08:00 committed by GitHub
parent c70a23f7a8
commit 571dbf6251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 10 deletions

View File

@ -7,7 +7,7 @@ do
option enable '0'
option min_snr '15'
option margin_snr '1'
option rts_theshold '1'
option rts_threshold '1'
option min_distance '0'
option max_distance '80467'
option min_quality '50'

View File

@ -62,7 +62,7 @@ function get_config()
return {
margin = tonumber(c:get("aredn", "@lqm[0]", "margin_snr")),
low = tonumber(c:get("aredn", "@lqm[0]", "min_snr")),
rts_theshold = tonumber(c:get("aredn", "@lqm[0]", "rts_theshold") or "1"),
rts_threshold = tonumber(c:get("aredn", "@lqm[0]", "rts_threshold") or "1"),
min_distance = tonumber(c:get("aredn", "@lqm[0]", "min_distance")),
max_distance = tonumber(c:get("aredn", "@lqm[0]", "max_distance")),
auto_distance = tonumber(c:get("aredn", "@lqm[0]", "auto_distance") or "0"),
@ -227,6 +227,12 @@ function lqm()
-- Let things startup for a while before we begin
wait_for_ticks(math.max(1, 30 - nixio.sysinfo().uptime))
-- Detect ath10k - we need some special handling (for the moment)
local is_ath10k = false
if nixio.fs.stat("/sys/kernel/debug/ieee80211/" .. phy .. "/ath10k") then
is_ath10k = true
end
-- Create filters (cannot create during install as they disappear on reboot)
os.execute(NFT .. " flush chain ip fw4 input_lqm 2> /dev/null")
os.execute(NFT .. " delete chain ip fw4 input_lqm 2> /dev/null")
@ -240,7 +246,9 @@ function lqm()
-- We dont know any distances yet
os.execute(IW .. " " .. phy .. " set distance auto > /dev/null 2>&1")
-- Or any hidden nodes
os.execute(IW .. " " .. phy .. " set rts off > /dev/null 2>&1")
if not is_ath10k then
os.execute(IW .. " " .. phy .. " set rts off > /dev/null 2>&1")
end
local noise = -95
local tracker = {}
@ -887,11 +895,14 @@ function lqm()
do
hidden[#hidden + 1] = ninfo
end
if (#hidden == 0) ~= (#hidden_nodes == 0) and config.rts_theshold >= 0 and config.rts_theshold <= 2347 then
if #hidden > 0 then
os.execute(IW .. " " .. phy .. " set rts " .. config.rts_theshold .. " > /dev/null 2>&1")
else
os.execute(IW .. " " .. phy .. " set rts off > /dev/null 2>&1")
-- Don't adjust RTS on ath10k for the moment - appear to be some bug to be worked out here
if not is_ath10k then
if (#hidden == 0) ~= (#hidden_nodes == 0) and config.rts_threshold >= 0 and config.rts_threshold <= 2347 then
if #hidden > 0 then
os.execute(IW .. " " .. phy .. " set rts " .. config.rts_threshold .. " > /dev/null 2>&1")
else
os.execute(IW .. " " .. phy .. " set rts off > /dev/null 2>&1")
end
end
end
hidden_nodes = hidden

View File

@ -134,9 +134,9 @@ local settings = {
},
{
category = "Link Quality Settings",
key = "aredn.@lqm[0].rts_theshold",
key = "aredn.@lqm[0].rts_threshold",
type = "string",
desc = "<b>RTS Threshold</b> in bytes before using RTS/CTS when hidden nodes are detected<br><br><small>aredn.@lqm[0].rts_theshold</small>",
desc = "<b>RTS Threshold</b> in bytes before using RTS/CTS when hidden nodes are detected<br><br><small>aredn.@lqm[0].rts_threshold</small>",
default = "1",
condition = "lqm_enabled()"
},