add 80211v band steering setting

This commit is contained in:
padavanonly 2024-01-02 11:32:11 +08:00
parent 70d828d43b
commit 39b4276082
24 changed files with 3709 additions and 1583 deletions

View File

@ -32,6 +32,14 @@ msgstr "弱信号剔除阈值"
msgid "Station associate threshold"
msgstr "弱信号接入阈值"
msgid "802.11V roam steering threshold"
msgstr "802.11V漫游引导阈值"
msgid "802.11V roam target bssid"
msgstr "802.11V漫游引导目标BSSID"
msgid "only supports mt_wifi driver"
msgstr "仅支持MTK闭源驱动漫游域相关参数自动生成无需设置.确认路由器自身lan ip均在同一网段"

View File

@ -935,6 +935,7 @@ return view.extend({
s.addModalOptions = function(s) {
return network.getWifiNetwork(s.section).then(function(radioNet) {
var hwtype = uci.get('wireless', radioNet.getWifiDeviceName(), 'type');
var band = uci.get('wireless', radioNet.getWifiDeviceName(), 'band');
var ifmode = radioNet.getMode();
var o, ss;
@ -959,9 +960,10 @@ return view.extend({
o.inputtitle = isDisabled ? _('Enable') : _('Disable');
o.onclick = ui.createHandlerFn(s, network_updown, s.section, s.map);
o = ss.taboption('general', CBIWifiFrequencyValue, '_freq', '<br />' + _('Operating frequency'));
o.ucisection = s.section;
if (!isDisabled) {
o = ss.taboption('general', CBIWifiFrequencyValue, '_freq', '<br />' + _('Operating frequency'));
o.ucisection = s.section;
}
if (hwtype == 'mac80211') {
o = ss.taboption('general', form.Flag, 'legacy_rates', _('Allow legacy 802.11b rates'), _('Legacy or badly behaving devices may require legacy 802.11b rates to interoperate. Airtime efficiency may be significantly reduced where these are used. It is recommended to not allow 802.11b rates where possible.'));
o.depends({'_freq': '2g', '!contains': true});
@ -1008,8 +1010,10 @@ return view.extend({
o = ss.taboption('advanced', CBIWifiCountryValue, 'country', _('Country Code'));
o.wifiNetwork = radioNet;
o = ss.taboption('advanced', form.Flag, 'noscan', _('Force 40MHz mode'), _('Always use 40MHz channels even if the secondary channel overlaps. Using this option does not comply with IEEE 802.11n-2009!'));
o.depends({'_freq': '2g', '!contains': true});
if (band == '2g') {
o = ss.taboption('advanced', form.Flag, 'noscan', _('Force 40MHz mode'), _('Always use 40MHz channels even if the secondary channel overlaps. Using this option does not comply with IEEE 802.11n-2009!'));
o.rmempty = false;
}
o = ss.taboption('advanced', form.Flag, 'mu_beamformer', _('MU-MIMO'));
@ -1320,6 +1324,18 @@ return view.extend({
o.datatype = 'range(-100,0)';
o.depends('mode', 'ap');
o = ss.taboption('advanced', form.Value, 'steeringthresold', _('802.11V roam steering threshold'), _('dBm'));
o.optional = true;
o.placeholder = 0;
o.datatype = 'range(-100,0)';
o.depends('mode', 'ap');
o = ss.taboption('advanced', form.DynamicList, 'steeringbssid',_('802.11V roam target bssid'), _('MAC-List'));
o.datatype = 'macaddr';
o.optional = true;
o.placeholder = 0;
o.depends('mode', 'ap');
o = ss.taboption('advanced', form.Value, 'assocthres', _('Station associate threshold'), _('dBm'));
o.optional = true;

View File

@ -32,6 +32,12 @@ var getTCPCCAStat = rpc.declare({
expect: { '': {} }
});
var getMTKPPEStat = rpc.declare({
object: 'luci.turboacc',
method: 'getMTKPPEStat',
expect: { '': {} }
});
function getServiceStatus() {
return Promise.all([
L.resolveDefault(getFastPathStat(), {}),
@ -40,6 +46,25 @@ function getServiceStatus() {
]);
}
function getMTKPPEStatus() {
return Promise.all([
L.resolveDefault(getMTKPPEStat(), {})
]);
}
function progressbar(value, max, byte) {
var vn = parseInt(value) || 0,
mn = parseInt(max) || 100,
fv = byte ? String.format('%1024.2mB', value) : value,
fm = byte ? String.format('%1024.2mB', max) : max,
pc = Math.floor((100 / mn) * vn);
return E('div', {
'class': 'cbi-progressbar',
'title': '%s / %s (%d%%)'.format(fv, fm, pc)
}, E('div', { 'style': 'width:%.2f%%'.format(pc) }));
}
function renderStatus(stats) {
var spanTemp = '<em><span style="color:%s"><strong>%s</strong></span></em>';
var renderHTML = [];
@ -62,13 +87,15 @@ return view.extend({
load: function() {
return Promise.all([
uci.load('turboacc'),
L.resolveDefault(getSystemFeatures(), {})
L.resolveDefault(getSystemFeatures(), {}),
L.resolveDefault(getMTKPPEStat(), {})
]);
},
render: function(data) {
var m, s, o;
var features = data[1];
var ppe_stats = data[2];
m = new form.Map('turboacc', _('TurboACC settings'),
_('Open source flow offloading engine (fast path or hardware NAT).'));
@ -87,22 +114,47 @@ return view.extend({
});
});
var acc_status = E('table', { 'class': 'table', 'width': '100%', 'cellspacing': '10' }, [
E('tr', {}, [
E('td', { 'width': '33%' }, _('FastPath Engine')),
E('td', { 'id': 'fastpath_state' }, E('em', {}, _('Collecting data...')))
]),
E('tr', {}, [
E('td', { 'width': '33%' }, _('Full Cone NAT')),
E('td', { 'id': 'fullcone_state' }, E('em', {}, _('Collecting data...')))
]),
E('tr', {}, [
E('td', { 'width': '33%' }, _('TCP CCA')),
E('td', { 'id': 'tcpcca_state' }, E('em', {}, _('Collecting data...')))
])
]);
if (ppe_stats.hasOwnProperty('PPE_NUM')) {
poll.add(function () {
return L.resolveDefault(getMTKPPEStatus()).then(function (res) {
var ppe_num = parseInt(res[0].PPE_NUM);
for (var i=0; i<ppe_num; i++) {
var ppe_bar = document.getElementById(`ppe${i}_entry`);
ppe_bar.innerHTML = E('td', {},
progressbar(res[0][`BIND_PPE${i}`], res[0][`ALL_PPE${i}`])).innerHTML;
}
});
}, 3);
var ppe_num = parseInt(ppe_stats.PPE_NUM);
for (var i=0; i<ppe_num; i++) {
acc_status.appendChild(E('tr', {}, [
E('td', { 'width': '33%' }, `PPE${i} ` + _('Bind Entrys')),
E('td', {'id': `ppe${i}_entry` },
progressbar(ppe_stats[`BIND_PPE${i}`], ppe_stats[`ALL_PPE${i}`]))
]));
}
}
return E('fieldset', { 'class': 'cbi-section' }, [
E('legend', {}, _('Acceleration Status')),
E('table', { 'class': 'table', 'width': '100%', 'cellspacing': '10' }, [
E('tr', {}, [
E('td', { 'width': '33%' }, _('FastPath Engine')),
E('td', { 'id': 'fastpath_state' }, E('em', {}, _('Collecting data...')))
]),
E('tr', {}, [
E('td', { 'width': '33%' }, _('Full Cone NAT')),
E('td', { 'id': 'fullcone_state' }, E('em', {}, _('Collecting data...')))
]),
E('tr', {}, [
E('td', { 'width': '33%' }, _('TCP CCA')),
E('td', { 'id': 'tcpcca_state' }, E('em', {}, _('Collecting data...')))
])
])
acc_status
]);
}
@ -176,14 +228,23 @@ return view.extend({
o = s.option(form.Flag, 'fastpath_mh_eth_hnat_macvlan', _('Enable ethernet HNAT for MACVLAN WAN device'),
_('Enable hardware offloading for macvlan (sing wan only).'));
o.default = o.enabled;
o.default = o.disabled;
o.rmempty = false;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.Value, 'fastpath_mh_eth_hnat_bind_rate', _('HNAT bind rate threshold (pps)'),
_('The smaller the threshold, the easier it is for the connection to be accelerated.'));
o.datatype = 'and(uinteger,min(1))';
o.optional = true;
o.datatype = 'range(1,30)';
o.placeholder = 30;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.ListValue, 'fastpath_mh_eth_hnat_ppenum', _('Number of HNAT PPE'),
_('Apply this setting after reboot.'));
o.rmempty = false;
o.value(1);
o.value(2);
o.default = 1;
o.depends('fastpath_mh_eth_hnat', '1');
o = s.option(form.ListValue, 'fullcone', _('Full cone NAT'),

View File

@ -189,3 +189,11 @@ msgstr "网络加速设置"
msgid "XT_FULLCONE_NAT"
msgstr "XT_FULLCONE_NAT(更佳的兼容性)"
msgid "Apply this setting after reboot."
msgstr "重启后应用此项设置。"
msgid "Number of HNAT PPE"
msgstr "HNAT PPE数量"
msgid "Bind Entrys"
msgstr "已绑定连接数"

View File

@ -43,21 +43,23 @@ start() {
lsmod |grep -q "shortcut_fe_cm" || modprobe "shortcut_fe_cm" 2>"/dev/null"
;;
"mediatek_hnat")
local fastpath_mh_eth_hnat fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_macvlan
config_get_bool fastpath_mh_eth_hnat "config" "fastpath_mh_eth_hnat" "1"
local fastpath_mh_eth_hnat
local hnat_path="/sys/kernel/debug/hnat"
config_get_bool "fastpath_mh_eth_hnat" "config" "fastpath_mh_eth_hnat" "1"
echo "$fastpath_mh_eth_hnat" > "$hnat_path/hook_toggle"
if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then
config_get_bool fastpath_mh_eth_hnat_v6 "config" "fastpath_mh_eth_hnat_v6" "1"
local fastpath_mh_eth_hnat_v6 fastpath_mh_eth_hnat_macvlan fastpath_mh_eth_hnat_bind_rate
config_get_bool "fastpath_mh_eth_hnat_v6" "config" "fastpath_mh_eth_hnat_v6" "1"
echo "8 $fastpath_mh_eth_hnat_v6" > "$hnat_path/hnat_setting"
fi
if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then
config_get_bool fastpath_mh_eth_hnat_macvlan "config" "fastpath_mh_eth_hnat_macvlan" "1"
echo "12 $fastpath_mh_eth_hnat_macvlan" > "$hnat_path/hnat_setting"
fi
if [ "$fastpath_mh_eth_hnat" -eq "1" ]; then
config_get fastpath_mh_eth_hnat_bind_rate "config" "fastpath_mh_eth_hnat_bind_rate"
config_get "fastpath_mh_eth_hnat_bind_rate" "config" "fastpath_mh_eth_hnat_bind_rate" "30"
echo "11 $fastpath_mh_eth_hnat_bind_rate" > "$hnat_path/hnat_setting"
config_get_bool "fastpath_mh_eth_hnat_macvlan" "config" "fastpath_mh_eth_hnat_macvlan" "0"
echo "12 $fastpath_mh_eth_hnat_macvlan" > "$hnat_path/hnat_setting"
fi
;;
esac

View File

@ -20,6 +20,10 @@ if [ -e "/lib/modules/$kernel_ver/mtkhnat.ko" ]; then
uci -q set "turboacc.config.fastpath_mh_eth_hnat_v6"="1"
uci -q set "turboacc.config.fastpath_mh_eth_hnat_macvlan"="0"
uci -q set "turboacc.config.fastpath_mh_eth_hnat_bind_rate"="30"
local mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
if [ "$mem" -gt 262144 ]; then
uci -q set "turboacc.config.fastpath_mh_eth_hnat_ppenum"="2"
fi
elif [ -e "/lib/modules/$kernel_ver/fast-classifier.ko" ]; then
uci -q set "turboacc.config.fastpath"="fast_classifier"
uci -q set "turboacc.config.fastpath_fc_br"="1"

View File

@ -70,6 +70,25 @@ local methods = {
ccatype = ccatype and ccatype:upper() or nil
print(json.stringify({ type = ccatype }))
end
},
getMTKPPEStat = {
call = function()
local ppe_stat = {}
local ppe_path = "/sys/kernel/debug/hnat/hnat_stats"
local fd = io.open(ppe_path, 'r')
if fd then
for line in fd:lines() do
local i = string.find(line, "=")
if i then
ppe_stat[string.sub(line,1,i-1)] = string.sub(line,i+1)
end
end
fd:close()
end
print(json.stringify(ppe_stat))
end
}
}

View File

@ -3,7 +3,7 @@
"description": "Grant UCI access for luci-app-turboacc",
"read": {
"ubus": {
"luci.turboacc": [ "getSystemFeatures", "getFastPathStat", "getFullConeStat", "getTCPCCAStat" ]
"luci.turboacc": [ "getSystemFeatures", "getFastPathStat", "getFullConeStat", "getTCPCCAStat", "getMTKPPEStat" ]
},
"uci": [ "turboacc" ]
},

View File

@ -45,6 +45,9 @@ define Package/mtwifi-cfg/install
$(INSTALL_BIN) ./files/wapp/startwapp.sh $(1)/sbin/
$(INSTALL_BIN) ./files/wapp/bs20 $(1)/sbin/
$(INSTALL_BIN) ./files/wapp/wapp $(1)/sbin/
$(INSTALL_BIN) ./files/wapp/wappctrl $(1)/sbin/
$(INSTALL_BIN) ./files/wapp/setbssid $(1)/sbin/
$(INSTALL_BIN) ./files/wapp/steeringsta $(1)/sbin/
$(INSTALL_DATA) ./files/wapp/mapd_cfg $(1)/etc/map/
$(INSTALL_DATA) ./files/wapp/wapp_ap.conf $(1)/etc/
$(INSTALL_DATA) ./files/wapp/wapp_ap_ra0.conf $(1)/etc/

View File

@ -428,9 +428,9 @@ function mtwifi_cfg_setup(argv)
if dats.ApCliEnable == 1 then
dats.MUTxRxEnable = 3
else
dats.MUTxRxEnable = 1
dats.MUTxRxEnable = 3
end
dats.ITxBfEn = 0
dats.ITxBfEn = 1
else
dats.ETxBfEnCond = 0
dats.MUTxRxEnable = 0

View File

@ -86,6 +86,8 @@ mtwifi_defs.chip_cfgs = {
-- uci config = dat config, default value
["beacon_int"] = { "BeaconPeriod" , "100"},
["dtim_period"] = { "DtimPeriod", "1"},
["whnat"] = { "WHNAT", "1"},
["bandsteering"] = { "BandSteering", "0"},
}
mtwifi_defs.reinstall_cfgs = {
@ -97,8 +99,7 @@ mtwifi_defs.iwpriv_ap_cfgs = {
-- uci config = iwpriv set cmd , default value
["kicklow"] = {"KickStaRssiLow", "0"},
["assocthres"] = {"AssocReqRssiThres" , "0"},
["whnat"] = { "WHNAT", "1"},
["bandsteering"] = { "BandSteering", "0"},
["steeringthresold"] = {"Steeringthresold" , "0"},
}
mtwifi_defs.enc2dat = {

View File

@ -20,10 +20,10 @@ drv_mtwifi_init_device_config() {
}
drv_mtwifi_init_iface_config() {
config_add_string 'ssid:string' macfilter bssid kicklow assocthres
config_add_string 'ssid:string' macfilter bssid kicklow assocthres steeringthresold
config_add_boolean wmm hidden isolate ieee80211k ieee80211r
config_add_int wpa_group_rekey frag rts
config_add_array 'maclist:list(macaddr)'
config_add_array 'maclist:list(macaddr)' 'steeringbssid:list(macaddr)'
config_add_boolean mumimo_dl mumimo_ul ofdma_dl ofdma_ul amsdu autoba uapsd
}

View File

@ -0,0 +1,25 @@
ra0_7981_channel="$(uci get wireless.MT7981_1_1.channel)"
ra0_7986_channel="$(uci get wireless.MT7986_1_1.channel)"
rax0_7981_channel="$(uci get wireless.MT7981_1_2.channel)"
rax0_7986_channel="$(uci get wireless.MT7986_1_2.channel)"
if [ "$ra0_7981_channel" -gt "0" ];then
wappctrl ra0 mbo nebor_op_ch $ra0_7981_channel
fi
if [ "$ra0_7986_channel" -gt "0" ];then
wappctrl ra0 mbo nebor_op_ch $ra0_7986_channel
fi
if [ "$rax0_7981_channel" -gt "0" ];then
wappctrl rax0 mbo nebor_op_ch $rax0_7981_channel
fi
if [ "$rax0_7986_channel" -gt "0" ];then
wappctrl rax0 mbo nebor_op_ch $rax0_7986_channel
fi
bssid=$2
array=(${bssid//\/ })
for var in ${array[@]}
do
echo $var
wappctrl $1 mbo nebor_bssid $var
wappctrl $1 mbo add_test_nr $var
done

View File

@ -22,18 +22,29 @@ sed -i "s/map_agent_alid=.*/map_agent_alid=${agent_al_mac}/g" /etc/map/1905d.cfg
ra0=1
fi
rax0_7981="$(uci get wireless.MT7981_1_2.ieee80211r)"
rax0_7986="$(uci get wireless.MT7986_1_2.ieee80211r)"
if [ "$rax0_7981" -eq "1" ] || [ "$rax0_7986" -eq "1" ]; then
rax0=1
else
rax0=0
ra0_7981="$(uci get wireless.default_MT7981_1_2.steeringthresold)"
ra0_7986="$(uci get wireless.default_MT7981_1_2.steeringthresold)"
if [ "$ra0_7981" -lt "0" ] || [ "$ra0_7986" -lt "0" ]; then
ra0=1
fi
ra0_7981="$(uci get wireless.default_MT7981_1_1.disabled)"
ra0_7986="$(uci get wireless.default_MT7986_1_1.disabled)"
if [ "$ra0_7981" -eq "1" ] || [ "$ra0_7986" -eq "1" ]; then
ra0=0
rax0=0
fi
rax0_7981="$(uci get wireless.MT7981_1_2.ieee80211r)"
rax0_7986="$(uci get wireless.MT7986_1_2.ieee80211r)"
if [ "$rax0_7981" -eq "1" ] || [ "$rax0_7986" -eq "1" ]; then
rax0=1
fi
rax0_7981="$(uci get wireless.default_MT7981_1_2.steeringthresold)"
rax0_7986="$(uci get wireless.default_MT7986_1_2.steeringthresold)"
if [ "$rax0_7981" -lt "0" ] || [ "$rax0_7986" -lt "0" ]; then
rax0=1
fi
rax0_7981="$(uci get wireless.default_MT7981_1_2.disabled)"
@ -42,14 +53,15 @@ sed -i "s/map_agent_alid=.*/map_agent_alid=${agent_al_mac}/g" /etc/map/1905d.cfg
rax0=0
fi
if [ "$ra0" -eq "1" ] ; then
wapp -d1 -v2 -cra0 > /dev/null&
elif [ "$rax0" -eq "1" ] ; then
wapp -d1 -v2 -crax0 > /dev/null
elif [ "$rax0" -eq "1" ] && [ "$ra0" -eq "1" ] ; then
wapp -d1 -v2 -cra0 -crax0 > /dev/null&
fi
if [ "$rax0" -eq "1" ] && [ "$ra0" -eq "1" ] ; then
wapp -d1 -v2 -cra0 -crax0 > /dev/null&
elif [ "$ra0" -eq "1" ] && [ "$rax0" -eq "0" ] ; then
wapp -d1 -v2 -cra0 > /dev/null&
elif [ "$rax0" -eq "1" ] && [ "$ra0" -eq "0" ] ; then
wapp -d1 -v2 -crax0 > /dev/null
fi
sleep 1
if [ "$rax0" -eq "1" ] || [ "$ra0" -eq "1" ] ; then
iwpriv ra0 set mapR2Enable=0
iwpriv ra0 set mapTSEnable=0
@ -61,6 +73,33 @@ iwpriv rax0 set mapR3Enable=0
iwpriv rax0 set DppEnable=0
iwpriv ra0 set mapEnable=2
iwpriv rax0 set mapEnable=2
sleep 2
bs20 &
wappctrl rax0 mbo reset_default
wappctrl ra0 mbo reset_default
rax0_7981="$(uci get wireless.default_MT7981_1_2.steeringbssid)"
rax0_7986="$(uci get wireless.default_MT7986_1_2.steeringbssid)"
if [ $rax0_7981 ]; then
bash setbssid rax0 "$rax0_7981"
fi
if [ $rax0_7986 ]; then
bash setbssid rax0 "$rax0_7986"
fi
ra0_7981="$(uci get wireless.default_MT7981_1_1.steeringbssid)"
bash setbssid ra0 "$ra0_7981"
ra0_7986="$(uci get wireless.default_MT7986_1_1.steeringbssid)"
if [ $ra0_7981 ]; then
bash setbssid ra0 "$ra0_7981"
fi
if [ $ra0_7986 ]; then
bash setbssid ra0 "$ra0_7986"
fi
fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
case "$1" in
"rax0")
wappctrl rax0 mbo steer_sta $2
return 0
;;
*)
wappctrl ra0 mbo steer_sta $2
return 0
;;
esac

Binary file not shown.

View File

@ -0,0 +1,128 @@
--- a/mt_wifi/embedded/ap/ap.c 2022-11-27 21:58:55.000000000 +0800
+++ b/mt_wifi/embedded/ap/ap.c 2024-01-02 09:12:33.129403401 +0800
@@ -2892,6 +2892,11 @@
VOID MacTableMaintenance(RTMP_ADAPTER *pAd)
{
int wcid, startWcid, i;
+ char path[20]={0};
+ char arg1[6]={0};
+ char arg2[24]={0};
+ char *argv[]={path,arg1,arg2,NULL};
+ char *envp[]={NULL};
#ifdef DOT11_N_SUPPORT
BOOLEAN bRdgActive = FALSE;
BOOLEAN bRalinkBurstMode;
@@ -3963,6 +3968,24 @@
}
avgRssi = RTMPAvgRssi(pAd, &pEntry->RssiSample);
+
+ if ( pEntry->RssiSample.Rssi_Updated && pMbss->SteeringThreshold &&
+ (avgRssi < pMbss->SteeringThreshold)) {
+
+ MTWF_DBG(pAd, DBG_CAT_AP, DBG_SUBCAT_ALL, DBG_LVL_NOTICE,
+ "Steering STA "MACSTR", RSSI SteeringThreshold Thres[%d]-[%d]\n",
+ MAC2STR(pEntry->Addr), pMbss->SteeringThreshold, avgRssi);
+
+ if (WMODE_CAP_2G(pEntry->wdev->PhyMode)) {
+ snprintf(argv[0], sizeof(path), "/sbin/steeringsta");
+ snprintf(argv[1], sizeof(arg1), "ra0");
+ snprintf(argv[2], sizeof(arg2), ""MACSTR"",MAC2STR(pEntry->Addr));}
+ else {
+ snprintf(argv[0], sizeof(path), "/sbin/steeringsta");
+ snprintf(argv[1], sizeof(arg1), "rax0");
+ snprintf(argv[2], sizeof(arg2), ""MACSTR"",MAC2STR(pEntry->Addr));}
+ call_usermodehelper(path, argv, envp,UMH_NO_WAIT);
+ }
if ( pEntry->RssiSample.Rssi_Updated && pMbss->RssiLowForStaKickOut &&
(avgRssi < pMbss->RssiLowForStaKickOut)) {
@@ -3984,6 +4007,7 @@
REASON_DEAUTH_STA_LEAVING);
#endif
}
+
if (bDisconnectSta) {
/* send wireless event - for ageout */
--- a/mt_wifi/embedded/ap/ap_cfg.c 2022-11-27 21:58:55.000000000 +0800
+++ b/mt_wifi/embedded/ap/ap_cfg.c 2024-01-01 00:53:22.132505954 +0800
@@ -419,6 +419,7 @@
INT Set_AP_ASSOC_REQ_RSSI_THRESHOLD(RTMP_ADAPTER *pAd, RTMP_STRING *arg);
INT Set_AP_KickStaRssiLow_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg);
+INT Set_AP_SteeringThreshold_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg);
INT Set_BasicRate_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg);
@@ -1251,6 +1252,7 @@
#endif /* SPECIFIC_TX_POWER_SUPPORT */
{"AssocReqRssiThres", Set_AP_ASSOC_REQ_RSSI_THRESHOLD},
{"KickStaRssiLow", Set_AP_KickStaRssiLow_Proc},
+ {"Steeringthresold", Set_AP_SteeringThreshold_Proc},
{"PtkRekey", Set_PtkRekey_Proc},
#ifdef OCE_SUPPORT
{"OceRssiThreshold", Set_OceRssiThreshold_Proc},
@@ -14528,6 +14530,16 @@
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
+
+/*
+ ==========================================================================
+ Description:
+ Set lower limit for AP steering a STA.
+ Return:
+ TRUE if all parameters are OK, FALSE otherwise
+ ==========================================================================
+*/
+
INT Set_AP_KickStaRssiLow_Proc(
IN PRTMP_ADAPTER pAd,
IN RTMP_STRING *arg)
@@ -14555,6 +14567,35 @@
return TRUE;
}
+
+
+INT Set_AP_SteeringThreshold_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN RTMP_STRING *arg)
+{
+ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+ UCHAR apidx = pObj->ioctl_if;
+ UINT j;
+ CHAR rssi;
+
+ rssi = os_str_tol(arg, 0, 10);
+
+ if (rssi == 0)
+ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "Disable SteeringThreshold Function\n");
+ else if (rssi > 0 || rssi < -100) {
+ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "SteeringThreshold Value Error.\n");
+ return FALSE;
+ }
+
+ pAd->ApCfg.MBSSID[apidx].SteeringThreshold = rssi;
+ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "I/F(ra%d) SteeringThreshold=%d\n", apidx,
+ pAd->ApCfg.MBSSID[apidx].SteeringThreshold);
+
+ for (j = BSS0; j < pAd->ApCfg.BssidNum; j++)
+ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "%d. ==> %d\n", j, pAd->ApCfg.MBSSID[j].SteeringThreshold);
+
+ return TRUE;
+}
/*
==========================================================================
--- a/mt_wifi/embedded/include/rtmp.h 2022-11-27 21:58:55.000000000 +0800
+++ b/mt_wifi/embedded/include/rtmp.h 2024-01-01 01:04:57.047724405 +0800
@@ -2971,6 +2971,7 @@
/* YF@20120417: Avoid connecting to AP in Poor Env, value 0 fOr disable. */
CHAR AssocReqRssiThreshold;
CHAR RssiLowForStaKickOut;
+ CHAR SteeringThreshold;
#ifdef CUSTOMER_VENDOR_IE_SUPPORT
/*For AP vendor ie*/

View File

@ -620,6 +620,9 @@ static int mtk_get_freqlist(const char *dev, char *buf, int *len)
if (!ifname)
return -1;
if (!mtk_is_ifup(ifname))
return -1;
wrq.u.data.pointer = (caddr_t) &range;
wrq.u.data.length = sizeof(struct iw_range);
wrq.u.data.flags = 0;
@ -687,15 +690,36 @@ static int mtk_get_hwmodelist(const char *dev, int *buf)
const char *ifname;
char chans[IWINFO_BUFSIZE] = { 0 };
struct iwinfo_freqlist_entry *e = NULL;
struct uci_section *s;
const char* band = NULL;
int len = 0;
*buf = 0;
/* get hwmode base on uci band config */
s = iwinfo_uci_get_radio(dev, "mtwifi");
if (!s)
goto uciout;
band = uci_lookup_option_string(uci_ctx, s, "band");
uciout:
iwinfo_uci_free();
if (band) {
if (!strcmp(band,"2g"))
*buf = (IWINFO_80211_N | IWINFO_80211_AX);
else if (!strcmp(band,"5g"))
*buf = (IWINFO_80211_AC | IWINFO_80211_AX);
return 0;
}
/* get hwmode base on iwrange */
ifname = mtk_dev2phy(dev);
if (!ifname)
return -1;
*buf = 0;
if (!mtk_get_freqlist(ifname, chans, &len) )
if (!mtk_get_freqlist(ifname, chans, &len))
{
for (e = (struct iwinfo_freqlist_entry *)chans; e->channel; e++ )
{
@ -720,15 +744,37 @@ static int mtk_get_htmodelist(const char *dev, int *buf)
const char *ifname;
char chans[IWINFO_BUFSIZE] = { 0 };
struct iwinfo_freqlist_entry *e = NULL;
struct uci_section *s;
const char* band = NULL;
int len = 0;
*buf = 0;
/* get htmode base on uci band config */
s = iwinfo_uci_get_radio(dev, "mtwifi");
if (!s)
goto uciout;
band = uci_lookup_option_string(uci_ctx, s, "band");
uciout:
iwinfo_uci_free();
if (band) {
if (!strcmp(band,"2g"))
*buf = (IWINFO_HTMODE_HT20 | IWINFO_HTMODE_HT40 | IWINFO_HTMODE_HE20 | IWINFO_HTMODE_HE40);
else if (!strcmp(band,"5g"))
*buf = (IWINFO_HTMODE_VHT20 | IWINFO_HTMODE_VHT40 | IWINFO_HTMODE_VHT80 | IWINFO_HTMODE_VHT160
| IWINFO_HTMODE_HE20 | IWINFO_HTMODE_HE40 | IWINFO_HTMODE_HE80 | IWINFO_HTMODE_HE160);
return 0;
}
/* get htmode base on iwrange */
ifname = mtk_dev2phy(dev);
if (!ifname)
return -1;
*buf = 0;
if (!mtk_get_freqlist(ifname, chans, &len) )
if (!mtk_get_freqlist(ifname, chans, &len))
{
for (e = (struct iwinfo_freqlist_entry *)chans; e->channel; e++ )
{

3230
scripts/log.txt Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
do_setup_ppenum() {
if [ -f "/etc/modules.d/20-mediatek_hnat" ]; then
PPE_NUM="$(uci -q get turboacc.config.fastpath_mh_eth_hnat_ppenum)"
echo "mtkhnat ppe_cnt=${PPE_NUM:-1}" > /etc/modules.d/20-mediatek_hnat
fi
}
boot_hook_add preinit_main do_setup_ppenum

View File

@ -732,12 +732,8 @@ static int hnat_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "wan dsa port = %d\n", hnat_priv->wan_dsa_port);
}
err = of_property_read_u32_index(np, "mtketh-ppe-num", 0, &val);
if (err < 0)
hnat_priv->ppe_num = ppe_cnt;
else
hnat_priv->ppe_num = val;
hnat_priv->ppe_num = ppe_cnt;
dev_info(&pdev->dev, "ppe num = %d\n", hnat_priv->ppe_num);

View File

@ -1436,6 +1436,30 @@ int __hnat_entry_read(struct seq_file *m, void *private, u32 ppe_id)
return 0;
}
static int hnat_stats_read(struct seq_file *m, void *private)
{
struct mtk_hnat *h = hnat_priv;
struct foe_entry *entry, *end;
int cnt, i;
seq_printf(m, "PPE_NUM=%d\n", CFG_PPE_NUM);
for (i = 0; i < CFG_PPE_NUM; i++) {
cnt = 0;
entry = h->foe_table_cpu[i];
end = h->foe_table_cpu[i] + hnat_priv->foe_etry_num;
while (entry < end) {
if (entry->bfib1.state == dbg_entry_state)
cnt++;
entry++;
}
seq_printf(m, "ALL_PPE%d=%d\n", i, hnat_priv->foe_etry_num);
seq_printf(m, "BIND_PPE%d=%d\n", i, cnt);
}
return 0;
}
int hnat_entry_read(struct seq_file *m, void *private)
{
int i;
@ -1512,6 +1536,18 @@ static const struct file_operations hnat_entry_fops = {
.release = single_release,
};
static int hnat_stats_open(struct inode *inode, struct file *file)
{
return single_open(file, hnat_stats_read, file->private_data);
}
static const struct file_operations hnat_stats_fops = {
.open = hnat_stats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
int __hnat_setting_read(struct seq_file *m, void *private, u32 ppe_id)
{
struct mtk_hnat *h = hnat_priv;
@ -2421,6 +2457,8 @@ int hnat_init_debugfs(struct mtk_hnat *h)
&cpu_reason_fops);
debugfs_create_file("hnat_entry", S_IRUGO | S_IRUGO, root, h,
&hnat_entry_fops);
debugfs_create_file("hnat_stats", S_IRUGO | S_IRUGO, root, h,
&hnat_stats_fops);
debugfs_create_file("hnat_setting", S_IRUGO | S_IRUGO, root, h,
&hnat_setting_fops);
debugfs_create_file("mcast_table", S_IRUGO | S_IRUGO, root, h,