diff options
author | John Crispin <blogic@openwrt.org> | 2014-04-10 08:14:33 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-04-10 08:14:33 +0000 |
commit | c34f225392c225355a3883989c02f3a3d623f8ce (patch) | |
tree | 336be4694f42b68095ffedf62732cc1a304ce818 | |
parent | 160bef9a98c070d865f4faa9d264e89cb4a85cbd (diff) | |
download | upstream-c34f225392c225355a3883989c02f3a3d623f8ce.tar.gz upstream-c34f225392c225355a3883989c02f3a3d623f8ce.tar.bz2 upstream-c34f225392c225355a3883989c02f3a3d623f8ce.zip |
lantiq: move the dsl-modem config to network.@dsl-modem[-1]
make sure uci_defaults generates a proper uci config for the v/adsl modem
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40439 3c298f89-4303-0410-b956-a3cf2f4a3e73
3 files changed, 38 insertions, 6 deletions
diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control index d48f3f6266..e48b72b059 100644 --- a/package/network/config/ltq-adsl-app/files/dsl_control +++ b/package/network/config/ltq-adsl-app/files/dsl_control @@ -32,8 +32,8 @@ start() { local firmware local xtu config_load network - config_get annex wan annex - config_get firmware wan firmware + config_get annex dsl annex + config_get firmware dsl firmware eval "xtu=\"\${annex_$annex}\"" diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index 81db4d2641..c6be228494 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -134,10 +134,10 @@ start() { local mode config_load network - config_get tone wan tone - config_get annex wan annex - config_get firmware wan firmware - config_get xfer_mode wan xfer_mode + config_get tone dsl tone + config_get annex dsl annex + config_get firmware dsl firmware + config_get xfer_mode dsl xfer_mode [ -z "${xfer_mode}" ] && xfer_mode=ptm diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_network b/target/linux/lantiq/base-files/etc/uci-defaults/02_network index 428089ceb7..ac06e5f278 100644 --- a/target/linux/lantiq/base-files/etc/uci-defaults/02_network +++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_network @@ -28,6 +28,30 @@ set network.wan6.proto='dhcpv6' EOF } +set_adsl_modem() { + local annex=$1 + local firmware=$2 + uci batch <<EOF +set network.adsl='dsl-modem' +set network.adsl.annex='$annex' +set network.adsl.firmware='$firmware' +EOF +} + +set_vdsl_modem() { + local annex=$1 + local firmware=$2 + local tone=$3 + local xfer_mode=$4 + uci batch <<EOF +set network.vdsl='dsl-modem' +set network.vdsl.annex='$annex' +set network.vdsl.firmware='$firmware' +set network.vdsl.tone='$tone' +set network.vdsl.xfer_mode='$xfer_mode' +EOF +} + . /lib/functions/uci-defaults.sh . /lib/functions/lantiq.sh @@ -38,6 +62,7 @@ ucidef_set_interface_lan 'eth0' vpi=1 vci=32 +annex="a" encaps="llc" payload="bridged" lan_mac="" @@ -143,6 +168,13 @@ BTHOMEHUBV2B) esac [ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload" + +if [ -n "$(grep "system type.*: VR9" /proc/cpuinfo)" ]; then + set_vdsl_modem "$annex" "vdsl.bin" "bv" "ptm" +else + set_adsl_modem "$annex" "adsl.bin" +fi + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac |