c29beb832d3afeb49252f0da6bfe40d020082c92
[openwrt/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 lantiq_setup_interfaces()
11 {
12 local board="$1"
13
14 case "$board" in
15 arcadyan,arv4520pw)
16 ucidef_add_switch "switch0" \
17 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0"
18 ;;
19 *)
20 ucidef_set_interface_lan 'eth0'
21 ;;
22 esac
23 }
24
25 lantiq_setup_dsl()
26 {
27 local board="$1"
28 local annex="a"
29
30 case "$board" in
31 arcadyan,arv4520pw|\
32 arcadyan,arv4525pw|\
33 arcadyan,arv452cqw)
34 annex="b"
35 ;;
36 esac
37
38 lantiq_setup_dsl_helper "$annex"
39 }
40
41 lantiq_setup_macs()
42 {
43 local board="$1"
44 local lan_mac=""
45 local wan_mac=""
46
47 case "$board" in
48 esac
49
50 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
51 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
52 }
53
54 board_config_update
55 board=$(board_name)
56 lantiq_setup_interfaces $board
57 lantiq_setup_dsl $board
58 lantiq_setup_macs $board
59 board_config_flush
60
61 exit 0