ltq-vdsl-app: use ubus to provide metrics
[openwrt/staging/dedeckeh.git] / package / network / config / ltq-vdsl-app / files / dsl_control
index 425208a0d0080e8947b19321d642576a6624f50b..54b739e2cd9d00eae0c6ba4b04ab362e47f36782 100644 (file)
@@ -1,15 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2012 OpenWrt.org
 
-# needs to start before the atm layer which starts at 50
-START=48
+START=97
 USE_PROCD=1
 
-EXTRA_COMMANDS="status lucistat"
-EXTRA_HELP="   status  Get DSL status information
-       lucistat  Get status information if lua friendly format"
+dslstat() {
+       ubus call dsl metrics
+}
 
-[ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
+extra_command "dslstat" "Get DSL status information"
 
 #
 # ITU-T G.997.1 (06/2012) - Section 7.3.1.1.1 (xTU transmission system enabling (XTSE))
@@ -109,7 +108,7 @@ locs 0 $1
 }
 
 [Common]={
-}" > /tmp/adsl.scr
+}" > /tmp/dsl.scr
 }
 
 lowlevel_cfg() {
@@ -253,7 +252,9 @@ start_service() {
                                fi
                                ;;
                        b*|j*)
-                               if [ -f "/lib/firmware/lantiq-vrx200-b.bin" ]; then
+                               if [ -f "/lib/firmware/vr9_dsl_fw_annex_b.bin" ]; then
+                                       firmware="/lib/firmware/vr9_dsl_fw_annex_b.bin"
+                               elif [ -f "/lib/firmware/lantiq-vrx200-b.bin" ]; then
                                        firmware="/lib/firmware/lantiq-vrx200-b.bin"
                                elif [ -f "/tmp/lantiq-vrx200-b.bin" ]; then
                                        firmware="/tmp/lantiq-vrx200-b.bin"
@@ -291,7 +292,7 @@ start_service() {
        [ -z "${snr}" ] || {
            # for SNR offset setting
            autoboot_script "$snr"
-           autoboot="-a /tmp/adsl.scr"
+           autoboot="-a /tmp/dsl.scr -A /tmp/dsl.scr"
        }
 
        procd_open_instance
@@ -307,8 +308,6 @@ start_service() {
 }
 
 stop_service() {
-       # do not use dsl_cmd to not block when this is locked up by some other proess
-       echo quit > /tmp/pipe/dsl_cpe0_cmd
        DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
        DSL_INTERFACE_STATUS="DOWN" \
                /sbin/dsl_notify.sh