3 # Copyright (C) 2011-2015 OpenWrt.org
6 .
/lib
/functions
/system.sh
7 .
/lib
/functions
/uci-defaults.sh
9 ar71xx_setup_interfaces
()
15 ucidef_add_switch
"switch0" \
16 "0@eth0" "4:lan" "5:wan"
58 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
59 ucidef_add_switch
"switch0" \
60 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
152 wifi-pineapple-nano|\
155 ucidef_set_interface_lan
"eth0"
181 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
188 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
189 ucidef_add_switch
"switch0" \
190 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
199 ucidef_set_interface_lan
"eth0 eth1"
202 ucidef_add_switch
"switch0" \
203 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
211 rb-962uigs-5hact2hnt|\
214 ucidef_add_switch
"switch0" \
215 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
223 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
224 ucidef_add_switch
"switch0" \
225 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
231 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
232 ucidef_add_switch
"switch0" \
233 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
238 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
239 ucidef_add_switch
"switch0" \
240 "1:lan" "2:lan" "5@eth1"
245 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
246 ucidef_add_switch
"switch0" \
247 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
254 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
255 ucidef_add_switch
"switch0" \
256 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
260 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
261 ucidef_add_switch
"switch0" \
262 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
267 ucidef_set_interface_lan
"eth1"
270 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
271 ucidef_add_switch
"switch0" \
272 "0@eth1" "1:lan" "3:lan"
275 ucidef_add_switch
"switch0" \
276 "0@eth0" "3:wan" "4:lan"
279 ucidef_set_interface_lan
"eth0" "dhcp"
283 ucidef_add_switch
"switch0" \
284 "0@eth0" "1:wan" "2:lan"
287 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
288 ucidef_add_switch
"switch0" \
289 "0@eth0" "2:lan" "1:wan" "6@eth1"
295 ucidef_add_switch
"switch0" \
296 "0@eth0" "5:lan" "4:wan"
299 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
300 ucidef_add_switch
"switch0" \
301 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
311 ucidef_add_switch
"switch0" \
312 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
315 ucidef_add_switch
"switch0" \
316 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
319 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
322 ucidef_add_switch
"switch0" \
323 "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1"
326 ucidef_add_switch
"switch0" \
327 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
342 ucidef_add_switch
"switch0" \
343 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
346 ucidef_add_switch
"switch0" \
347 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
351 ucidef_add_switch
"switch1" \
352 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
367 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
368 ucidef_add_switch
"switch0" \
369 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
372 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
373 ucidef_add_switch
"switch0" \
374 "0@eth0" "1:lan" "2:lan" "3:lan"
380 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
381 ucidef_add_switch
"switch0" \
382 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
385 ucidef_set_interface_lan
"eth0"
386 ucidef_add_switch
"switch0" \
387 "0u@eth0" "2:lan" "3:lan" "4:lan"
388 ucidef_add_switch_attr
"switch0" "enable" "false"
394 ucidef_add_switch
"switch0" \
395 "0@eth0" "2:lan" "3:wan"
398 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
399 ucidef_add_switch
"switch0" \
400 "0@eth1" "4:lan" "5:lan" "6@eth0" "3:wan"
403 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
404 ucidef_add_switch
"switch0" \
405 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
408 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
409 ucidef_add_switch
"switch0" \
410 "0:lan" "1:lan" "3@eth1"
418 ucidef_add_switch
"switch0" \
419 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
422 ucidef_set_interface
"usb2" ifname
"usb0" protocol
"static"
423 ucidef_add_switch
"switch0" \
424 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
427 ucidef_add_switch
"switch0" \
428 "0@eth0" "1:lan" "2:lan" "3:wan"
431 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
432 ucidef_add_switch
"switch0" \
433 "0@eth0" "2:lan" "3:lan"
437 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
438 ucidef_add_switch
"switch0" \
439 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
443 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
444 ucidef_add_switch
"switch0" \
445 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
449 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
450 ucidef_add_switch
"switch0" \
451 "0@eth1" "1:lan" "2:lan"
454 ucidef_add_switch
"switch0" \
455 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
458 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
459 ucidef_add_switch
"switch0" \
460 "0@eth0" "1:lan" "5:wan" "6@eth1"
463 ucidef_add_switch
"switch0" \
464 "0@eth0" "5:lan" "1:wan"
467 ucidef_set_interface_lan
"wlan0"
470 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
471 ucidef_add_switch
"switch0" \
472 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
475 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
476 ucidef_add_switch
"switch0" \
477 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
480 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
481 ucidef_add_switch
"switch0" \
482 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
483 ucidef_add_switch
"switch1" \
484 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
487 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
488 ucidef_add_switch
"switch0" \
489 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
492 ucidef_set_interface_wan
"eth0"
493 ucidef_set_interface
"wlan" ifname
"wlan0" protocol
"dhcp"
500 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
501 ucidef_add_switch
"switch0" \
502 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
508 ucidef_add_switch
"switch0" \
509 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
512 ucidef_add_switch
"switch0" \
513 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
516 ucidef_add_switch
"switch0" \
517 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
520 ucidef_add_switch
"switch0" \
521 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
525 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
526 ucidef_add_switch
"switch0" \
527 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
531 ucidef_set_interface
"eth" ifname
"eth0"
532 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
536 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
537 ucidef_add_switch
"switch0" \
538 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
542 ucidef_add_switch
"switch0" \
543 "0@eth0" "1:lan" "2:wan"
549 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
550 ucidef_add_switch
"switch0" \
551 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
553 ucidef_add_switch_attr
"switch0" "blinkrate" 2
554 ucidef_add_switch_port_attr
"switch0" 1 led
6
555 ucidef_add_switch_port_attr
"switch0" 2 led
9
556 ucidef_add_switch_port_attr
"switch0" 5 led
2
559 ucidef_add_switch
"switch0" \
560 "0@eth0" "3:lan" "2:wan"
563 ucidef_add_switch
"switch0" \
564 "5:lan" "1:wan" "6@eth0"
567 ucidef_add_switch
"switch0" \
568 "0@eth0" "2:lan" "3:wan"
571 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
572 ucidef_add_switch
"switch0" \
573 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
576 ucidef_add_switch
"switch0" \
577 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
580 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
581 ucidef_add_switch
"switch0" \
582 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
585 ucidef_set_interfaces_lan_wan
"eth1.1" "eth1.2"
586 ucidef_add_switch
"switch0" \
587 "0@eth1" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
590 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
603 base_mac
=$
(mtd_get_mac_binary config
8)
604 wan_mac
=$
(macaddr_add
"$base_mac" 1)
608 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
614 lan_mac
=$
(mtd_get_mac_binary caldata
0)
615 wan_mac
=$
(mtd_get_mac_binary caldata
6)
619 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
622 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
625 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
629 lan_mac
=$
(mtd_get_mac_binary product-info
8)
630 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
633 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
634 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
638 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
642 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
643 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
648 ar71xx_setup_interfaces
$board
649 ar71xx_setup_macs
$board