ipq806x: base-files: add support for Linksys EA8500
[openwrt/openwrt.git] / target / linux / ipq806x / base-files / etc / board.d / 02_network
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
11 board_config_update
12
13 board=$(ipq806x_board_name)
14
15 case "$board" in
16 ap148 |\
17 c2600 |\
18 d7800 |\
19 r7500)
20 ucidef_add_switch "switch0" \
21 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
22 ;;
23 db149)
24 ucidef_set_interface_lan "eth1 eth2 eth3"
25 ucidef_add_switch "switch0" \
26 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
27 ;;
28 ea8500)
29
30 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
31 ucidef_add_switch "switch0" \
32 "1:lan" "2:lan" "3:lan" "4:lan" "0t@eth0" "5:wan" "0t@eth0"
33 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
34 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
35 ;;
36 *)
37 echo "Unsupported hardware. Network interfaces not intialized"
38 ;;
39 esac
40
41 board_config_flush
42
43 exit 0