mvebu: clearfog: assign SFP port to WAN zone
[openwrt/openwrt.git] / target / linux / mvebu / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2014-2016 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
5 #
6
7 . /lib/functions/uci-defaults.sh
8 . /lib/mvebu.sh
9
10 board_config_update
11
12 board=$(mvebu_board_name)
13
14 case "$board" in
15 armada-385-linksys-caiman|\
16 armada-385-linksys-cobra|\
17 armada-385-linksys-rango|\
18 armada-385-linksys-shelby|\
19 armada-xp-linksys-mamba)
20 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
21 ucidef_add_switch "switch0" \
22 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
23 ;;
24 armada-385-db-ap)
25 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
26 ;;
27 armada-xp-gp)
28 ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
29 ;;
30 armada-388-clearfog-*)
31 # eth0 is standalone ethernet
32 # eth1 is switch (-pro) or standalone ethernet (-base)
33 # eth2 is SFP
34 ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"
35
36 # if switch exists (clearfog-pro)
37 # switch port 5 is connected to eth1
38 swconfig list 2>&1 | grep -q switch0 && \
39 ucidef_add_switch "switch0" \
40 "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5u@eth1" "6:lan:6"
41 ;;
42 *)
43 ucidef_set_interface_lan "eth0"
44 ;;
45 esac
46
47 board_config_flush
48
49 exit 0