ipq40xx: add support for Linksys EA6350v3
[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 engenius,eap1300 |\
37 meraki,mr33 |\
38 netgear,ex6100v2 |\
39 netgear,ex6150v2 |\
40 zyxel,wre6606)
41 ucidef_set_interface_lan "eth0"
42 ;;
43 glinet,gl-b1300)
44 ucidef_set_interfaces_lan_wan "eth0" "eth1"
45 ucidef_add_switch "switch0" \
46 "0u@eth0" "3:lan" "4:lan"
47 ;;
48 linksys,ea6350v3)
49 wan_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
50 lan_mac_addr=$(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1)
51 ucidef_set_interfaces_lan_wan "eth0" "eth1"
52 ucidef_add_switch "switch0" \
53 "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
54 ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
55 ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
56 ;;
57 openmesh,a42 |\
58 openmesh,a62)
59 ucidef_set_interfaces_lan_wan "eth1" "eth0"
60 ;;
61 zyxel,nbg6617)
62 ucidef_set_interfaces_lan_wan "eth0" "eth1"
63 ucidef_add_switch "switch0" \
64 "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
65 ;;
66 *)
67 echo "Unsupported hardware. Network interfaces not intialized"
68 ;;
69 esac
70
71 board_config_flush
72
73 exit 0