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
138 config_get tone dsl tone
139 config_get annex dsl annex
140 config_get firmware dsl firmware
141 config_get xfer_mode dsl xfer_mode
143 [ -z "${xfer_mode}" ] && xfer_mode=ptm
145 case "${xfer_mode}" in
156 eval "xtse_adsl=\"\${xtse_adsl_$annex}\""
157 [ -z "${xtse_adsl}" ] && xtse_adsl=$xtse_adsl_a
159 eval "tone_adsl=\"\${tone_adsl_$tone}\""
160 [ -z "${tone_adsl}" ] && tone_adsl=$tone_adsl_av
162 eval "tone_vdsl=\"\${tone_vdsl_$tone}\""
163 [ -z "${tone_vdsl}" ] && tone_vdsl=$tone_vdsl_av
165 [ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
166 [ -f "${firmware}" ] || {
167 echo failed to find $firmware
171 xdsl_scr adsl "${xtse_adsl}"
172 xdsl_scr vdsl "${xtse_vdsl}"
173 lowlevel_cfg "${tone_adsl}" "${tone_vdsl}"
175 service_start /sbin/vdsl_cpe_control \
176 -i `echo $xtse_adsl | sed "s/ /_/g"` \
177 -n /sbin/dsl_notify.sh \
181 -l /tmp/lowlevel.cfg \
186 DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
187 DSL_INTERFACE_STATUS="DOWN" \
190 service_stop /sbin/vdsl_cpe_control