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"
139 ucidef_set_interface_lan
"eth0"
166 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
172 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
173 ucidef_add_switch
"switch0" \
174 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
184 ucidef_set_interface_lan
"eth0 eth1"
187 ucidef_add_switch
"switch0" \
188 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
196 rb-962uigs-5hact2hnt|\
199 ucidef_add_switch
"switch0" \
200 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
208 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
209 ucidef_add_switch
"switch0" \
210 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
216 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
217 ucidef_add_switch
"switch0" \
218 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
223 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
224 ucidef_add_switch
"switch0" \
225 "1:lan" "2:lan" "5@eth1"
230 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
231 ucidef_add_switch
"switch0" \
232 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
237 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
238 ucidef_add_switch
"switch0" \
239 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
242 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
243 ucidef_add_switch
"switch0" \
244 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
249 ucidef_set_interface_lan
"eth1"
252 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
253 ucidef_add_switch
"switch0" \
254 "0@eth1" "1:lan" "3:lan"
257 ucidef_add_switch
"switch0" \
258 "0@eth0" "3:wan" "4:lan"
261 ucidef_set_interface_lan
"eth0" "dhcp"
267 ucidef_add_switch
"switch0" \
268 "0@eth0" "5:lan" "4:wan"
271 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
272 ucidef_add_switch
"switch0" \
273 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
284 ucidef_add_switch
"switch0" \
285 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
288 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
291 ucidef_add_switch
"switch0" \
292 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
305 ucidef_add_switch
"switch0" \
306 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
309 ucidef_add_switch
"switch0" \
310 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
314 ucidef_add_switch
"switch1" \
315 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
329 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
330 ucidef_add_switch
"switch0" \
331 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
334 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
335 ucidef_add_switch
"switch0" \
336 "0@eth0" "1:lan" "2:lan" "3:lan"
342 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
343 ucidef_add_switch
"switch0" \
344 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
347 ucidef_set_interface_lan
"eth0"
348 ucidef_add_switch
"switch0" \
349 "0u@eth0" "2:lan" "3:lan" "4:lan"
350 ucidef_add_switch_attr
"switch0" "enable" "false"
353 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
354 ucidef_add_switch
"switch0" \
355 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
358 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
359 ucidef_add_switch
"switch0" \
360 "0:lan" "1:lan" "3@eth1"
368 ucidef_add_switch
"switch0" \
369 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
372 ucidef_add_switch
"switch0" \
373 "0@eth0" "1:lan" "2:lan" "3:wan"
376 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
377 ucidef_add_switch
"switch0" \
378 "0@eth0" "2:lan" "3:lan"
382 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
383 ucidef_add_switch
"switch0" \
384 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
388 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
389 ucidef_add_switch
"switch0" \
390 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
393 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
394 ucidef_add_switch
"switch0" \
395 "0@eth0" "1:lan" "5:wan" "6@eth1"
398 ucidef_add_switch
"switch0" \
399 "0@eth0" "5:lan" "1:wan"
402 ucidef_set_interface_lan
"wlan0"
405 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
406 ucidef_add_switch
"switch0" \
407 "0@eth1" "1:lan" "2:lan"
410 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
411 ucidef_add_switch
"switch0" \
412 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
415 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
416 ucidef_add_switch
"switch0" \
417 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
420 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
421 ucidef_add_switch
"switch0" \
422 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
423 ucidef_add_switch
"switch1" \
424 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
427 ucidef_add_switch
"switch0" \
428 "0@eth0" "1:wan" "2:lan"
431 ucidef_set_interface_wan
"eth0"
432 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
439 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
440 ucidef_add_switch
"switch0" \
441 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
446 ucidef_add_switch
"switch0" \
447 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
450 ucidef_add_switch
"switch0" \
451 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
454 ucidef_add_switch
"switch0" \
455 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
458 ucidef_add_switch
"switch0" \
459 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
463 ucidef_set_interface_raw
"eth" "eth0"
464 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
468 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
469 ucidef_add_switch
"switch0" \
470 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
474 ucidef_add_switch
"switch0" \
475 "0@eth0" "1:lan" "2:wan"
479 ucidef_add_switch
"switch0" \
480 "0@eth0" "2:lan" "3:wan"
486 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
487 ucidef_add_switch
"switch0" \
488 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
490 ucidef_add_switch_attr
"switch0" "blinkrate" 2
491 ucidef_add_switch_port_attr
"switch0" 1 led
6
492 ucidef_add_switch_port_attr
"switch0" 2 led
9
493 ucidef_add_switch_port_attr
"switch0" 5 led
2
496 ucidef_add_switch
"switch0" \
497 "0@eth0" "3:lan" "2:wan"
500 ucidef_add_switch
"switch0" \
501 "5:lan" "1:wan" "6@eth0"
504 ucidef_add_switch
"switch0" \
505 "0@eth0" "2:lan" "3:wan"
508 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
509 ucidef_add_switch
"switch0" \
510 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
513 ucidef_add_switch
"switch0" \
514 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1: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" "5:wan"
522 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
536 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
542 lan_mac
=$
(mtd_get_mac_binary caldata
0)
543 wan_mac
=$
(mtd_get_mac_binary caldata
6)
546 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
550 lan_mac
=$
(mtd_get_mac_binary product-info
8)
551 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
554 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
558 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
562 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
566 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
567 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
572 ar71xx_setup_interfaces
$board
573 ar71xx_setup_macs
$board