03e0c0e16c33f43fafcbba9c5af4baf6dd73e425
[openwrt/openwrt.git] / target / linux / ipq40xx / 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 8dev,jalapeno)
16 ucidef_set_interfaces_lan_wan "eth0" "eth1"
17 ;;
18 asus,rt-ac58u)
19 CI_UBIPART=UBI_DEV
20 wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486)
21 lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102)
22 ucidef_set_interfaces_lan_wan "eth0" "eth1"
23 ucidef_add_switch "switch0" \
24 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
25 ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
26 ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
27 ;;
28 avm,fritzbox-4040)
29 ucidef_set_interfaces_lan_wan "eth0" "eth1"
30 ucidef_add_switch "switch0" \
31 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
32 ;;
33 compex,wpj428)
34 ucidef_set_interface_lan "eth0 eth1"
35 ;;
36 glinet,gl-b1300)
37 ucidef_set_interfaces_lan_wan "eth0" "eth1"
38 ucidef_add_switch "switch0" \
39 "0u@eth0" "3:lan" "4:lan"
40 ;;
41 openmesh,a42 |\
42 openmesh,a62)
43 ucidef_set_interfaces_lan_wan "eth1" "eth0"
44 ;;
45 meraki,mr33 |\
46 netgear,ex6100v2 |\
47 netgear,ex6150v2 |\
48 zyxel,wre6606)
49 ucidef_set_interface_lan "eth0"
50 ;;
51 *)
52 echo "Unsupported hardware. Network interfaces not intialized"
53 ;;
54 esac
55
56 board_config_flush
57
58 exit 0