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
77 ucidef_add_switch
"switch0" \
78 "0@eth0" "5:lan" "4:wan"
82 ucidef_add_switch
"switch0" \
83 "0@eth0" "4:lan" "5:wan"
93 rb-2011uas
* | rb-2011uias | rb-2011uias-2hnd
)
94 ucidef_add_switch
"switch0" \
95 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
98 ucidef_add_switch
"switch0" \
99 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
103 ucidef_add_switch
"switch1" \
104 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
109 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
110 ucidef_add_switch
"switch0" \
111 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
115 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
116 ucidef_add_switch
"switch0" \
117 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" \
118 "0@eth0" "1:wan" # XXX: confirm cpu ports!
122 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
123 ucidef_add_switch
"switch0" \
124 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
129 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
130 ucidef_add_switch
"switch0" \
131 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" \
138 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
139 ucidef_add_switch
"switch0" \
140 "1:lan" "2:lan" "5@eth1"
144 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
145 ucidef_add_switch
"switch0" \
146 "0@eth1" "1:lan" "2:lan" # XXX: confirm!
150 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
151 ucidef_add_switch
"switch0" \
152 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth1"
157 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
158 ucidef_add_switch
"switch0" \
159 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
167 ucidef_add_switch
"switch0" \
168 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
172 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
176 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
177 ucidef_add_switch
"switch0" \
178 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
179 ucidef_add_switch
"switch1" \
180 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
186 ucidef_add_switch
"switch0" \
187 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
191 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
192 ucidef_add_switch
"switch0" \
193 "0:lan" "1:lan" "3@eth1" # XXX: confirm!
197 ucidef_set_interface_wan
"eth0" "dhcp"
198 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
203 ucidef_add_switch
"switch0" \
204 "0@eth0" "1:wan" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4"
208 ucidef_add_switch
"switch0" \
209 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
213 ucidef_add_switch
"switch0" \
214 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
219 ucidef_set_interface_raw
"eth" "eth0"
220 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
239 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
240 ucidef_add_switch
"switch0" \
241 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth1" # XXX: confirm!
245 ucidef_add_switch
"switch0" \
246 "0@eth0" "1:lan" "2:wan"
250 ucidef_add_switch
"switch0" \
251 "0@eth0" "5:lan" "1:wan"
255 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
256 ucidef_add_switch
"switch0" \
257 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
261 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
262 ucidef_add_switch
"switch0" \
263 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
267 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
268 ucidef_add_switch
"switch0" \
269 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
275 ucidef_add_switch
"switch0" \
276 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
277 mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
278 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
283 ucidef_add_switch
"switch0" \
284 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
285 mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
286 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
290 ucidef_set_interface_lan
"wlan0"
297 ucidef_add_switch
"switch0" \
298 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
299 mac_lan
=$
(mtd_get_mac_binary caldata
0)
300 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr
"lan" "$mac_lan"
301 mac_wan
=$
(mtd_get_mac_binary caldata
6)
302 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr
"wan" "$mac_wan"
307 ucidef_add_switch
"switch0" \
308 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
309 mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
310 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
315 ucidef_set_interface_lan
"eth0 eth1"
319 ucidef_set_interface_lan
"eth0"
320 ucidef_add_switch
"switch0" \
321 "0@eth0" "2:lan" "3:lan" "4:lan"
322 ucidef_add_switch_attr
"switch0" "enable" "false"
377 ucidef_set_interface_lan
"eth0"
381 ucidef_set_interface_lan
"eth0" "dhcp"
387 ucidef_set_interface_lan
"eth1"
405 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
409 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
410 ucidef_add_switch
"switch0" \
411 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
415 ucidef_add_switch
"switch0" \
416 "0@eth0" "1:lan" "2:wan"
420 ucidef_add_switch
"switch0" \
421 "0@eth0" "3:lan" "2:wan"
425 ucidef_add_switch
"switch0" \
426 "0@eth0" "2:lan" "3:wan"
430 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
434 ucidef_add_switch
"switch0" \
435 "5:lan" "1:wan" "6@eth0"
474 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
475 ucidef_add_switch
"switch0" \
476 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
480 ucidef_add_switch
"switch0" \
481 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
485 ucidef_add_switch
"switch0" \
486 "0@eth0" "1:lan" "2:lan" "3:wan"
490 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
491 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:lan"
495 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
496 ucidef_add_switch
"switch0" \
497 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
499 # Blinkrate: 0=43ms; 1=84ms; 2=120ms; 3=170ms; 4=340ms; 5=670ms
500 ucidef_add_switch_attr
"switch0" "blinkrate" 2
502 # Port 1 controls the GREEN configuration of LEDs for
503 # the switch and the section does not correspond to a real
506 # 0=LED off; 1=Collision/FDX; 2=Link/activity; 3=1000 Mb/s;
507 # 4=100 Mb/s; 5=10 Mb/s; 6=1000 Mb/s+activity; 7=100 Mb/s+activity;
508 # 8=10 Mb/s+activity; 9=10/100 Mb/s+activity; 10: Fiber;
509 # 11: Fault; 12: Link/activity(tx); 13: Link/activity(rx);
510 # 14: Link (master); 15: separate register
511 ucidef_add_switch_port_attr
"switch0" 1 led
6
513 # Port 2 controls the ORANGE configuration of LEDs for
514 # the switch and the section does not correspond to a real
517 # See the key above for switch port 1 for the meaning of the
518 # 'led' setting below.
519 ucidef_add_switch_port_attr
"switch0" 2 led
9
521 # Port 5 controls the configuration of the WAN LED and the
522 # section does not correspond to a real switch port.
524 # To toggle the use of green or orange LEDs for the WAN port,
525 # see the LED setting for wndr3700:green:wan in /etc/config/system.
527 # See the key above for switch port 1 for the meaning of the
528 # 'led' setting below.
529 ucidef_add_switch_port_attr
"switch0" 5 led
2
533 ucidef_set_interfaces_lan_wan
"eth0" "eth1"