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"
143 ucidef_set_interface_lan
"eth0"
170 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
176 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
177 ucidef_add_switch
"switch0" \
178 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
188 ucidef_set_interface_lan
"eth0 eth1"
191 ucidef_add_switch
"switch0" \
192 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
200 rb-962uigs-5hact2hnt|\
203 ucidef_add_switch
"switch0" \
204 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
212 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
213 ucidef_add_switch
"switch0" \
214 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
220 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
221 ucidef_add_switch
"switch0" \
222 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
227 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
228 ucidef_add_switch
"switch0" \
229 "1:lan" "2:lan" "5@eth1"
234 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
235 ucidef_add_switch
"switch0" \
236 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
241 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
242 ucidef_add_switch
"switch0" \
243 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
246 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
247 ucidef_add_switch
"switch0" \
248 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
253 ucidef_set_interface_lan
"eth1"
256 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
257 ucidef_add_switch
"switch0" \
258 "0@eth1" "1:lan" "3:lan"
261 ucidef_add_switch
"switch0" \
262 "0@eth0" "3:wan" "4:lan"
265 ucidef_set_interface_lan
"eth0" "dhcp"
271 ucidef_add_switch
"switch0" \
272 "0@eth0" "5:lan" "4:wan"
275 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
276 ucidef_add_switch
"switch0" \
277 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
288 ucidef_add_switch
"switch0" \
289 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
292 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
295 ucidef_add_switch
"switch0" \
296 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
309 ucidef_add_switch
"switch0" \
310 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
313 ucidef_add_switch
"switch0" \
314 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
318 ucidef_add_switch
"switch1" \
319 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
333 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
334 ucidef_add_switch
"switch0" \
335 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
338 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
339 ucidef_add_switch
"switch0" \
340 "0@eth0" "1:lan" "2:lan" "3:lan"
346 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
347 ucidef_add_switch
"switch0" \
348 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
351 ucidef_set_interface_lan
"eth0"
352 ucidef_add_switch
"switch0" \
353 "0u@eth0" "2:lan" "3:lan" "4:lan"
354 ucidef_add_switch_attr
"switch0" "enable" "false"
357 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
358 ucidef_add_switch
"switch0" \
359 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
362 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
363 ucidef_add_switch
"switch0" \
364 "0:lan" "1:lan" "3@eth1"
372 ucidef_add_switch
"switch0" \
373 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
376 # usb0 is RNDIS interface over USB in device mode
377 ucidef_set_interface_raw
"usb2" "usb0" "static"
378 ucidef_add_switch
"switch0" \
379 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
382 ucidef_add_switch
"switch0" \
383 "0@eth0" "1:lan" "2:lan" "3:wan"
386 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
387 ucidef_add_switch
"switch0" \
388 "0@eth0" "2:lan" "3:lan"
392 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
393 ucidef_add_switch
"switch0" \
394 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
398 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
399 ucidef_add_switch
"switch0" \
400 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
404 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
405 ucidef_add_switch
"switch0" \
406 "0@eth1" "1:lan" "2:lan"
409 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
410 ucidef_add_switch
"switch0" \
411 "0@eth0" "1:lan" "5:wan" "6@eth1"
414 ucidef_add_switch
"switch0" \
415 "0@eth0" "5:lan" "1:wan"
418 ucidef_set_interface_lan
"wlan0"
421 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
422 ucidef_add_switch
"switch0" \
423 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
426 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
427 ucidef_add_switch
"switch0" \
428 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
431 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
432 ucidef_add_switch
"switch0" \
433 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
434 ucidef_add_switch
"switch1" \
435 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
438 ucidef_add_switch
"switch0" \
439 "0@eth0" "1:wan" "2:lan"
442 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
443 ucidef_add_switch
"switch0" \
444 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
447 ucidef_set_interface_wan
"eth0"
448 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
455 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
456 ucidef_add_switch
"switch0" \
457 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
462 ucidef_add_switch
"switch0" \
463 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
466 ucidef_add_switch
"switch0" \
467 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
470 ucidef_add_switch
"switch0" \
471 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
474 ucidef_add_switch
"switch0" \
475 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
479 ucidef_set_interface_raw
"eth" "eth0"
480 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
484 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
485 ucidef_add_switch
"switch0" \
486 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
490 ucidef_add_switch
"switch0" \
491 "0@eth0" "1:lan" "2:wan"
495 ucidef_add_switch
"switch0" \
496 "0@eth0" "2:lan" "3:wan"
502 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
503 ucidef_add_switch
"switch0" \
504 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
506 ucidef_add_switch_attr
"switch0" "blinkrate" 2
507 ucidef_add_switch_port_attr
"switch0" 1 led
6
508 ucidef_add_switch_port_attr
"switch0" 2 led
9
509 ucidef_add_switch_port_attr
"switch0" 5 led
2
512 ucidef_add_switch
"switch0" \
513 "0@eth0" "3:lan" "2:wan"
516 ucidef_add_switch
"switch0" \
517 "5:lan" "1:wan" "6@eth0"
520 ucidef_add_switch
"switch0" \
521 "0@eth0" "2:lan" "3:wan"
524 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
525 ucidef_add_switch
"switch0" \
526 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
529 ucidef_add_switch
"switch0" \
530 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
533 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
534 ucidef_add_switch
"switch0" \
535 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
538 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
552 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
558 lan_mac
=$
(mtd_get_mac_binary caldata
0)
559 wan_mac
=$
(mtd_get_mac_binary caldata
6)
562 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
566 lan_mac
=$
(mtd_get_mac_binary product-info
8)
567 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
570 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
574 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
577 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
578 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
582 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
586 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
587 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
592 ar71xx_setup_interfaces
$board
593 ar71xx_setup_macs
$board