1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2012 OpenWrt.org
4 # needs to start before the atm layer which starts at 50
7 EXTRA_COMMANDS="status lucistat"
8 EXTRA_HELP=" status Get DSL status information
9 lucistat Get status information if lua friendly format"
14 [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
15 XDSL_CTRL=vdsl_cpe_control
23 xtse_adsl_a="04 01 04 01 00 01 00 00"
29 xtse_adsl_b="10 00 10 00 00 04 00 00"
37 xtse_adsl_j="10 00 10 40 00 04 01 00"
39 xtse_vdsl="00 00 00 00 00 00 00 07"
42 val=`echo $2 | sed "s/ / 0x/g"`
43 echo "[WaitForConfiguration]={
44 #G997XTUSEC_g997xtusecs 0x$val
47 [WaitForLinkActivate]={
74 echo "# VRX Low Level Configuration File
76 # Parameters must be separated by tabs or spaces.
77 # Empty lines and comments will be ignored.
92 # nHsToneGroupMode nHsToneGroup_A nHsToneGroup_V nHsToneGroup_AV
94 # NA = -1 NA = -1 see see
95 # AUTO = 0 VDSL2_B43 = 0x0001 nHsToneGroup_A nHsToneGroup_A
96 # MANUAL = 1 VDSL2_A43 = 0x0002
102 # ADSL2_B43C = 0x0080
103 # ADSL2_A43C = 0x0100
105 # (dec) (hex) (hex) (hex)
113 # nUtopiaPhyAdr nUtopiaBusWidth nPosPhyParity
114 # default(16b) = 0 NA = -1
125 0" > /tmp/lowlevel.cfg
139 config_get tone dsl tone
140 config_get annex dsl annex
141 config_get firmware dsl firmware
142 config_get xfer_mode dsl xfer_mode
144 [ -z "${xfer_mode}" ] && xfer_mode=ptm
146 case "${xfer_mode}" in
157 eval "xtse_adsl=\"\${xtse_adsl_$annex}\""
158 if [ "${xtse_adsl}" ]; then
161 xtse_adsl=$xtse_adsl_a
165 eval "tone_adsl=\"\${tone_adsl_$tone}\""
166 [ -z "${tone_adsl}" ] && tone_adsl=$tone_adsl_av
168 eval "tone_vdsl=\"\${tone_vdsl_$tone}\""
169 [ -z "${tone_vdsl}" ] && tone_vdsl=$tone_vdsl_av
171 [ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
172 [ -f "${firmware}" ] || {
173 echo failed to find $firmware
177 xdsl_scr adsl "${xtse_adsl}"
178 xdsl_scr vdsl "${xtse_vdsl}"
179 lowlevel_cfg "${tone_adsl}" "${tone_vdsl}"
181 service_start /sbin/vdsl_cpe_control \
182 -i `echo $xtse | sed "s/ /_/g"` \
183 -n /sbin/dsl_notify.sh \
187 -l /tmp/lowlevel.cfg \
192 DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
193 DSL_INTERFACE_STATUS="DOWN" \
196 service_stop /sbin/vdsl_cpe_control