3 # Copyright (C) 2011-2015 OpenWrt.org
6 .
/lib
/functions
/system.sh
7 .
/lib
/functions
/uci-defaults.sh
12 board
=$
(ar71xx_board_name
)
22 ucidef_set_interface_lan
"eth0 eth1"
27 ucidef_add_switch
"switch0" \
28 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
33 ucidef_add_switch
"switch0" \
34 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
38 ucidef_add_switch
"switch0" \
39 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
44 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
45 ucidef_add_switch
"switch0" \
46 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
54 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
55 ucidef_add_switch
"switch0" \
56 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
62 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
63 ucidef_add_switch
"switch0" \
64 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
68 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
69 ucidef_add_switch
"switch0" \
70 "0@eth1" "1:lan" "3:lan" # XXX: confirm cpu port!
71 ucidef_set_interface_wlan
75 ucidef_add_switch
"switch0" \
76 "0@eth0" "5:lan" "4:wan"
80 ucidef_add_switch
"switch0" \
81 "0@eth0" "4:lan" "5:wan"
91 rb-2011uas
* | rb-2011uias | rb-2011uias-2hnd
)
92 ucidef_add_switch
"switch0" \
93 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
96 ucidef_add_switch
"switch0" \
97 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
101 ucidef_add_switch
"switch1" \
102 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
107 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
108 ucidef_add_switch
"switch0" \
109 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
113 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
114 ucidef_add_switch
"switch0" \
115 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" \
116 "0@eth0" "1:wan" # XXX: confirm cpu ports!
120 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
121 ucidef_add_switch
"switch0" \
122 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
127 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
128 ucidef_add_switch
"switch0" \
129 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" \
136 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
137 ucidef_add_switch
"switch0" \
138 "1:lan" "2:lan" "5@eth1"
142 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
143 ucidef_add_switch
"switch0" \
144 "0@eth1" "1:lan" "2:lan" # XXX: confirm!
148 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
149 ucidef_add_switch
"switch0" \
150 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth1"
155 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
156 ucidef_add_switch
"switch0" \
157 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
165 ucidef_add_switch
"switch0" \
166 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
170 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
174 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
175 ucidef_add_switch
"switch0" \
176 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
177 ucidef_add_switch
"switch1" \
178 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
184 ucidef_add_switch
"switch0" \
185 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
189 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
190 ucidef_add_switch
"switch0" \
191 "0:lan" "1:lan" "3@eth1" # XXX: confirm!
196 ucidef_add_switch
"switch0" \
197 "0@eth0" "1:wan" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4"
201 ucidef_add_switch
"switch0" \
202 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
206 ucidef_add_switch
"switch0" \
207 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
212 ucidef_set_interface_raw
"eth" "eth0"
213 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
230 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
231 ucidef_add_switch
"switch0" \
232 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth1" # XXX: confirm!
236 ucidef_add_switch
"switch0" \
237 "0@eth0" "1:lan" "2:wan"
241 ucidef_add_switch
"switch0" \
242 "0@eth0" "5:lan" "1:wan"
246 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
247 ucidef_add_switch
"switch0" \
248 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
252 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
253 ucidef_add_switch
"switch0" \
254 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
258 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
259 ucidef_add_switch
"switch0" \
260 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
266 ucidef_add_switch
"switch0" \
267 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
268 mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
269 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
274 ucidef_add_switch
"switch0" \
275 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
276 mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
277 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
281 ucidef_set_interface_lan
"wlan0"
288 ucidef_add_switch
"switch0" \
289 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
290 mac_lan
=$
(mtd_get_mac_binary caldata
0)
291 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr
"lan" "$mac_lan"
292 mac_wan
=$
(mtd_get_mac_binary caldata
6)
293 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr
"wan" "$mac_wan"
298 ucidef_add_switch
"switch0" \
299 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
300 mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
301 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
306 ucidef_set_interface_lan
"eth0 eth1"
310 ucidef_set_interface_lan
"eth0"
311 ucidef_add_switch
"switch0"
312 ucidef_add_switch_attr
"switch0" "reset" "false"
313 ucidef_add_switch_ports
"switch0" \
314 "0@eth0" "2:lan" "3:lan" "4:lan"
365 ucidef_set_interface_lan
"eth0"
369 ucidef_set_interface_lan
"eth0" "dhcp"
374 ucidef_set_interface_lan
"eth1"
390 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
394 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
395 ucidef_add_switch
"switch0" \
396 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
400 ucidef_add_switch
"switch0" \
401 "0@eth0" "3:lan" "2:wan"
405 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
409 ucidef_add_switch
"switch0" \
410 "5:lan" "1:wan" "6@eth0"
446 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
447 ucidef_add_switch
"switch0" \
448 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
452 ucidef_add_switch
"switch0" \
453 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
457 ucidef_add_switch
"switch0" \
458 "0@eth0" "1:lan" "2:lan" "3:wan"
462 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
463 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:lan"
467 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
468 ucidef_add_switch
"switch0" \
469 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
471 # Blinkrate: 0=43ms; 1=84ms; 2=120ms; 3=170ms; 4=340ms; 5=670ms
472 ucidef_add_switch_attr
"switch0" "blinkrate" 2
474 # Port 1 controls the GREEN configuration of LEDs for
475 # the switch and the section does not correspond to a real
478 # 0=LED off; 1=Collision/FDX; 2=Link/activity; 3=1000 Mb/s;
479 # 4=100 Mb/s; 5=10 Mb/s; 6=1000 Mb/s+activity; 7=100 Mb/s+activity;
480 # 8=10 Mb/s+activity; 9=10/100 Mb/s+activity; 10: Fiber;
481 # 11: Fault; 12: Link/activity(tx); 13: Link/activity(rx);
482 # 14: Link (master); 15: separate register
483 ucidef_add_switch_port_attr
"switch0" 1 led
6
485 # Port 2 controls the ORANGE configuration of LEDs for
486 # the switch and the section does not correspond to a real
489 # See the key above for switch port 1 for the meaning of the
490 # 'led' setting below.
491 ucidef_add_switch_port_attr
"switch0" 2 led
9
493 # Port 5 controls the configuration of the WAN LED and the
494 # section does not correspond to a real switch port.
496 # To toggle the use of green or orange LEDs for the WAN port,
497 # see the LED setting for wndr3700:green:wan in /etc/config/system.
499 # See the key above for switch port 1 for the meaning of the
500 # 'led' setting below.
501 ucidef_add_switch_port_attr
"switch0" 5 led
2
505 ucidef_set_interfaces_lan_wan
"eth0" "eth1"