ipq806x: Sort occurrences of boardame alphabetically
[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 "0@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 qcom,ipq8064-db149)
37 ucidef_set_interface_lan "eth1 eth2 eth3"
38 ucidef_add_switch "switch0" \
39 "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
40 ;;
41 tplink,c2600)
42 ucidef_add_switch "switch0" \
43 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
44 ;;
45 zyxel,nbg6817)
46 hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
47 ucidef_add_switch "switch0" \
48 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
49 ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
50 ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
51 ;;
52 *)
53 echo "Unsupported hardware. Network interfaces not intialized"
54 ;;
55 esac
56
57 board_config_flush
58
59 exit 0