ipq806x: ecw5410: use bootloader provided MAC-s
[openwrt/openwrt.git] / target / linux / ipq806x / base-files / etc / board.d / 02_network
1 #
2 # Copyright (c) 2015 The Linux Foundation. All rights reserved.
3 # Copyright (c) 2011-2015 OpenWrt.org
4 #
5
6 . /lib/functions/uci-defaults.sh
7 . /lib/functions/system.sh
8
9 board_config_update
10
11 board=$(board_name)
12
13 case "$board" in
14 askey,rt4230w-rev6 |\
15 asrock,g10 |\
16 nec,wg2600hp)
17 ucidef_add_switch "switch0" \
18 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0"
19 ;;
20 buffalo,wxr-2533dhp |\
21 compex,wpq864 |\
22 netgear,d7800 |\
23 netgear,r7500 |\
24 netgear,r7500v2 |\
25 qcom,ipq8064-ap148 |\
26 tplink,vr2600v)
27 ucidef_add_switch "switch0" \
28 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
29 ;;
30 edgecore,ecw5410)
31 ucidef_set_interfaces_lan_wan "eth1" "eth0"
32 ;;
33 linksys,ea7500-v1)
34 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
35 ucidef_add_switch "switch0" \
36 "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
37 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
38 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
39 ;;
40 linksys,ea8500)
41 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
42 ucidef_add_switch "switch0" \
43 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
44 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
45 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
46 ;;
47 nec,wg2600hp3)
48 ucidef_add_switch "switch0" \
49 "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0"
50 ;;
51 netgear,r7800 |\
52 netgear,xr500 |\
53 tplink,c2600)
54 ucidef_add_switch "switch0" \
55 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
56 ;;
57 qcom,ipq8064-ap161)
58 ucidef_set_interface_lan "eth1 eth2"
59 ucidef_add_switch "switch0" \
60 "0:lan" "1:lan" "2:lan" "3u@eth1" "6:wan" "4u@eth0"
61 ;;
62 qcom,ipq8064-db149)
63 ucidef_set_interface_lan "eth1 eth2 eth3"
64 ucidef_add_switch "switch0" \
65 "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
66 ;;
67 tplink,ad7200)
68 ucidef_add_switch "switch0" \
69 "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
70 ;;
71 ubnt,unifi-ac-hd)
72 ucidef_set_interface_lan "eth0 eth1"
73 ;;
74 zyxel,nbg6817)
75 hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
76 ucidef_add_switch "switch0" \
77 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
78 ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
79 ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
80 ;;
81 *)
82 echo "Unsupported hardware. Network interfaces not intialized"
83 ;;
84 esac
85
86 board_config_flush
87
88 exit 0