1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2012 OpenWrt.org
4 # needs to start before the atm layer which starts at 50
8 EXTRA_COMMANDS="status lucistat"
9 EXTRA_HELP=" status Get DSL status information
10 lucistat Get status information if lua friendly format"
12 [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
15 # ITU-T G.997.1 (06/2012) - Section 7.3.1.1.1 (xTU transmission system enabling (XTSE))
16 # ITU-T G.997.1 Amendment 2 (04/2013) - Section 2.1 - (Vectoring mode enable (VECTORMODE_ENABLE))
19 # G.992.3 Annex A / L-US1 / L_US-2 / M
23 xtse_xdsl_a="05_00_04_00_4C_01_04_0F"
30 xtse_xdsl_b="10_00_10_00_00_04_00_0F"
39 xtse_xdsl_j="10_00_10_40_00_04_01_0F"
42 # ITU-T G.994.1 (06/2012) - Table 2 (Mandatory carrier sets)
46 tone_adsl_a="0x142" # A43C + J43 + A43
47 tone_vdsl_a="0x142" # A43C + J43 + A43
50 tone_adsl_av="0x142" # A43C + J43 + A43
51 tone_vdsl_av="0x146" # A43C + J43 + A43 + V43
54 tone_adsl_b="0x81" # B43 + B43c
55 tone_vdsl_b="0x1" # B43
58 tone_adsl_bv="0x81" # B43 + B43c
59 tone_vdsl_bv="0x5" # B43 + V43
62 echo "# VRX Low Level Configuration File
64 # Parameters must be separated by tabs or spaces.
65 # Empty lines and comments will be ignored.
80 # nHsToneGroupMode nHsToneGroup_A nHsToneGroup_V nHsToneGroup_AV
82 # NA = -1 NA = -1 see see
83 # AUTO = 0 VDSL2_B43 = 0x0001 nHsToneGroup_A nHsToneGroup_A
84 # MANUAL = 1 VDSL2_A43 = 0x0002
93 # (dec) (hex) (hex) (hex)
101 # nUtopiaPhyAdr nUtopiaBusWidth nPosPhyParity
102 # default(16b) = 0 NA = -1
113 0" > /tmp/lowlevel.cfg
117 procd_add_reload_trigger network
131 config_get tone dsl tone
132 config_get annex dsl annex
133 config_get firmware dsl firmware
134 config_get xfer_mode dsl xfer_mode
136 eval "xtse=\"\${xtse_xdsl_$annex}\""
138 [ -z "${xfer_mode}" ] && xfer_mode=ptm
140 case "${xfer_mode}" in
146 # mask out VDSL bits when ATM is requested
156 [ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
157 [ -f "${firmware}" ] || {
158 echo failed to find $firmware
162 eval "tone_adsl=\"\${tone_adsl_$tone}\""
163 eval "tone_vdsl=\"\${tone_vdsl_$tone}\""
164 [ -n "${tone_adsl}" ] && [ -n "${tone_vdsl}" ] && {
165 lowlevel_cfg "${tone_adsl}" "${tone_vdsl}"
166 lowlevel="-l /tmp/lowlevel.cfg"
170 procd_set_param command /sbin/vdsl_cpe_control_wrapper \
172 -n /sbin/dsl_notify.sh \
176 procd_append_param env "LOAD=$LOAD" "UNLOAD=$UNLOAD"
181 DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
182 DSL_INTERFACE_STATUS="DOWN" \