Skip to content

Commit f9a744b

Browse files
gl-sdk4-mtk-wifi-v2: fix setup fail
When all wifi interfaces are down, then call setup wifi will olny up the wifi interface but don't set all options. Signed-off-by: Jianhui Zhao <jianhui.zhao@gl-inet.com>
1 parent 880fd01 commit f9a744b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

gl-sdk4-mtk-wifi-v2/files/mtk-wifi-configurator.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ local function netdev_is_up(ifname)
9090
return readfile(path .. '/flags', 'n') % 2 == 1
9191
end
9292

93+
local function is_all_down()
94+
for _, ifname in ipairs({'ra0', 'ra1', 'rax0', 'rax1', 'apcli0', 'apclix0'}) do
95+
if netdev_is_up(ifname) then
96+
return false
97+
end
98+
end
99+
100+
return true
101+
end
102+
93103
local function down_vif(ifname)
94104
if netdev_is_up(ifname) then
95105
log('down ', ifname)
@@ -707,6 +717,13 @@ local function main()
707717
return
708718
end
709719

720+
log('setup...', device)
721+
722+
if is_all_down() then
723+
device_configs = {}
724+
ap_configs = {}
725+
end
726+
710727
local interface_cnt = 0
711728

712729
for _ in pairs(msg.interfaces or {}) do
@@ -742,6 +759,8 @@ local function main()
742759
return
743760
end
744761

762+
log('teardown...', device)
763+
745764
teardown_pending[device] = true
746765

747766
if not teardown_tmr then

0 commit comments

Comments
 (0)