diff --git a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_apcli.htm b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_apcli.htm index a02758fcfc..0d61238152 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_apcli.htm +++ b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_apcli.htm @@ -55,46 +55,7 @@ local cfgs = mtkwifi.load_profile(dev.profile) @@ -111,11 +72,6 @@ function hi(to, devname, vifname) ( '">Click here to apply changes) <%end%> - diff --git a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm index d683223760..a61b971501 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm +++ b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_overview.htm @@ -177,10 +177,8 @@ local chipname <% if dev.ApCliEnable ~= "1" then %> <% if dev.apcli.state == "up" then %> ')"> - <% else %> - ')"> - <% end %> ')"> + <% end %> ')"> <% else %> ')"> @@ -351,10 +349,9 @@ local chipname XHR.poll(3, "<%=luci.dispatcher.build_url("admin", "network", "wifi", "sta_info")%>/" + stainfo[i].ifname, null, function(x) { - this.idx = i; try{ //console.log(x.responseText); - response = JSON.parse(x.responseText); + var response = JSON.parse(x.responseText); for (var j=0; stainfo[j]; j++) { if (response[0].ifname == stainfo[j].ifname) { response.shift(); //delete first item diff --git a/package/mtk/applications/luci-app-mtk/root/usr/lib/lua/mtkwifi.lua b/package/mtk/applications/luci-app-mtk/root/usr/lib/lua/mtkwifi.lua index 2e9d854ad3..fb962d0ed0 100644 --- a/package/mtk/applications/luci-app-mtk/root/usr/lib/lua/mtkwifi.lua +++ b/package/mtk/applications/luci-app-mtk/root/usr/lib/lua/mtkwifi.lua @@ -509,16 +509,16 @@ local WirelessModeList = { [6] = "N in 2.4G only", [7] = "G/GN", -- i.e., no CCK mode [8] = "A/N in 5 band", - [9] = "B/G/GN mode", + [9] = "B/G/GN", -- [10] = "A/AN/G/GN mode", --not support B mode [11] = "only N in 5G band", -- [12] = "B/G/GN/A/AN/AC mixed", -- [13] = "G/GN/A/AN/AC mixed", -- no B mode [14] = "A/AC/AN mixed", [15] = "AC/AN mixed", --but no A mode - [16] = "HE_2G mode", --HE Wireless Mode - [17] = "HE_5G mode", --HE Wireless Mode - [18] = "HE_6G mode", --HE Wireless Mode + [16] = "HE_2G", --HE Wireless Mode + [17] = "HE_5G", --HE Wireless Mode + [18] = "HE_6G", --HE Wireless Mode } local DevicePropertyMap = { @@ -1447,6 +1447,11 @@ end function mtkwifi.scan_ap(vifname) + local flags = tonumber(mtkwifi.read_pipe("cat /sys/class/net/"..vifname.."/flags 2>/dev/null")) or 0 + if flags%2 ~= 1 then + os.execute("ifconfig "..vifname.." up") + end + os.execute("iwpriv "..vifname.." set SiteSurvey=0") os.execute("sleep 5") -- depends on your env local op = c_scanResult(vifname, 0) @@ -1544,6 +1549,10 @@ function mtkwifi.scan_ap(vifname) end end + if flags%2 ~= 1 then + os.execute("ifconfig "..vifname.." down") + end + return ap_list end