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"
57 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
58 ucidef_add_switch
"switch0" \
59 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
140 ucidef_set_interface_lan
"eth0"
167 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
173 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
174 ucidef_add_switch
"switch0" \
175 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
185 ucidef_set_interface_lan
"eth0 eth1"
188 ucidef_add_switch
"switch0" \
189 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
197 rb-962uigs-5hact2hnt|\
200 ucidef_add_switch
"switch0" \
201 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
209 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
210 ucidef_add_switch
"switch0" \
211 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
217 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
218 ucidef_add_switch
"switch0" \
219 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
224 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
225 ucidef_add_switch
"switch0" \
226 "1:lan" "2:lan" "5@eth1"
231 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
232 ucidef_add_switch
"switch0" \
233 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
238 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
239 ucidef_add_switch
"switch0" \
240 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
243 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
244 ucidef_add_switch
"switch0" \
245 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
250 ucidef_set_interface_lan
"eth1"
253 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
254 ucidef_add_switch
"switch0" \
255 "0@eth1" "1:lan" "3:lan"
258 ucidef_add_switch
"switch0" \
259 "0@eth0" "3:wan" "4:lan"
262 ucidef_set_interface_lan
"eth0" "dhcp"
268 ucidef_add_switch
"switch0" \
269 "0@eth0" "5:lan" "4:wan"
272 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
273 ucidef_add_switch
"switch0" \
274 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
285 ucidef_add_switch
"switch0" \
286 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
289 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
292 ucidef_add_switch
"switch0" \
293 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
306 ucidef_add_switch
"switch0" \
307 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
310 ucidef_add_switch
"switch0" \
311 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
315 ucidef_add_switch
"switch1" \
316 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
330 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
331 ucidef_add_switch
"switch0" \
332 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
335 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
336 ucidef_add_switch
"switch0" \
337 "0@eth0" "1:lan" "2:lan" "3:lan"
343 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
344 ucidef_add_switch
"switch0" \
345 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
348 ucidef_set_interface_lan
"eth0"
349 ucidef_add_switch
"switch0" \
350 "0u@eth0" "2:lan" "3:lan" "4:lan"
351 ucidef_add_switch_attr
"switch0" "enable" "false"
354 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
355 ucidef_add_switch
"switch0" \
356 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
359 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
360 ucidef_add_switch
"switch0" \
361 "0:lan" "1:lan" "3@eth1"
369 ucidef_add_switch
"switch0" \
370 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
373 ucidef_add_switch
"switch0" \
374 "0@eth0" "1:lan" "2:lan" "3:wan"
377 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
378 ucidef_add_switch
"switch0" \
379 "0@eth0" "2:lan" "3:lan"
383 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
384 ucidef_add_switch
"switch0" \
385 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
389 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
390 ucidef_add_switch
"switch0" \
391 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
395 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
396 ucidef_add_switch
"switch0" \
397 "0@eth1" "1:lan" "2:lan"
400 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
401 ucidef_add_switch
"switch0" \
402 "0@eth0" "1:lan" "5:wan" "6@eth1"
405 ucidef_add_switch
"switch0" \
406 "0@eth0" "5:lan" "1:wan"
409 ucidef_set_interface_lan
"wlan0"
412 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
413 ucidef_add_switch
"switch0" \
414 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
417 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
418 ucidef_add_switch
"switch0" \
419 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
422 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
423 ucidef_add_switch
"switch0" \
424 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
425 ucidef_add_switch
"switch1" \
426 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
429 ucidef_add_switch
"switch0" \
430 "0@eth0" "1:wan" "2:lan"
433 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
434 ucidef_add_switch
"switch0" \
435 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
438 ucidef_set_interface_wan
"eth0"
439 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
446 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
447 ucidef_add_switch
"switch0" \
448 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
453 ucidef_add_switch
"switch0" \
454 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
457 ucidef_add_switch
"switch0" \
458 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
461 ucidef_add_switch
"switch0" \
462 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
465 ucidef_add_switch
"switch0" \
466 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
470 ucidef_set_interface_raw
"eth" "eth0"
471 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
475 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
476 ucidef_add_switch
"switch0" \
477 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
481 ucidef_add_switch
"switch0" \
482 "0@eth0" "1:lan" "2:wan"
486 ucidef_add_switch
"switch0" \
487 "0@eth0" "2:lan" "3:wan"
493 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
494 ucidef_add_switch
"switch0" \
495 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
497 ucidef_add_switch_attr
"switch0" "blinkrate" 2
498 ucidef_add_switch_port_attr
"switch0" 1 led
6
499 ucidef_add_switch_port_attr
"switch0" 2 led
9
500 ucidef_add_switch_port_attr
"switch0" 5 led
2
503 ucidef_add_switch
"switch0" \
504 "0@eth0" "3:lan" "2:wan"
507 ucidef_add_switch
"switch0" \
508 "5:lan" "1:wan" "6@eth0"
511 ucidef_add_switch
"switch0" \
512 "0@eth0" "2:lan" "3:wan"
515 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
516 ucidef_add_switch
"switch0" \
517 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
520 ucidef_add_switch
"switch0" \
521 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
524 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
525 ucidef_add_switch
"switch0" \
526 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
529 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
543 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
549 lan_mac
=$
(mtd_get_mac_binary caldata
0)
550 wan_mac
=$
(mtd_get_mac_binary caldata
6)
553 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
557 lan_mac
=$
(mtd_get_mac_binary product-info
8)
558 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
561 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
565 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
568 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
569 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
573 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
577 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
578 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
583 ar71xx_setup_interfaces
$board
584 ar71xx_setup_macs
$board