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"
28 ucidef_add_switch
"switch0" \
29 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
34 ucidef_add_switch
"switch0" \
35 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
39 ucidef_add_switch
"switch0" \
40 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
45 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
46 ucidef_add_switch
"switch0" \
47 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
55 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
56 ucidef_add_switch
"switch0" \
57 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
63 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
64 ucidef_add_switch
"switch0" \
65 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
69 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
70 ucidef_add_switch
"switch0" \
71 "0@eth1" "1:lan" "3:lan" # XXX: confirm cpu port!
72 ucidef_set_interface_wlan
76 ucidef_add_switch
"switch0" \
77 "0@eth0" "5:lan" "4:wan"
81 ucidef_add_switch
"switch0" \
82 "0@eth0" "4:lan" "5:wan"
92 rb-2011uas
* | rb-2011uias | rb-2011uias-2hnd
)
93 ucidef_add_switch
"switch0" \
94 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
97 ucidef_add_switch
"switch0" \
98 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
102 ucidef_add_switch
"switch1" \
103 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
108 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
109 ucidef_add_switch
"switch0" \
110 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
114 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
115 ucidef_add_switch
"switch0" \
116 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" \
117 "0@eth0" "1:wan" # XXX: confirm cpu ports!
121 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
122 ucidef_add_switch
"switch0" \
123 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
128 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
129 ucidef_add_switch
"switch0" \
130 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" \
137 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
138 ucidef_add_switch
"switch0" \
139 "1:lan" "2:lan" "5@eth1"
143 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
144 ucidef_add_switch
"switch0" \
145 "0@eth1" "1:lan" "2:lan" # XXX: confirm!
149 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
150 ucidef_add_switch
"switch0" \
151 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth1"
156 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
157 ucidef_add_switch
"switch0" \
158 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
166 ucidef_add_switch
"switch0" \
167 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
171 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
175 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
176 ucidef_add_switch
"switch0" \
177 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
178 ucidef_add_switch
"switch1" \
179 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
185 ucidef_add_switch
"switch0" \
186 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
190 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
191 ucidef_add_switch
"switch0" \
192 "0:lan" "1:lan" "3@eth1" # XXX: confirm!
196 ucidef_set_interface_wan
"eth0" "dhcp"
197 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
202 ucidef_add_switch
"switch0" \
203 "0@eth0" "1:wan" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4"
207 ucidef_add_switch
"switch0" \
208 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
212 ucidef_add_switch
"switch0" \
213 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
218 ucidef_set_interface_raw
"eth" "eth0"
219 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
237 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
238 ucidef_add_switch
"switch0" \
239 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth1" # XXX: confirm!
243 ucidef_add_switch
"switch0" \
244 "0@eth0" "1:lan" "2:wan"
248 ucidef_add_switch
"switch0" \
249 "0@eth0" "5:lan" "1:wan"
253 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
254 ucidef_add_switch
"switch0" \
255 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
259 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
260 ucidef_add_switch
"switch0" \
261 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
265 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
266 ucidef_add_switch
"switch0" \
267 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
273 ucidef_add_switch
"switch0" \
274 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
275 mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
276 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
281 ucidef_add_switch
"switch0" \
282 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
283 mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
284 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
288 ucidef_set_interface_lan
"wlan0"
295 ucidef_add_switch
"switch0" \
296 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
297 mac_lan
=$
(mtd_get_mac_binary caldata
0)
298 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr
"lan" "$mac_lan"
299 mac_wan
=$
(mtd_get_mac_binary caldata
6)
300 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr
"wan" "$mac_wan"
305 ucidef_add_switch
"switch0" \
306 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
307 mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
308 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
313 ucidef_set_interface_lan
"eth0 eth1"
317 ucidef_set_interface_lan
"eth0"
318 ucidef_add_switch
"switch0" \
319 "0@eth0" "2:lan" "3:lan" "4:lan"
320 ucidef_add_switch_attr
"switch0" "enable" "false"
373 ucidef_set_interface_lan
"eth0"
377 ucidef_set_interface_lan
"eth0" "dhcp"
383 ucidef_set_interface_lan
"eth1"
399 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
403 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
404 ucidef_add_switch
"switch0" \
405 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
409 ucidef_add_switch
"switch0" \
410 "0@eth0" "1:lan" "2:wan"
414 ucidef_add_switch
"switch0" \
415 "0@eth0" "3:lan" "2:wan"
419 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
423 ucidef_add_switch
"switch0" \
424 "5:lan" "1:wan" "6@eth0"
460 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
461 ucidef_add_switch
"switch0" \
462 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
466 ucidef_add_switch
"switch0" \
467 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
471 ucidef_add_switch
"switch0" \
472 "0@eth0" "1:lan" "2:lan" "3:wan"
476 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
477 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:lan"
481 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
482 ucidef_add_switch
"switch0" \
483 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
485 # Blinkrate: 0=43ms; 1=84ms; 2=120ms; 3=170ms; 4=340ms; 5=670ms
486 ucidef_add_switch_attr
"switch0" "blinkrate" 2
488 # Port 1 controls the GREEN configuration of LEDs for
489 # the switch and the section does not correspond to a real
492 # 0=LED off; 1=Collision/FDX; 2=Link/activity; 3=1000 Mb/s;
493 # 4=100 Mb/s; 5=10 Mb/s; 6=1000 Mb/s+activity; 7=100 Mb/s+activity;
494 # 8=10 Mb/s+activity; 9=10/100 Mb/s+activity; 10: Fiber;
495 # 11: Fault; 12: Link/activity(tx); 13: Link/activity(rx);
496 # 14: Link (master); 15: separate register
497 ucidef_add_switch_port_attr
"switch0" 1 led
6
499 # Port 2 controls the ORANGE configuration of LEDs for
500 # the switch and the section does not correspond to a real
503 # See the key above for switch port 1 for the meaning of the
504 # 'led' setting below.
505 ucidef_add_switch_port_attr
"switch0" 2 led
9
507 # Port 5 controls the configuration of the WAN LED and the
508 # section does not correspond to a real switch port.
510 # To toggle the use of green or orange LEDs for the WAN port,
511 # see the LED setting for wndr3700:green:wan in /etc/config/system.
513 # See the key above for switch port 1 for the meaning of the
514 # 'led' setting below.
515 ucidef_add_switch_port_attr
"switch0" 5 led
2
519 ucidef_set_interfaces_lan_wan
"eth0" "eth1"