aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-01-01 21:19:27 +0000
committerJohn Crispin <blogic@openwrt.org>2016-01-01 21:19:27 +0000
commit17e9fc0f4e0bfb41aa96a794de3eba4900bcc942 (patch)
treed05b4306490cbec2b843223801bf8dae52d6b5f3 /target/linux/lantiq/base-files
parent065b3bb6edb1e5bcb9321759bb602f78a10955a4 (diff)
downloadmaster-187ad058-17e9fc0f4e0bfb41aa96a794de3eba4900bcc942.tar.gz
master-187ad058-17e9fc0f4e0bfb41aa96a794de3eba4900bcc942.tar.bz2
master-187ad058-17e9fc0f4e0bfb41aa96a794de3eba4900bcc942.zip
lantiq: convert vendorid into human readable form
Signed-off-by: Mathias Kresin <openwrt@kresin.me> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48046 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq/base-files')
-rwxr-xr-xtarget/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh67
1 files changed, 67 insertions, 0 deletions
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 ec035df374..a2723f38f8 100755
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -65,6 +65,70 @@ scale_latency() {
}
#
+# convert vendorid into human readable form
+#
+parse_vendorid() {
+ local val=$1
+ local name
+ local version
+
+ case "$val" in
+ B5,00,41,4C,43,42*)
+ name="Alcatel"
+ version=${val##*B5,00,41,4C,43,42,}
+ ;;
+ B5,00,41,4E,44,56*)
+ name="Analog Devices"
+ version=${val##*B5,00,41,4E,44,56,}
+ ;;
+ B5,00,42,44,43,4D*)
+ name="Broadcom"
+ version=${val##*B5,00,42,44,43,4D,}
+ ;;
+ B5,00,43,45,4E,54*)
+ name="Centillium"
+ version=${val##*B5,00,43,45,4E,54,}
+ ;;
+ B5,00,47,53,50,4E*)
+ name="Globespan"
+ version=${val##*B5,00,47,53,50,4E,}
+ ;;
+ B5,00,49,4B,4E,53*)
+ name="Ikanos"
+ version=${val##*B5,00,49,4B,4E,53,}
+ ;;
+ B5,00,49,46,54,4E*)
+ name="Infineon"
+ version=${val##*B5,00,49,46,54,4E,}
+ ;;
+ B5,00,54,53,54,43*)
+ name="Texas Instruments"
+ version=${val##*B5,00,54,53,54,43,}
+ ;;
+ B5,00,54,4D,4D,42*)
+ name="Thomson MultiMedia Broadband"
+ version=${val##*B5,00,54,4D,4D,42,}
+ ;;
+ B5,00,54,43,54,4E*)
+ name="Trend Chip Technologies"
+ version=${val##*B5,00,54,43,54,4E,}
+ ;;
+ B5,00,53,54,4D,49*)
+ name="ST Micro"
+ version=${val##*B5,00,53,54,4D,49,}
+ ;;
+ esac
+
+ [ -n "$name" ] && {
+ val="$name"
+
+ [ "$version" != "00,00" ] && val="$(printf "%s %d.%d" "$val" 0x${version//,/ 0x})"
+ }
+
+ echo "$val"
+}
+
+#
# Read the data rates for both directions
#
data_rates() {
@@ -133,6 +197,9 @@ vendor() {
vid=$(dsl_string "$lig" G994VendorID)
svid=$(dsl_string "$lig" SystemVendorID)
+ vid=$(parse_vendorid $vid)
+ svid=$(parse_vendorid $svid)
+
if [ "$action" = "lucistat" ]; then
echo "dsl.atuc_vendor_id=\"${vid}\""
echo "dsl.atuc_system_vendor_id=\"${svid}\""