1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2012 OpenWrt.org
6 EXTRA_COMMANDS="status lucistat"
7 EXTRA_HELP=" status Get DSL status information
8 lucistat Get status information if lua friendly format"
13 . /lib/functions/lantiq_dsl.sh
14 XDSL_CTRL=vdsl_cpe_control
22 xtse_adsl_a="04 01 04 01 00 01 00 00"
28 xtse_adsl_b="10 00 10 00 00 04 00 00"
36 xtse_adsl_j="10 00 10 40 00 04 01 00"
38 xtse_vdsl="00 00 00 00 00 00 00 07"
41 val=`echo $2 | sed "s/ / 0x/g"`
42 echo "[WaitForConfiguration]={
43 #G997XTUSEC_g997xtusecs 0x$val
46 [WaitForLinkActivate]={
73 echo "# VRX Low Level Configuration File
75 # Parameters must be separated by tabs or spaces.
76 # Empty lines and comments will be ignored.
91 # nHsToneGroupMode nHsToneGroup_A nHsToneGroup_V nHsToneGroup_AV
93 # NA = -1 NA = -1 see see
94 # AUTO = 0 VDSL2_B43 = 0x0001 nHsToneGroup_A nHsToneGroup_A
95 # MANUAL = 1 VDSL2_A43 = 0x0002
101 # ADSL2_B43C = 0x0080
102 # ADSL2_A43C = 0x0100
104 # (dec) (hex) (hex) (hex)
112 # nUtopiaPhyAdr nUtopiaBusWidth nPosPhyParity
113 # default(16b) = 0 NA = -1
124 0" > /tmp/lowlevel.cfg
137 config_get tone dsl tone
138 config_get annex dsl annex
139 config_get firmware dsl firmware
140 config_get xfer_mode dsl xfer_mode
142 [ -z "${xfer_mode}" ] && xfer_mode=ptm
144 case "${xfer_mode}" in
155 eval "xtse_adsl=\"\${xtse_adsl_$annex}\""
156 [ -z "${xtse_adsl}" ] && xtse_adsl=$xtse_adsl_b
158 eval "tone_adsl=\"\${tone_adsl_$tone}\""
159 [ -z "${tone_adsl}" ] && tone_adsl=$tone_adsl_av
161 eval "tone_vdsl=\"\${tone_vdsl_$tone}\""
162 [ -z "${tone_vdsl}" ] && tone_vdsl=$tone_vdsl_av
164 [ -z "${firmware}" ] && firmware=vdsl.bin
166 xdsl_scr adsl "${xtse_adsl}"
167 xdsl_scr vdsl "${xtse_vdsl}"
168 lowlevel_cfg "${tone_adsl}" "${tone_vdsl}"
170 service_start /sbin/vdsl_cpe_control \
171 -i `echo $xtse_adsl | sed "s/ /_/g"` \
172 -n /sbin/dsl_notify.sh \
173 -f /lib/firmware/${firmware} \
176 -l /tmp/lowlevel.cfg \
181 DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
182 DSL_INTERFACE_STATUS="DOWN" \
185 service_stop /sbin/vdsl_cpe_control