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"
150 wifi-pineapple-nano|\
153 ucidef_set_interface_lan
"eth0"
180 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"
252 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
253 ucidef_add_switch
"switch0" \
254 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
258 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
259 ucidef_add_switch
"switch0" \
260 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
265 ucidef_set_interface_lan
"eth1"
268 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
269 ucidef_add_switch
"switch0" \
270 "0@eth1" "1:lan" "3:lan"
273 ucidef_add_switch
"switch0" \
274 "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"
311 ucidef_add_switch
"switch0" \
312 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
315 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
318 ucidef_add_switch
"switch0" \
319 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
334 ucidef_add_switch
"switch0" \
335 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
338 ucidef_add_switch
"switch0" \
339 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
343 ucidef_add_switch
"switch1" \
344 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
359 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
360 ucidef_add_switch
"switch0" \
361 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
364 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
365 ucidef_add_switch
"switch0" \
366 "0@eth0" "1:lan" "2:lan" "3:lan"
372 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
373 ucidef_add_switch
"switch0" \
374 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
377 ucidef_set_interface_lan
"eth0"
378 ucidef_add_switch
"switch0" \
379 "0u@eth0" "2:lan" "3:lan" "4:lan"
380 ucidef_add_switch_attr
"switch0" "enable" "false"
385 ucidef_add_switch
"switch0" \
386 "0@eth0" "2:lan" "3:wan"
389 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
390 ucidef_add_switch
"switch0" \
391 "0@eth1" "4:lan" "5:lan" "6@eth0" "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_raw
"usb2" "usb0" "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_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_raw
"wlan" "wlan0" "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_raw
"eth" "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