summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/xway_legacy/base-files/etc/board.d/02_network
blob: 7bea7e18cf397d39dfdf60426221526235f1729e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Copyright (C) 2011-2015 OpenWrt.org
#

. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
. /lib/functions/lantiq.sh

lantiq_setup_interfaces()
{
	local board="$1"

	case "$board" in
	arcadyan,arv4520pw)
		ucidef_add_switch "switch0" \
			"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0"
		;;
	*)
		ucidef_set_interface_lan 'eth0'
		;;
	esac
}

lantiq_setup_dsl()
{
	local board="$1"
	local annex="a"

	case "$board" in
	arcadyan,arv4520pw|\
	arcadyan,arv4525pw|\
	arcadyan,arv452cqw)
		annex="b"
		;;
	esac

	lantiq_setup_dsl_helper "$annex"
}

lantiq_setup_macs()
{
	local board="$1"
	local lan_mac=""
	local wan_mac=""

	case "$board" in
	esac

	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
	[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
}

board_config_update
board=$(board_name)
lantiq_setup_interfaces $board
lantiq_setup_dsl $board
lantiq_setup_macs $board
board_config_flush

exit 0