diff --git a/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua b/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua index e732f8177f..87119a900e 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua +++ b/package/mtk/applications/luci-app-mtk/luasrc/controller/mtkwifi.lua @@ -781,6 +781,8 @@ function __update_mbss_para(cfgs, vif_idx) cfgs.RRMEnable = mtkwifi.token_set(cfgs.RRMEnable, vif_idx, http.formvalue("__rrmenable") or "0") cfgs.APSDCapable = mtkwifi.token_set(cfgs.APSDCapable, vif_idx, http.formvalue("__apsd_capable") or "0") cfgs.FragThreshold = mtkwifi.token_set(cfgs.FragThreshold, vif_idx, http.formvalue("__frag_threshold") or "0") + cfgs.KickStaRssiLow = mtkwifi.token_set(cfgs.KickStaRssiLow, vif_idx, http.formvalue("__kickrssi") or "0") + cfgs.AssocReqRssiThres = mtkwifi.token_set(cfgs.AssocReqRssiThres, vif_idx, http.formvalue("__assocthres") or "0") cfgs.RTSThreshold = mtkwifi.token_set(cfgs.RTSThreshold, vif_idx, http.formvalue("__rts_threshold") or "0") cfgs.VHT_SGI = mtkwifi.token_set(cfgs.VHT_SGI, vif_idx, http.formvalue("__vht_sgi") or "0") cfgs.VHT_BW_SIGNAL = mtkwifi.token_set(cfgs.VHT_BW_SIGNAL, vif_idx, http.formvalue("__vht_bw_signal") or "0") diff --git a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm index a7c434c06d..d0bb851995 100644 --- a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm +++ b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm @@ -499,6 +499,18 @@ function hi(to, devname, vifname) + + <%:Kick STA Threshold%> (-100-0) + + + + + + <%:STA Assoc Threshold%> (-100-0) + + + + <%:VHT Short GI%> @@ -1223,6 +1235,20 @@ function hi(to, devname, vifname) document.getElementById("RTSThreshold").select(); return false; } + tmpVal = document.getElementById("KickStaRssiLow").value; + if(isNaN(tmpVal) || parseInt(tmpVal) < -100 || parseInt(tmpVal) > 0){ + alert("Kick STA Threshold is incorrect!\nPlease enter an integer number between -100 to 0 inclusive."); + document.getElementById("KickStaRssiLow").focus(); + document.getElementById("KickStaRssiLow").select(); + return false; + } + tmpVal = document.getElementById("AssocReqRssiThres").value; + if(isNaN(tmpVal) || parseInt(tmpVal) < -100 || parseInt(tmpVal) > 0){ + alert("STA Assoc Threshold is incorrect!\nPlease enter an integer number between -100 to 0 inclusive."); + document.getElementById("AssocReqRssiThres").focus(); + document.getElementById("AssocReqRssiThres").select(); + return false; + } return true; } diff --git a/package/mtk/applications/luci-app-mtk/po/zh_Hans/mtk.po b/package/mtk/applications/luci-app-mtk/po/zh_Hans/mtk.po index fb99439320..4a1c89d6ad 100644 --- a/package/mtk/applications/luci-app-mtk/po/zh_Hans/mtk.po +++ b/package/mtk/applications/luci-app-mtk/po/zh_Hans/mtk.po @@ -507,3 +507,9 @@ msgstr "启用此无线设备" msgid "Wireless device is disabled" msgstr "无线设备已禁用" + +msgid "Kick STA Threshold" +msgstr "弱信号剔除阈值" + +msgid "STA Assoc Threshold" +msgstr "弱信号接入阈值" 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 639d8f7128..431b75b60d 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 @@ -1198,6 +1198,8 @@ function mtkwifi.__setup_vifs(cfgs, devname, mainidx, subidx) vifs[j].__rrmenable = mtkwifi.token_get(cfgs.RRMEnable, j, mtkwifi.__split(cfgs.RRMEnable,";")[1]) vifs[j].__apsd_capable = mtkwifi.token_get(cfgs.APSDCapable, j, mtkwifi.__split(cfgs.APSDCapable,";")[1]) vifs[j].__frag_threshold = mtkwifi.token_get(cfgs.FragThreshold, j, mtkwifi.__split(cfgs.FragThreshold,";")[1]) + vifs[j].__kickrssi = mtkwifi.token_get(cfgs.KickStaRssiLow, j, mtkwifi.__split(cfgs.KickStaRssiLow,";")[1]) + vifs[j].__assocthres = mtkwifi.token_get(cfgs.AssocReqRssiThres, j, mtkwifi.__split(cfgs.AssocReqRssiThres,";")[1]) vifs[j].__rts_threshold = mtkwifi.token_get(cfgs.RTSThreshold, j, mtkwifi.__split(cfgs.RTSThreshold,";")[1]) vifs[j].__vht_sgi = mtkwifi.token_get(cfgs.VHT_SGI, j, mtkwifi.__split(cfgs.VHT_SGI,";")[1]) vifs[j].__vht_bw_signal = mtkwifi.token_get(cfgs.VHT_BW_SIGNAL, j, mtkwifi.__split(cfgs.VHT_BW_SIGNAL,";")[1]) diff --git a/package/mtk/drivers/wifi-profile/files/common/mtwifi.lua b/package/mtk/drivers/wifi-profile/files/common/mtwifi.lua index aacd769816..93e1c24e1c 100755 --- a/package/mtk/drivers/wifi-profile/files/common/mtwifi.lua +++ b/package/mtk/drivers/wifi-profile/files/common/mtwifi.lua @@ -105,6 +105,25 @@ function d8021xd_chk(devname, prefix, vif, enable) end end +function __exec_iwpriv_cmd(ifname, key, val) + local cmd = string.format("iwpriv %s set %s=%s", ifname, key, tostring(val)) + nixio.syslog("info", "wifi-profile: iwpriv cmd: "..cmd) + os.execute(cmd) +end + +function mtwifi_iwpriv_hook(devname) + local mtkwifi = require("mtkwifi") + local devs = mtkwifi.get_all_devs() + local dev = devs[devname] + + if dev then + for _,vif in ipairs(dev.vifs) do + __exec_iwpriv_cmd(vif.vifname, "KickStaRssiLow", vif.__kickrssi or "0") + __exec_iwpriv_cmd(vif.vifname, "AssocReqRssiThres", vif.__assocthres or "0") + end + end +end + function mtwifi_up(devname) local nixio = require("nixio") local mtkwifi = require("mtkwifi") @@ -200,6 +219,8 @@ function mtwifi_up(devname) nixio.syslog("debug", "mtwifi_up: skip "..devname..", config(l1profile) not exist") end + mtwifi_iwpriv_hook(devname) + os.execute(" rm -rf /tmp/mtk/wifi/mtwifi*.need_reload") end