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"
148 wifi-pineapple-nano|\
151 ucidef_set_interface_lan
"eth0"
178 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
184 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
185 ucidef_add_switch
"switch0" \
186 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
196 ucidef_set_interface_lan
"eth0 eth1"
199 ucidef_add_switch
"switch0" \
200 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
208 rb-962uigs-5hact2hnt|\
211 ucidef_add_switch
"switch0" \
212 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
220 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
221 ucidef_add_switch
"switch0" \
222 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
228 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
229 ucidef_add_switch
"switch0" \
230 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
235 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
236 ucidef_add_switch
"switch0" \
237 "1:lan" "2:lan" "5@eth1"
242 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
243 ucidef_add_switch
"switch0" \
244 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
250 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
251 ucidef_add_switch
"switch0" \
252 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
256 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
257 ucidef_add_switch
"switch0" \
258 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
263 ucidef_set_interface_lan
"eth1"
266 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
267 ucidef_add_switch
"switch0" \
268 "0@eth1" "1:lan" "3:lan"
271 ucidef_add_switch
"switch0" \
272 "0@eth0" "3:wan" "4:lan"
276 ucidef_set_interface_lan
"eth0" "dhcp"
280 ucidef_add_switch
"switch0" \
281 "0@eth0" "1:wan" "2:lan"
284 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
285 ucidef_add_switch
"switch0" \
286 "0@eth0" "2:lan" "1:wan" "6@eth1"
292 ucidef_add_switch
"switch0" \
293 "0@eth0" "5:lan" "4:wan"
296 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
297 ucidef_add_switch
"switch0" \
298 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
309 ucidef_add_switch
"switch0" \
310 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
313 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
316 ucidef_add_switch
"switch0" \
317 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
332 ucidef_add_switch
"switch0" \
333 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
336 ucidef_add_switch
"switch0" \
337 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
341 ucidef_add_switch
"switch1" \
342 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
357 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
358 ucidef_add_switch
"switch0" \
359 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
362 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
363 ucidef_add_switch
"switch0" \
364 "0@eth0" "1:lan" "2:lan" "3:lan"
370 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
371 ucidef_add_switch
"switch0" \
372 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
375 ucidef_set_interface_lan
"eth0"
376 ucidef_add_switch
"switch0" \
377 "0u@eth0" "2:lan" "3:lan" "4:lan"
378 ucidef_add_switch_attr
"switch0" "enable" "false"
383 ucidef_add_switch
"switch0" \
384 "0@eth0" "2:lan" "3:wan"
387 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
388 ucidef_add_switch
"switch0" \
389 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
392 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
393 ucidef_add_switch
"switch0" \
394 "0:lan" "1:lan" "3@eth1"
402 ucidef_add_switch
"switch0" \
403 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
406 ucidef_set_interface
"usb2" ifname
"usb0" protocol
"static"
407 ucidef_add_switch
"switch0" \
408 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
411 ucidef_add_switch
"switch0" \
412 "0@eth0" "1:lan" "2:lan" "3:wan"
415 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
416 ucidef_add_switch
"switch0" \
417 "0@eth0" "2:lan" "3:lan"
421 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
422 ucidef_add_switch
"switch0" \
423 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
427 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
428 ucidef_add_switch
"switch0" \
429 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
433 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
434 ucidef_add_switch
"switch0" \
435 "0@eth1" "1:lan" "2:lan"
438 ucidef_add_switch
"switch0" \
439 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
442 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
443 ucidef_add_switch
"switch0" \
444 "0@eth0" "1:lan" "5:wan" "6@eth1"
447 ucidef_add_switch
"switch0" \
448 "0@eth0" "5:lan" "1:wan"
451 ucidef_set_interface_lan
"wlan0"
454 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
455 ucidef_add_switch
"switch0" \
456 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
459 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
460 ucidef_add_switch
"switch0" \
461 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
464 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
465 ucidef_add_switch
"switch0" \
466 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
467 ucidef_add_switch
"switch1" \
468 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
471 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
472 ucidef_add_switch
"switch0" \
473 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
476 ucidef_set_interface_wan
"eth0"
477 ucidef_set_interface
"wlan" ifname
"wlan0" protocol
"dhcp"
484 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
485 ucidef_add_switch
"switch0" \
486 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
491 ucidef_add_switch
"switch0" \
492 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
495 ucidef_add_switch
"switch0" \
496 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
499 ucidef_add_switch
"switch0" \
500 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
503 ucidef_add_switch
"switch0" \
504 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
508 ucidef_set_interface
"eth" ifname
"eth0"
509 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
513 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
514 ucidef_add_switch
"switch0" \
515 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
519 ucidef_add_switch
"switch0" \
520 "0@eth0" "1:lan" "2:wan"
526 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
527 ucidef_add_switch
"switch0" \
528 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
530 ucidef_add_switch_attr
"switch0" "blinkrate" 2
531 ucidef_add_switch_port_attr
"switch0" 1 led
6
532 ucidef_add_switch_port_attr
"switch0" 2 led
9
533 ucidef_add_switch_port_attr
"switch0" 5 led
2
536 ucidef_add_switch
"switch0" \
537 "0@eth0" "3:lan" "2:wan"
540 ucidef_add_switch
"switch0" \
541 "5:lan" "1:wan" "6@eth0"
544 ucidef_add_switch
"switch0" \
545 "0@eth0" "2:lan" "3: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" "4@eth0"
553 ucidef_add_switch
"switch0" \
554 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
557 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
558 ucidef_add_switch
"switch0" \
559 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
562 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
576 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
582 lan_mac
=$
(mtd_get_mac_binary caldata
0)
583 wan_mac
=$
(mtd_get_mac_binary caldata
6)
586 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
590 lan_mac
=$
(mtd_get_mac_binary product-info
8)
591 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
594 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
598 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
601 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
602 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
606 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
610 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
611 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
616 ar71xx_setup_interfaces
$board
617 ar71xx_setup_macs
$board