summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/ase/base-files/etc/board.d/02_network
blob: a088c62aa0a7b447815e6c8f96a43c127ec1a1cb (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
#
# 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
	*)
		ucidef_set_interface_lan 'eth0'
		;;
	esac
}

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

	case "$board" in
	esac

	lantiq_setup_dsl_helper "$annex"
}

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

	case "$board" in
	allnet,all0333cj)
		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
		wan_mac=$(macaddr_add "$lan_mac" 1)
		;;
	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