lantiq: move common DSL setup into lantiq.sh
[oweals/openwrt.git] / target / linux / lantiq / xway_legacy / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2015 OpenWrt.org
4 #
5
6 . /lib/functions/uci-defaults.sh
7 . /lib/functions/system.sh
8 . /lib/functions/lantiq.sh
9
10 board_config_update
11
12 annex="a"
13
14 lan_mac=""
15 wan_mac=""
16
17 board=$(board_name)
18
19 case "$board" in
20 arcadyan,arv4520pw)
21         annex="b"
22         ucidef_add_switch "switch0" \
23                 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0"
24         ;;
25 arcadyan,arv4525pw|\
26 arcadyan,arv452cqw)
27         annex="b"
28         ucidef_set_interface_lan 'eth0'
29         ;;
30 *)
31         ucidef_set_interface_lan 'eth0'
32         ;;
33 esac
34
35 lantiq_setup_dsl_helper "$annex"
36
37 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
38 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
39
40 board_config_flush
41
42 exit 0
43