From ee0dca7a23afa43a1ceef21b28bcc2d428763f4c Mon Sep 17 00:00:00 2001 From: hanwckf Date: Tue, 12 Dec 2023 17:08:18 +0800 Subject: [PATCH] mtwifi-cfg: setup apcli autoconnect in iwpriv hook func --- .../mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg | 5 +++++ package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg b/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg index f926fa4e29..4f190a59c1 100755 --- a/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg +++ b/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg @@ -229,6 +229,11 @@ function mtwifi_cfg_iwpriv_hook(cfg) for k, j in pairs(iwpriv_cfgs) do __exec_iwpriv_cmd(vif, j[1], v.config[k] or j[2]) end + if mode == "sta" then + -- setup apcli auto connect + __exec_iwpriv_cmd(vif, "ApCliEnable", "1") + __exec_iwpriv_cmd(vif, "ApCliAutoConnect", "3") + end end end end diff --git a/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh b/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh index e56ca7870e..c8cd232ad4 100755 --- a/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh +++ b/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh @@ -65,11 +65,6 @@ mtwifi_vif_sta_config() { if [ -n "$ifname" ]; then logger -t "netifd-mtwifi" "add $ifname to vifidx $name" - - # setup apcli autoconnect - iwpriv "$ifname" set ApCliEnable=1 - iwpriv "$ifname" set ApCliAutoConnect=3 - wireless_add_vif "$name" "$ifname" fi }