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"
150 wifi-pineapple-nano|\
153 ucidef_set_interface_lan
"eth0"
179 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
186 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
187 ucidef_add_switch
"switch0" \
188 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
198 ucidef_set_interface_lan
"eth0 eth1"
201 ucidef_add_switch
"switch0" \
202 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
210 rb-962uigs-5hact2hnt|\
213 ucidef_add_switch
"switch0" \
214 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
222 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
223 ucidef_add_switch
"switch0" \
224 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
230 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
231 ucidef_add_switch
"switch0" \
232 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
237 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
238 ucidef_add_switch
"switch0" \
239 "1:lan" "2:lan" "5@eth1"
244 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
245 ucidef_add_switch
"switch0" \
246 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
253 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
254 ucidef_add_switch
"switch0" \
255 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
259 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
260 ucidef_add_switch
"switch0" \
261 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
266 ucidef_set_interface_lan
"eth1"
269 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
270 ucidef_add_switch
"switch0" \
271 "0@eth1" "1:lan" "3:lan"
274 ucidef_add_switch
"switch0" \
275 "0@eth0" "3:wan" "4:lan"
278 ucidef_set_interface_lan
"eth0" "dhcp"
282 ucidef_add_switch
"switch0" \
283 "0@eth0" "1:wan" "2:lan"
286 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
287 ucidef_add_switch
"switch0" \
288 "0@eth0" "2:lan" "1:wan" "6@eth1"
294 ucidef_add_switch
"switch0" \
295 "0@eth0" "5:lan" "4:wan"
298 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
299 ucidef_add_switch
"switch0" \
300 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
310 ucidef_add_switch
"switch0" \
311 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
314 ucidef_add_switch
"switch0" \
315 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
318 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
321 ucidef_add_switch
"switch0" \
322 "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1"
325 ucidef_add_switch
"switch0" \
326 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
341 ucidef_add_switch
"switch0" \
342 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
345 ucidef_add_switch
"switch0" \
346 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
350 ucidef_add_switch
"switch1" \
351 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
366 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
367 ucidef_add_switch
"switch0" \
368 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
371 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
372 ucidef_add_switch
"switch0" \
373 "0@eth0" "1:lan" "2:lan" "3:lan"
379 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
380 ucidef_add_switch
"switch0" \
381 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
384 ucidef_set_interface_lan
"eth0"
385 ucidef_add_switch
"switch0" \
386 "0u@eth0" "2:lan" "3:lan" "4:lan"
387 ucidef_add_switch_attr
"switch0" "enable" "false"
393 ucidef_add_switch
"switch0" \
394 "0@eth0" "2:lan" "3:wan"
397 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
398 ucidef_add_switch
"switch0" \
399 "0@eth1" "4:lan" "5:lan" "6@eth0" "3:wan"
402 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
403 ucidef_add_switch
"switch0" \
404 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
407 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
408 ucidef_add_switch
"switch0" \
409 "0:lan" "1:lan" "3@eth1"
417 ucidef_add_switch
"switch0" \
418 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
421 ucidef_set_interface
"usb2" ifname
"usb0" protocol
"static"
422 ucidef_add_switch
"switch0" \
423 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
426 ucidef_add_switch
"switch0" \
427 "0@eth0" "1:lan" "2:lan" "3:wan"
430 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
431 ucidef_add_switch
"switch0" \
432 "0@eth0" "2:lan" "3:lan"
436 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
437 ucidef_add_switch
"switch0" \
438 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
442 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
443 ucidef_add_switch
"switch0" \
444 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
448 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
449 ucidef_add_switch
"switch0" \
450 "0@eth1" "1:lan" "2:lan"
453 ucidef_add_switch
"switch0" \
454 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
457 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
458 ucidef_add_switch
"switch0" \
459 "0@eth0" "1:lan" "5:wan" "6@eth1"
462 ucidef_add_switch
"switch0" \
463 "0@eth0" "5:lan" "1:wan"
466 ucidef_set_interface_lan
"wlan0"
469 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
470 ucidef_add_switch
"switch0" \
471 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
474 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
475 ucidef_add_switch
"switch0" \
476 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
479 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
480 ucidef_add_switch
"switch0" \
481 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
482 ucidef_add_switch
"switch1" \
483 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
486 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
487 ucidef_add_switch
"switch0" \
488 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
491 ucidef_set_interface_wan
"eth0"
492 ucidef_set_interface
"wlan" ifname
"wlan0" protocol
"dhcp"
499 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
500 ucidef_add_switch
"switch0" \
501 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
507 ucidef_add_switch
"switch0" \
508 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
511 ucidef_add_switch
"switch0" \
512 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
515 ucidef_add_switch
"switch0" \
516 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
519 ucidef_add_switch
"switch0" \
520 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
524 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
525 ucidef_add_switch
"switch0" \
526 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
530 ucidef_set_interface
"eth" ifname
"eth0"
531 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
535 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
536 ucidef_add_switch
"switch0" \
537 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
541 ucidef_add_switch
"switch0" \
542 "0@eth0" "1:lan" "2:wan"
548 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
549 ucidef_add_switch
"switch0" \
550 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
552 ucidef_add_switch_attr
"switch0" "blinkrate" 2
553 ucidef_add_switch_port_attr
"switch0" 1 led
6
554 ucidef_add_switch_port_attr
"switch0" 2 led
9
555 ucidef_add_switch_port_attr
"switch0" 5 led
2
558 ucidef_add_switch
"switch0" \
559 "0@eth0" "3:lan" "2:wan"
562 ucidef_add_switch
"switch0" \
563 "5:lan" "1:wan" "6@eth0"
566 ucidef_add_switch
"switch0" \
567 "0@eth0" "2:lan" "3:wan"
570 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
571 ucidef_add_switch
"switch0" \
572 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
575 ucidef_add_switch
"switch0" \
576 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
579 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
580 ucidef_add_switch
"switch0" \
581 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
584 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
597 base_mac
=$
(mtd_get_mac_binary config
8)
598 wan_mac
=$
(macaddr_add
"$base_mac" 1)
602 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
608 lan_mac
=$
(mtd_get_mac_binary caldata
0)
609 wan_mac
=$
(mtd_get_mac_binary caldata
6)
613 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
616 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
619 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
623 lan_mac
=$
(mtd_get_mac_binary product-info
8)
624 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
627 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
628 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
632 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
636 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
637 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
642 ar71xx_setup_interfaces
$board
643 ar71xx_setup_macs
$board