aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/ase/base-files/etc/board.d/02_network
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/lantiq/ase/base-files/etc/board.d/02_network')
-rwxr-xr-xtarget/linux/lantiq/ase/base-files/etc/board.d/02_network52
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/lantiq/ase/base-files/etc/board.d/02_network b/target/linux/lantiq/ase/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..d37e999243
--- /dev/null
+++ b/target/linux/lantiq/ase/base-files/etc/board.d/02_network
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/functions/system.sh
+. /lib/functions/lantiq.sh
+
+board_config_update
+
+annex="a"
+
+lan_mac=""
+wan_mac=""
+
+board=$(board_name)
+
+case "$board" in
+allnet,all0333cj)
+ annex="b"
+ lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
+ wan_mac=$(macaddr_add "$lan_mac" 1)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+netgear,dgn1000b)
+ annex="b"
+ ucidef_set_interface_lan 'eth0'
+ ;;
+*)
+ ucidef_set_interface_lan 'eth0'
+ ;;
+esac
+
+ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \
+ ucidef_add_atm_bridge 1 32 "llc" "bridged" "dsl"
+
+if lantiq_is_vdsl_system; then
+ ucidef_add_vdsl_modem "$annex" "av"
+else
+ ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin"
+fi
+
+ucidef_set_interface_wan "dsl0" "pppoe"
+
+[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
+[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
+
+board_config_flush
+
+exit 0
+