board.d: merge ucidef_add_switch() and ucidef_add_switch_ports()
[openwrt/openwrt.git] / target / linux / mvebu / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2014-2015 OpenWrt.org
4 #
5
6 . /lib/functions/uci-defaults-new.sh
7 . /lib/mvebu.sh
8
9 board_config_update
10
11 ucidef_set_interface_loopback
12
13 board=$(mvebu_board_name)
14
15 case "$board" in
16 armada-385-linksys-caiman)
17 ucidef_set_interfaces_lan_wan "eth1" "eth0"
18 ;;
19 armada-385-linksys-cobra)
20 ucidef_set_interfaces_lan_wan "eth1" "eth0"
21 ;;
22 armada-385-linksys-shelby)
23 ucidef_set_interfaces_lan_wan "eth1" "eth0"
24 ;;
25 armada-xp-linksys-mamba)
26 ucidef_set_interfaces_lan_wan "eth0" "eth1"
27 ucidef_add_switch "switch0" \
28 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
29 ;;
30 armada-385-db-ap)
31 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
32 ;;
33 armada-xp-gp)
34 ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
35 ;;
36 *)
37 ucidef_set_interface_lan "eth0"
38 ;;
39 esac
40
41 board_config_flush
42
43 exit 0