16cc13cfc00af14c27832d9f76c000a31bb031f2
[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 r7800)
21 ucidef_add_switch "switch0" \
22 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
23 ;;
24 db149)
25 ucidef_set_interface_lan "eth1 eth2 eth3"
26 ucidef_add_switch "switch0" \
27 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
28 ;;
29 ea8500)
30
31 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
32 ucidef_add_switch "switch0" \
33 "1:lan" "2:lan" "3:lan" "4:lan" "0t@eth0" "5:wan" "0t@eth0"
34 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
35 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
36 ;;
37 *)
38 echo "Unsupported hardware. Network interfaces not intialized"
39 ;;
40 esac
41
42 board_config_flush
43
44 exit 0