1#!/bin/sh
2#
3# Copyright (c) 2015 The Linux Foundation. All rights reserved.
4# Copyright (c) 2011-2015 OpenWrt.org
5#
6
7. /lib/functions/uci-defaults.sh
8. /lib/ipq806x.sh
9. /lib/functions/system.sh
10
11board_config_update
12
13board=$(ipq806x_board_name)
14
15case "$board" in
16ap148 |\
17c2600 |\
18d7800 |\
19r7500 |\
20r7500v2 |\
21r7800)
22	ucidef_add_switch "switch0" \
23		"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
24	;;
25db149)
26	ucidef_set_interface_lan "eth1 eth2 eth3"
27	ucidef_add_switch "switch0" \
28		"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
29	;;
30ea8500)
31
32	hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
33	ucidef_add_switch "switch0" \
34		"1:lan" "2:lan" "3:lan" "4:lan" "0t@eth0" "5:wan" "0t@eth0"
35	ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
36	ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
37	;;
38*)
39	echo "Unsupported hardware. Network interfaces not intialized"
40	;;
41esac
42
43board_config_flush
44
45exit 0
46