mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
dslmngr: airoha: Fix QoS uplink bandwidth monitor.
This commit is contained in:
parent
90f13664e9
commit
991657fc99
1 changed files with 28 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ source "/lib/functions/network.sh"
|
||||||
source "/lib/functions/system.sh"
|
source "/lib/functions/system.sh"
|
||||||
|
|
||||||
PREVLINK=""
|
PREVLINK=""
|
||||||
|
LINK=""
|
||||||
|
LINKSPEED=""
|
||||||
PREVWANMODE=""
|
PREVWANMODE=""
|
||||||
WANMODE=""
|
WANMODE=""
|
||||||
CONFIGURED=0
|
CONFIGURED=0
|
||||||
|
|
@ -150,6 +152,12 @@ while [ true ]; do
|
||||||
|
|
||||||
if [ "$LINK" != "$PREVLINK" -a \( "$LINK" = "down" -o "$LINK" = "up" \) ]; then
|
if [ "$LINK" != "$PREVLINK" -a \( "$LINK" = "down" -o "$LINK" = "up" \) ]; then
|
||||||
if [ "$LINK" = "down" ]; then
|
if [ "$LINK" = "down" ]; then
|
||||||
|
if [ ! -s /tmp/qos/wan_link_shape_rate ]; then
|
||||||
|
rm -rf /tmp/qos/wan_link_shape_rate
|
||||||
|
rm -rf /tmp/qos/wan_link_speed
|
||||||
|
/usr/sbin/qos-uplink-bandwidth
|
||||||
|
fi
|
||||||
|
|
||||||
[ "$CONFIGURED" -eq 0 ] && configure_lines # Needs to be done once the slave SoC is in down state and we've not been able to auto-sync.
|
[ "$CONFIGURED" -eq 0 ] && configure_lines # Needs to be done once the slave SoC is in down state and we've not been able to auto-sync.
|
||||||
if [ -n "$WANMODE" ]; then
|
if [ -n "$WANMODE" ]; then
|
||||||
if [ "$WANMODE" = "PTM" ]; then
|
if [ "$WANMODE" = "PTM" ]; then
|
||||||
|
|
@ -226,6 +234,26 @@ while [ true ]; do
|
||||||
|
|
||||||
call_wan_hotplug "up" "$WANPORT"
|
call_wan_hotplug "up" "$WANPORT"
|
||||||
PREVWANMODE="$WANMODE"
|
PREVWANMODE="$WANMODE"
|
||||||
|
|
||||||
|
if [ ! -s /tmp/qos/wan_link_shape_rate ]; then
|
||||||
|
LINKSPEED="$(awk '/far-end interleaved channel bit rate/{print $6}' /proc/tc3162/adsl_stats)"
|
||||||
|
LINKSPEED=$((LINKSPEED))
|
||||||
|
if [ "$LINKSPEED" -eq 0 ]; then
|
||||||
|
LINKSPEED="$(awk '/far-end fast channel bit rate/{print $6}' /proc/tc3162/adsl_stats)"
|
||||||
|
LINKSPEED=$((LINKSPEED))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$LINKSPEED" -ne 0 ]; then
|
||||||
|
mkdir -p /tmp/qos
|
||||||
|
touch /tmp/qos/wan_link_shape_rate
|
||||||
|
|
||||||
|
/userfs/bin/qosrule discpline Rate uplink-bandwidth ${LINKSPEED}
|
||||||
|
hw_nat -! > /dev/null 2>&1
|
||||||
|
else
|
||||||
|
rm -rf /tmp/qos/wan_link_speed
|
||||||
|
/usr/sbin/qos-uplink-bandwidth
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Toggle link state
|
# Toggle link state
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue