2 # Copyright (c) 2015 The Linux Foundation. All rights reserved.
3 # Copyright (c) 2011-2015 OpenWrt.org
6 . /lib/functions/uci-defaults.sh
7 . /lib/functions/system.sh
9 ipq806x_setup_interfaces()
15 ucidef_set_interfaces_lan_wan "eth1" "eth2"
16 ucidef_add_switch "switch0" \
17 "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "0u@eth0"
22 ucidef_add_switch "switch0" \
23 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0"
25 buffalo,wxr-2533dhp |\
31 ucidef_add_switch "switch0" \
32 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
35 ucidef_set_interfaces_lan_wan "eth1" "eth0"
38 ucidef_add_switch "switch0" \
39 "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
42 ucidef_add_switch "switch0" \
43 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
46 ucidef_set_interface_lan "eth0"
49 ucidef_set_interfaces_lan_wan "eth0" "eth1"
52 ucidef_add_switch "switch0" \
53 "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0"
60 ucidef_add_switch "switch0" \
61 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
64 ucidef_set_interface_lan "eth1 eth2"
65 ucidef_add_switch "switch0" \
66 "0:lan" "1:lan" "2:lan" "3u@eth1" "6:wan" "4u@eth0"
69 ucidef_set_interface_lan "eth1 eth2 eth3"
70 ucidef_add_switch "switch0" \
71 "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
74 ucidef_add_switch "switch0" \
75 "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
79 ucidef_set_interfaces_lan_wan "eth1" "eth0"
80 ucidef_add_switch "switch0" \
81 "1:lan" "6@eth1" "2:wan" "0@eth0"
85 ucidef_set_interface_lan "eth0 eth1"
88 ucidef_add_switch "switch0" \
89 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
92 echo "Unsupported hardware. Network interfaces not intialized"
97 ipq806x_setup_mac_address()
103 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
104 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
105 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
108 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
109 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
110 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
113 hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
114 ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
115 ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
124 ipq806x_setup_mac_address $board
125 ipq806x_setup_interfaces $board