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"
151 wifi-pineapple-nano|\
154 ucidef_set_interface_lan
"eth0"
181 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
187 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
188 ucidef_add_switch
"switch0" \
189 "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"
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"
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:4" "2:lan:3" "3:lan:2" "4:wan:1"
335 ucidef_add_switch
"switch0" \
336 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
339 ucidef_add_switch
"switch0" \
340 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
344 ucidef_add_switch
"switch1" \
345 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
360 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
361 ucidef_add_switch
"switch0" \
362 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
365 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
366 ucidef_add_switch
"switch0" \
367 "0@eth0" "1:lan" "2:lan" "3:lan"
373 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
374 ucidef_add_switch
"switch0" \
375 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
378 ucidef_set_interface_lan
"eth0"
379 ucidef_add_switch
"switch0" \
380 "0u@eth0" "2:lan" "3:lan" "4:lan"
381 ucidef_add_switch_attr
"switch0" "enable" "false"
386 ucidef_add_switch
"switch0" \
387 "0@eth0" "2:lan" "3:wan"
390 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
391 ucidef_add_switch
"switch0" \
392 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
395 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
396 ucidef_add_switch
"switch0" \
397 "0:lan" "1:lan" "3@eth1"
405 ucidef_add_switch
"switch0" \
406 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
409 ucidef_set_interface
"usb2" ifname
"usb0" protocol
"static"
410 ucidef_add_switch
"switch0" \
411 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
414 ucidef_add_switch
"switch0" \
415 "0@eth0" "1:lan" "2:lan" "3:wan"
418 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
419 ucidef_add_switch
"switch0" \
420 "0@eth0" "2:lan" "3:lan"
424 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
425 ucidef_add_switch
"switch0" \
426 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
430 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
431 ucidef_add_switch
"switch0" \
432 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
436 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
437 ucidef_add_switch
"switch0" \
438 "0@eth1" "1:lan" "2:lan"
441 ucidef_add_switch
"switch0" \
442 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
445 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
446 ucidef_add_switch
"switch0" \
447 "0@eth0" "1:lan" "5:wan" "6@eth1"
450 ucidef_add_switch
"switch0" \
451 "0@eth0" "5:lan" "1:wan"
454 ucidef_set_interface_lan
"wlan0"
457 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
458 ucidef_add_switch
"switch0" \
459 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
462 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
463 ucidef_add_switch
"switch0" \
464 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
467 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
468 ucidef_add_switch
"switch0" \
469 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
470 ucidef_add_switch
"switch1" \
471 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
474 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
475 ucidef_add_switch
"switch0" \
476 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
479 ucidef_set_interface_wan
"eth0"
480 ucidef_set_interface
"wlan" ifname
"wlan0" protocol
"dhcp"
487 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
488 ucidef_add_switch
"switch0" \
489 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
495 ucidef_add_switch
"switch0" \
496 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
499 ucidef_add_switch
"switch0" \
500 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
503 ucidef_add_switch
"switch0" \
504 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
507 ucidef_add_switch
"switch0" \
508 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
512 ucidef_set_interface
"eth" ifname
"eth0"
513 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
517 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
518 ucidef_add_switch
"switch0" \
519 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
523 ucidef_add_switch
"switch0" \
524 "0@eth0" "1:lan" "2:wan"
530 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
531 ucidef_add_switch
"switch0" \
532 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
534 ucidef_add_switch_attr
"switch0" "blinkrate" 2
535 ucidef_add_switch_port_attr
"switch0" 1 led
6
536 ucidef_add_switch_port_attr
"switch0" 2 led
9
537 ucidef_add_switch_port_attr
"switch0" 5 led
2
540 ucidef_add_switch
"switch0" \
541 "0@eth0" "3:lan" "2:wan"
544 ucidef_add_switch
"switch0" \
545 "5:lan" "1:wan" "6@eth0"
548 ucidef_add_switch
"switch0" \
549 "0@eth0" "2:lan" "3:wan"
552 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
553 ucidef_add_switch
"switch0" \
554 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
557 ucidef_add_switch
"switch0" \
558 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
561 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
562 ucidef_add_switch
"switch0" \
563 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
566 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
580 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
586 lan_mac
=$
(mtd_get_mac_binary caldata
0)
587 wan_mac
=$
(mtd_get_mac_binary caldata
6)
590 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
594 lan_mac
=$
(mtd_get_mac_binary product-info
8)
595 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
598 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
602 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
605 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
606 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
610 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
614 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
615 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
620 ar71xx_setup_interfaces
$board
621 ar71xx_setup_macs
$board