3 # Copyright (C) 2011-2015 OpenWrt.org
6 .
/lib
/functions
/system.sh
7 .
/lib
/functions
/uci-defaults.sh
10 ar71xx_setup_interfaces
()
16 ucidef_add_switch
"switch0" \
17 "0@eth0" "4:lan" "5:wan"
59 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
60 ucidef_add_switch
"switch0" \
61 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
130 ucidef_set_interface_lan
"eth0"
159 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
168 ucidef_set_interface_lan
"eth0 eth1"
171 ucidef_add_switch
"switch0" \
172 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
180 rb-962uigs-5hact2hnt|\
183 ucidef_add_switch
"switch0" \
184 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
192 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
193 ucidef_add_switch
"switch0" \
194 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
200 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
201 ucidef_add_switch
"switch0" \
202 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
207 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
208 ucidef_add_switch
"switch0" \
209 "1:lan" "2:lan" "5@eth1"
214 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
215 ucidef_add_switch
"switch0" \
216 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
220 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
221 ucidef_add_switch
"switch0" \
222 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
225 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
226 ucidef_add_switch
"switch0" \
227 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
232 ucidef_set_interface_lan
"eth1"
235 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
236 ucidef_add_switch
"switch0" \
237 "0@eth1" "1:lan" "3:lan"
240 ucidef_add_switch
"switch0" \
241 "0@eth0" "3:wan" "4:lan"
244 ucidef_set_interface_lan
"eth0" "dhcp"
250 ucidef_add_switch
"switch0" \
251 "0@eth0" "5:lan" "4:wan"
254 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
255 ucidef_add_switch
"switch0" \
256 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
267 ucidef_add_switch
"switch0" \
268 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
271 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
274 ucidef_add_switch
"switch0" \
275 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
288 ucidef_add_switch
"switch0" \
289 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
292 ucidef_add_switch
"switch0" \
293 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
297 ucidef_add_switch
"switch1" \
298 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
312 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
313 ucidef_add_switch
"switch0" \
314 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
317 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
318 ucidef_add_switch
"switch0" \
319 "0@eth0" "1:lan" "2:lan" "3:lan"
325 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
326 ucidef_add_switch
"switch0" \
327 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
330 ucidef_set_interface_lan
"eth0"
331 ucidef_add_switch
"switch0" \
332 "0u@eth0" "2:lan" "3:lan" "4:lan"
333 ucidef_add_switch_attr
"switch0" "enable" "false"
336 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
337 ucidef_add_switch
"switch0" \
338 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
341 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
342 ucidef_add_switch
"switch0" \
343 "0:lan" "1:lan" "3@eth1"
350 ucidef_add_switch
"switch0" \
351 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
354 ucidef_add_switch
"switch0" \
355 "0@eth0" "1:lan" "2:lan" "3:wan"
358 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
359 ucidef_add_switch
"switch0" \
360 "0@eth0" "2:lan" "3:lan"
364 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
365 ucidef_add_switch
"switch0" \
366 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
370 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
371 ucidef_add_switch
"switch0" \
372 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
375 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
376 ucidef_add_switch
"switch0" \
377 "0@eth0" "1:lan" "5:wan" "6@eth1"
380 ucidef_add_switch
"switch0" \
381 "0@eth0" "5:lan" "1:wan"
384 ucidef_set_interface_lan
"wlan0"
387 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
388 ucidef_add_switch
"switch0" \
389 "0@eth1" "1:lan" "2:lan"
392 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
393 ucidef_add_switch
"switch0" \
394 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
397 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
398 ucidef_add_switch
"switch0" \
399 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
402 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
403 ucidef_add_switch
"switch0" \
404 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
405 ucidef_add_switch
"switch1" \
406 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
409 ucidef_set_interface_wan
"eth0"
410 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
417 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
418 ucidef_add_switch
"switch0" \
419 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
423 ucidef_add_switch
"switch0" \
424 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
427 ucidef_add_switch
"switch0" \
428 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
431 ucidef_add_switch
"switch0" \
432 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
435 ucidef_add_switch
"switch0" \
436 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
440 ucidef_set_interface_raw
"eth" "eth0"
441 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
444 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
445 ucidef_add_switch
"switch0" \
446 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
450 ucidef_add_switch
"switch0" \
451 "0@eth0" "1:lan" "2:wan"
455 ucidef_add_switch
"switch0" \
456 "0@eth0" "2:lan" "3:wan"
462 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
463 ucidef_add_switch
"switch0" \
464 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
466 ucidef_add_switch_attr
"switch0" "blinkrate" 2
467 ucidef_add_switch_port_attr
"switch0" 1 led
6
468 ucidef_add_switch_port_attr
"switch0" 2 led
9
469 ucidef_add_switch_port_attr
"switch0" 5 led
2
472 ucidef_add_switch
"switch0" \
473 "0@eth0" "3:lan" "2:wan"
476 ucidef_add_switch
"switch0" \
477 "5:lan" "1:wan" "6@eth0"
480 ucidef_add_switch
"switch0" \
481 "0@eth0" "2:lan" "3:wan"
484 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
485 ucidef_add_switch
"switch0" \
486 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
489 ucidef_add_switch
"switch0" \
490 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
493 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
494 ucidef_add_switch
"switch0" \
495 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
498 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
512 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
518 lan_mac
=$
(mtd_get_mac_binary caldata
0)
519 wan_mac
=$
(mtd_get_mac_binary caldata
6)
522 wan_mac
=$
(mtd_get_mac_binary config
0x1017c)
525 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
529 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
533 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
534 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
538 board
=$
(ar71xx_board_name
)
539 ar71xx_setup_interfaces
$board
540 ar71xx_setup_macs
$board