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"
60 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
61 ucidef_add_switch
"switch0" \
62 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
152 wifi-pineapple-nano|\
155 ucidef_set_interface_lan
"eth0"
182 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"
200 ucidef_set_interface_lan
"eth0 eth1"
203 ucidef_add_switch
"switch0" \
204 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
212 rb-962uigs-5hact2hnt|\
215 ucidef_add_switch
"switch0" \
216 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
224 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
225 ucidef_add_switch
"switch0" \
226 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
232 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
233 ucidef_add_switch
"switch0" \
234 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
239 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
240 ucidef_add_switch
"switch0" \
241 "1:lan" "2:lan" "5@eth1"
246 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
247 ucidef_add_switch
"switch0" \
248 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
255 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
256 ucidef_add_switch
"switch0" \
257 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
261 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
262 ucidef_add_switch
"switch0" \
263 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
268 ucidef_set_interface_lan
"eth1"
271 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
272 ucidef_add_switch
"switch0" \
273 "0@eth1" "1:lan" "3:lan"
276 ucidef_add_switch
"switch0" \
277 "0@eth0" "3:wan" "4:lan"
280 ucidef_set_interface_lan
"eth0" "dhcp"
284 ucidef_add_switch
"switch0" \
285 "0@eth0" "1:wan" "2:lan"
288 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
289 ucidef_add_switch
"switch0" \
290 "0@eth0" "2:lan" "1:wan" "6@eth1"
296 ucidef_add_switch
"switch0" \
297 "0@eth0" "5:lan" "4:wan"
300 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
301 ucidef_add_switch
"switch0" \
302 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
313 ucidef_add_switch
"switch0" \
314 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
317 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
320 ucidef_add_switch
"switch0" \
321 "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1"
324 ucidef_add_switch
"switch0" \
325 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
340 ucidef_add_switch
"switch0" \
341 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
344 ucidef_add_switch
"switch0" \
345 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
349 ucidef_add_switch
"switch1" \
350 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
365 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
366 ucidef_add_switch
"switch0" \
367 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
370 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
371 ucidef_add_switch
"switch0" \
372 "0@eth0" "1:lan" "2:lan" "3:lan"
378 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
379 ucidef_add_switch
"switch0" \
380 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
383 ucidef_set_interface_lan
"eth0"
384 ucidef_add_switch
"switch0" \
385 "0u@eth0" "2:lan" "3:lan" "4:lan"
386 ucidef_add_switch_attr
"switch0" "enable" "false"
392 ucidef_add_switch
"switch0" \
393 "0@eth0" "2:lan" "3:wan"
396 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
397 ucidef_add_switch
"switch0" \
398 "0@eth1" "4:lan" "5:lan" "6@eth0" "3:wan"
401 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
402 ucidef_add_switch
"switch0" \
403 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
406 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
407 ucidef_add_switch
"switch0" \
408 "0:lan" "1:lan" "3@eth1"
416 ucidef_add_switch
"switch0" \
417 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
420 ucidef_set_interface
"usb2" ifname
"usb0" protocol
"static"
421 ucidef_add_switch
"switch0" \
422 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
425 ucidef_add_switch
"switch0" \
426 "0@eth0" "1:lan" "2:lan" "3:wan"
429 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
430 ucidef_add_switch
"switch0" \
431 "0@eth0" "2:lan" "3:lan"
435 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
436 ucidef_add_switch
"switch0" \
437 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
441 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
442 ucidef_add_switch
"switch0" \
443 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
447 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
448 ucidef_add_switch
"switch0" \
449 "0@eth1" "1:lan" "2:lan"
452 ucidef_add_switch
"switch0" \
453 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
456 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
457 ucidef_add_switch
"switch0" \
458 "0@eth0" "1:lan" "5:wan" "6@eth1"
461 ucidef_add_switch
"switch0" \
462 "0@eth0" "5:lan" "1:wan"
465 ucidef_set_interface_lan
"wlan0"
468 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
469 ucidef_add_switch
"switch0" \
470 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
473 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
474 ucidef_add_switch
"switch0" \
475 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
478 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
479 ucidef_add_switch
"switch0" \
480 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
481 ucidef_add_switch
"switch1" \
482 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
485 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
486 ucidef_add_switch
"switch0" \
487 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
490 ucidef_set_interface_wan
"eth0"
491 ucidef_set_interface
"wlan" ifname
"wlan0" protocol
"dhcp"
498 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
499 ucidef_add_switch
"switch0" \
500 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
506 ucidef_add_switch
"switch0" \
507 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
510 ucidef_add_switch
"switch0" \
511 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
514 ucidef_add_switch
"switch0" \
515 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
518 ucidef_add_switch
"switch0" \
519 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
523 ucidef_set_interface
"eth" ifname
"eth0"
524 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
528 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
529 ucidef_add_switch
"switch0" \
530 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
534 ucidef_add_switch
"switch0" \
535 "0@eth0" "1:lan" "2:wan"
541 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
542 ucidef_add_switch
"switch0" \
543 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
545 ucidef_add_switch_attr
"switch0" "blinkrate" 2
546 ucidef_add_switch_port_attr
"switch0" 1 led
6
547 ucidef_add_switch_port_attr
"switch0" 2 led
9
548 ucidef_add_switch_port_attr
"switch0" 5 led
2
551 ucidef_add_switch
"switch0" \
552 "0@eth0" "3:lan" "2:wan"
555 ucidef_add_switch
"switch0" \
556 "5:lan" "1:wan" "6@eth0"
559 ucidef_add_switch
"switch0" \
560 "0@eth0" "2:lan" "3:wan"
563 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
564 ucidef_add_switch
"switch0" \
565 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
568 ucidef_add_switch
"switch0" \
569 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
572 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
573 ucidef_add_switch
"switch0" \
574 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
577 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
591 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
597 lan_mac
=$
(mtd_get_mac_binary caldata
0)
598 wan_mac
=$
(mtd_get_mac_binary caldata
6)
601 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
605 lan_mac
=$
(mtd_get_mac_binary product-info
8)
606 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
609 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
613 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
616 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
617 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
621 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
625 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
626 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
631 ar71xx_setup_interfaces
$board
632 ar71xx_setup_macs
$board