lantiq: more vdsl related cleanups
[openwrt/svn-archive/archive.git] / package / network / config / ltq-adsl-app / files / dsl_control
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2012 OpenWrt.org
3
4 START=99
5
6 EXTRA_COMMANDS="status lucistat"
7 EXTRA_HELP=" status Get DSL status information
8 lucistat Get status information if lua friendly format"
9
10 SERVICE_DAEMONIZE=1
11 SERVICE_WRITE_PID=1
12
13 . /lib/functions/lantiq_dsl.sh
14
15 annex_b=10_00_10_00_00_04_00_00
16 annex_bdmt=10_00_00_00_00_00_00_00
17 annex_b2=00_00_10_00_00_00_00_00
18 annex_b2p=00_00_00_00_00_04_00_00
19 annex_a=04_01_04_00_00_01_00_00
20 annex_at1=01_00_00_00_00_00_00_00
21 annex_alite=00_01_00_00_00_00_00_00
22 annex_admt=04_00_00_00_00_00_00_00
23 annex_a2=00_00_04_00_00_00_00_00
24 annex_a2p=00_00_00_00_00_01_00_00
25 annex_l=00_00_00_00_04_00_00_00
26 annex_m=00_00_00_00_40_00_04_00
27 annex_m2=00_00_00_00_40_00_00_00
28 annex_m2p=00_00_00_00_00_00_04_00
29
30 start() {
31 local annex
32 local firmware
33 local xtu
34 config_load network
35 config_get annex dsl annex
36 config_get firmware dsl firmware
37
38 eval "xtu=\"\${annex_$annex}\""
39
40 [ -z "${firmware}" ] &&
41 firmware=/lib/firmware/adsl.bin
42 [ -f "${firmware}" ] || {
43 echo failed to find $firmware
44 return 1
45 }
46
47 service_start /sbin/dsl_cpe_control -i${xtu} \
48 -n /sbin/dsl_notify.sh \
49 -f ${firmware}
50 }
51
52 stop() {
53 DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
54 DSL_INTERFACE_STATUS="DOWN" \
55 /sbin/dsl_notify.sh
56
57 service_stop /sbin/dsl_cpe_control
58 }
59