[OpenWrt-Devel] [PATCH 1/2] lantiq: add the current profile to the stats output

Mathias Kresin openwrt at kresin.me
Tue Dec 29 15:59:13 EST 2015


Signed-off-by: Mathias Kresin <openwrt at kresin.me>
---
 .../lantiq/base-files/lib/functions/lantiq_dsl.sh  | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
index 60ace44..ec035df 100755
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -631,10 +631,40 @@ line_state() {
 	fi
 }
 
+#
+# Which profile is used?
+#
+profile() {
+	local bpstg=$(dsl_cmd bpstg)
+	local profile=$(dsl_val "$bpstg" nProfile);
+	local s;
+
+	case "$profile" in
+		"0")	s="8a" ;;
+		"1")	s="8b" ;;
+		"2")	s="8c" ;;
+		"3")	s="8d" ;;
+		"4")	s="12a" ;;
+		"5")	s="12b" ;;
+		"6")	s="17a" ;;
+		"7")	s="30a" ;;
+		"8")	s="17b" ;;
+		"")		s="";;
+		*)		s="unknown" ;;
+	esac
+
+	if [ "$action" = "lucistat" ]; then
+		echo "dsl.profile=${profile:-nil}"
+	else
+		echo "Profile:                                  $s"
+	fi
+}
+
 status() {
 	vendor
 	chipset
 	xtse
+	profile
 	line_state
 	errors
 	power_mode
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list