ipq806x: mark AVM FB4040 switchport as untagged
[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/functions/system.sh
9
10 board_config_update
11
12 board=$(board_name)
13
14 case "$board" in
15 avm,fritzbox-4040)
16 ucidef_set_interfaces_lan_wan "eth0" "eth1"
17 ucidef_add_switch "switch0" \
18 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
19 ;;
20 linksys,ea8500)
21 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
22 ucidef_add_switch "switch0" \
23 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
24 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
25 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
26 ;;
27 netgear,d7800 |\
28 netgear,r7500 |\
29 netgear,r7500v2 |\
30 netgear,r7800 |\
31 qcom,ipq8064-ap148 |\
32 tplink,vr2600v)
33 ucidef_add_switch "switch0" \
34 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
35 ;;
36 openmesh,a42)
37 ucidef_set_interfaces_lan_wan "eth1" "eth0"
38 ;;
39 qcom,ipq8064-db149)
40 ucidef_set_interface_lan "eth1 eth2 eth3"
41 ucidef_add_switch "switch0" \
42 "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
43 ;;
44 tplink,c2600)
45 ucidef_add_switch "switch0" \
46 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
47 ;;
48 zyxel,nbg6817)
49 hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
50 ucidef_add_switch "switch0" \
51 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
52 ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
53 ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
54 ;;
55 *)
56 echo "Unsupported hardware. Network interfaces not intialized"
57 ;;
58 esac
59
60 board_config_flush
61
62 exit 0