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"
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"
312 ucidef_add_switch
"switch0" \
313 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
316 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
319 ucidef_add_switch
"switch0" \
320 "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1"
323 ucidef_add_switch
"switch0" \
324 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
339 ucidef_add_switch
"switch0" \
340 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
343 ucidef_add_switch
"switch0" \
344 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
348 ucidef_add_switch
"switch1" \
349 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
364 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
365 ucidef_add_switch
"switch0" \
366 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
369 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
370 ucidef_add_switch
"switch0" \
371 "0@eth0" "1:lan" "2:lan" "3:lan"
377 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
378 ucidef_add_switch
"switch0" \
379 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
382 ucidef_set_interface_lan
"eth0"
383 ucidef_add_switch
"switch0" \
384 "0u@eth0" "2:lan" "3:lan" "4:lan"
385 ucidef_add_switch_attr
"switch0" "enable" "false"
390 ucidef_add_switch
"switch0" \
391 "0@eth0" "2:lan" "3:wan"
394 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
395 ucidef_add_switch
"switch0" \
396 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
399 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
400 ucidef_add_switch
"switch0" \
401 "0:lan" "1:lan" "3@eth1"
409 ucidef_add_switch
"switch0" \
410 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
413 ucidef_set_interface
"usb2" ifname
"usb0" protocol
"static"
414 ucidef_add_switch
"switch0" \
415 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
418 ucidef_add_switch
"switch0" \
419 "0@eth0" "1:lan" "2:lan" "3:wan"
422 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
423 ucidef_add_switch
"switch0" \
424 "0@eth0" "2:lan" "3:lan"
428 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
429 ucidef_add_switch
"switch0" \
430 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
434 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
435 ucidef_add_switch
"switch0" \
436 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
440 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
441 ucidef_add_switch
"switch0" \
442 "0@eth1" "1:lan" "2:lan"
445 ucidef_add_switch
"switch0" \
446 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
449 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
450 ucidef_add_switch
"switch0" \
451 "0@eth0" "1:lan" "5:wan" "6@eth1"
454 ucidef_add_switch
"switch0" \
455 "0@eth0" "5:lan" "1:wan"
458 ucidef_set_interface_lan
"wlan0"
461 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
462 ucidef_add_switch
"switch0" \
463 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
466 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
467 ucidef_add_switch
"switch0" \
468 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
471 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
472 ucidef_add_switch
"switch0" \
473 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
474 ucidef_add_switch
"switch1" \
475 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
478 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
479 ucidef_add_switch
"switch0" \
480 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
483 ucidef_set_interface_wan
"eth0"
484 ucidef_set_interface
"wlan" ifname
"wlan0" protocol
"dhcp"
491 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
492 ucidef_add_switch
"switch0" \
493 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
499 ucidef_add_switch
"switch0" \
500 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
503 ucidef_add_switch
"switch0" \
504 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
507 ucidef_add_switch
"switch0" \
508 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
511 ucidef_add_switch
"switch0" \
512 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
516 ucidef_set_interface
"eth" ifname
"eth0"
517 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
521 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
522 ucidef_add_switch
"switch0" \
523 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
527 ucidef_add_switch
"switch0" \
528 "0@eth0" "1:lan" "2:wan"
534 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
535 ucidef_add_switch
"switch0" \
536 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
538 ucidef_add_switch_attr
"switch0" "blinkrate" 2
539 ucidef_add_switch_port_attr
"switch0" 1 led
6
540 ucidef_add_switch_port_attr
"switch0" 2 led
9
541 ucidef_add_switch_port_attr
"switch0" 5 led
2
544 ucidef_add_switch
"switch0" \
545 "0@eth0" "3:lan" "2:wan"
548 ucidef_add_switch
"switch0" \
549 "5:lan" "1:wan" "6@eth0"
552 ucidef_add_switch
"switch0" \
553 "0@eth0" "2:lan" "3:wan"
556 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
557 ucidef_add_switch
"switch0" \
558 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
561 ucidef_add_switch
"switch0" \
562 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
565 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
566 ucidef_add_switch
"switch0" \
567 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
570 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
584 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
590 lan_mac
=$
(mtd_get_mac_binary caldata
0)
591 wan_mac
=$
(mtd_get_mac_binary caldata
6)
594 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
598 lan_mac
=$
(mtd_get_mac_binary product-info
8)
599 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
602 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
606 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
609 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
610 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
614 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
618 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
619 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
624 ar71xx_setup_interfaces
$board
625 ar71xx_setup_macs
$board