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"
146 wifi-pineapple-nano|\
149 ucidef_set_interface_lan
"eth0"
176 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
182 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
183 ucidef_add_switch
"switch0" \
184 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
194 ucidef_set_interface_lan
"eth0 eth1"
197 ucidef_add_switch
"switch0" \
198 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
206 rb-962uigs-5hact2hnt|\
209 ucidef_add_switch
"switch0" \
210 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
218 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
219 ucidef_add_switch
"switch0" \
220 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
226 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
227 ucidef_add_switch
"switch0" \
228 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
233 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
234 ucidef_add_switch
"switch0" \
235 "1:lan" "2:lan" "5@eth1"
240 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
241 ucidef_add_switch
"switch0" \
242 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
247 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
248 ucidef_add_switch
"switch0" \
249 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
252 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
253 ucidef_add_switch
"switch0" \
254 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
259 ucidef_set_interface_lan
"eth1"
262 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
263 ucidef_add_switch
"switch0" \
264 "0@eth1" "1:lan" "3:lan"
267 ucidef_add_switch
"switch0" \
268 "0@eth0" "3:wan" "4:lan"
272 ucidef_set_interface_lan
"eth0" "dhcp"
276 ucidef_add_switch
"switch0" \
277 "0@eth0" "1:wan" "2:lan"
280 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
281 ucidef_add_switch
"switch0" \
282 "0@eth0" "2:lan" "1:wan" "6@eth1"
288 ucidef_add_switch
"switch0" \
289 "0@eth0" "5:lan" "4:wan"
292 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
293 ucidef_add_switch
"switch0" \
294 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
305 ucidef_add_switch
"switch0" \
306 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
309 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
312 ucidef_add_switch
"switch0" \
313 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
326 ucidef_add_switch
"switch0" \
327 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
330 ucidef_add_switch
"switch0" \
331 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
335 ucidef_add_switch
"switch1" \
336 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
350 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
351 ucidef_add_switch
"switch0" \
352 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
355 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
356 ucidef_add_switch
"switch0" \
357 "0@eth0" "1:lan" "2:lan" "3:lan"
363 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
364 ucidef_add_switch
"switch0" \
365 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
368 ucidef_set_interface_lan
"eth0"
369 ucidef_add_switch
"switch0" \
370 "0u@eth0" "2:lan" "3:lan" "4:lan"
371 ucidef_add_switch_attr
"switch0" "enable" "false"
376 ucidef_add_switch
"switch0" \
377 "0@eth0" "2:lan" "3:wan"
380 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
381 ucidef_add_switch
"switch0" \
382 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
385 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
386 ucidef_add_switch
"switch0" \
387 "0:lan" "1:lan" "3@eth1"
395 ucidef_add_switch
"switch0" \
396 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
399 ucidef_set_interface_raw
"usb2" "usb0" "static"
400 ucidef_add_switch
"switch0" \
401 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
404 ucidef_add_switch
"switch0" \
405 "0@eth0" "1:lan" "2:lan" "3:wan"
408 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
409 ucidef_add_switch
"switch0" \
410 "0@eth0" "2:lan" "3:lan"
414 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
415 ucidef_add_switch
"switch0" \
416 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
420 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
421 ucidef_add_switch
"switch0" \
422 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
426 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
427 ucidef_add_switch
"switch0" \
428 "0@eth1" "1:lan" "2:lan"
431 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
432 ucidef_add_switch
"switch0" \
433 "0@eth0" "1:lan" "5:wan" "6@eth1"
436 ucidef_add_switch
"switch0" \
437 "0@eth0" "5:lan" "1:wan"
440 ucidef_set_interface_lan
"wlan0"
443 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
444 ucidef_add_switch
"switch0" \
445 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
448 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
449 ucidef_add_switch
"switch0" \
450 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
453 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
454 ucidef_add_switch
"switch0" \
455 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
456 ucidef_add_switch
"switch1" \
457 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
460 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
461 ucidef_add_switch
"switch0" \
462 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
465 ucidef_set_interface_wan
"eth0"
466 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
473 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
474 ucidef_add_switch
"switch0" \
475 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
480 ucidef_add_switch
"switch0" \
481 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
484 ucidef_add_switch
"switch0" \
485 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
488 ucidef_add_switch
"switch0" \
489 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
492 ucidef_add_switch
"switch0" \
493 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
497 ucidef_set_interface_raw
"eth" "eth0"
498 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
502 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
503 ucidef_add_switch
"switch0" \
504 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
508 ucidef_add_switch
"switch0" \
509 "0@eth0" "1:lan" "2: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" "5@eth0"
519 ucidef_add_switch_attr
"switch0" "blinkrate" 2
520 ucidef_add_switch_port_attr
"switch0" 1 led
6
521 ucidef_add_switch_port_attr
"switch0" 2 led
9
522 ucidef_add_switch_port_attr
"switch0" 5 led
2
525 ucidef_add_switch
"switch0" \
526 "0@eth0" "3:lan" "2:wan"
529 ucidef_add_switch
"switch0" \
530 "5:lan" "1:wan" "6@eth0"
533 ucidef_add_switch
"switch0" \
534 "0@eth0" "2:lan" "3:wan"
537 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
538 ucidef_add_switch
"switch0" \
539 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
542 ucidef_add_switch
"switch0" \
543 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
546 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
547 ucidef_add_switch
"switch0" \
548 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
551 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
565 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
571 lan_mac
=$
(mtd_get_mac_binary caldata
0)
572 wan_mac
=$
(mtd_get_mac_binary caldata
6)
575 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
579 lan_mac
=$
(mtd_get_mac_binary product-info
8)
580 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
583 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
587 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
590 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
591 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
595 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
599 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
600 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
605 ar71xx_setup_interfaces
$board
606 ar71xx_setup_macs
$board