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"
137 ucidef_set_interface_lan
"eth0"
165 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
170 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
171 ucidef_add_switch
"switch0" \
172 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
181 ucidef_set_interface_lan
"eth0 eth1"
184 ucidef_add_switch
"switch0" \
185 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
193 rb-962uigs-5hact2hnt|\
196 ucidef_add_switch
"switch0" \
197 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
205 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
206 ucidef_add_switch
"switch0" \
207 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
213 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
214 ucidef_add_switch
"switch0" \
215 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
220 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
221 ucidef_add_switch
"switch0" \
222 "1:lan" "2:lan" "5@eth1"
227 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
228 ucidef_add_switch
"switch0" \
229 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
234 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
235 ucidef_add_switch
"switch0" \
236 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
239 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
240 ucidef_add_switch
"switch0" \
241 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
246 ucidef_set_interface_lan
"eth1"
249 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
250 ucidef_add_switch
"switch0" \
251 "0@eth1" "1:lan" "3:lan"
254 ucidef_add_switch
"switch0" \
255 "0@eth0" "3:wan" "4:lan"
258 ucidef_set_interface_lan
"eth0" "dhcp"
264 ucidef_add_switch
"switch0" \
265 "0@eth0" "5:lan" "4:wan"
268 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
269 ucidef_add_switch
"switch0" \
270 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
280 ucidef_add_switch
"switch0" \
281 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
284 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
287 ucidef_add_switch
"switch0" \
288 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
301 ucidef_add_switch
"switch0" \
302 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
305 ucidef_add_switch
"switch0" \
306 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
310 ucidef_add_switch
"switch1" \
311 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
325 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
326 ucidef_add_switch
"switch0" \
327 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
330 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
331 ucidef_add_switch
"switch0" \
332 "0@eth0" "1:lan" "2:lan" "3:lan"
338 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
339 ucidef_add_switch
"switch0" \
340 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
343 ucidef_set_interface_lan
"eth0"
344 ucidef_add_switch
"switch0" \
345 "0u@eth0" "2:lan" "3:lan" "4:lan"
346 ucidef_add_switch_attr
"switch0" "enable" "false"
349 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
350 ucidef_add_switch
"switch0" \
351 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
354 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
355 ucidef_add_switch
"switch0" \
356 "0:lan" "1:lan" "3@eth1"
364 ucidef_add_switch
"switch0" \
365 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
368 ucidef_add_switch
"switch0" \
369 "0@eth0" "1:lan" "2:lan" "3:wan"
372 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
373 ucidef_add_switch
"switch0" \
374 "0@eth0" "2:lan" "3:lan"
378 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
379 ucidef_add_switch
"switch0" \
380 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
384 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
385 ucidef_add_switch
"switch0" \
386 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
389 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
390 ucidef_add_switch
"switch0" \
391 "0@eth0" "1:lan" "5:wan" "6@eth1"
394 ucidef_add_switch
"switch0" \
395 "0@eth0" "5:lan" "1:wan"
398 ucidef_set_interface_lan
"wlan0"
401 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
402 ucidef_add_switch
"switch0" \
403 "0@eth1" "1:lan" "2:lan"
406 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
407 ucidef_add_switch
"switch0" \
408 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
411 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
412 ucidef_add_switch
"switch0" \
413 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
416 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
417 ucidef_add_switch
"switch0" \
418 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
419 ucidef_add_switch
"switch1" \
420 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
423 ucidef_add_switch
"switch0" \
424 "0@eth0" "1:wan" "2:lan"
427 ucidef_set_interface_wan
"eth0"
428 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
435 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
436 ucidef_add_switch
"switch0" \
437 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
442 ucidef_add_switch
"switch0" \
443 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
446 ucidef_add_switch
"switch0" \
447 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
450 ucidef_add_switch
"switch0" \
451 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
454 ucidef_add_switch
"switch0" \
455 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
459 ucidef_set_interface_raw
"eth" "eth0"
460 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
464 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
465 ucidef_add_switch
"switch0" \
466 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
470 ucidef_add_switch
"switch0" \
471 "0@eth0" "1:lan" "2:wan"
475 ucidef_add_switch
"switch0" \
476 "0@eth0" "2:lan" "3:wan"
482 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
483 ucidef_add_switch
"switch0" \
484 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
486 ucidef_add_switch_attr
"switch0" "blinkrate" 2
487 ucidef_add_switch_port_attr
"switch0" 1 led
6
488 ucidef_add_switch_port_attr
"switch0" 2 led
9
489 ucidef_add_switch_port_attr
"switch0" 5 led
2
492 ucidef_add_switch
"switch0" \
493 "0@eth0" "3:lan" "2:wan"
496 ucidef_add_switch
"switch0" \
497 "5:lan" "1:wan" "6@eth0"
500 ucidef_add_switch
"switch0" \
501 "0@eth0" "2:lan" "3:wan"
504 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
505 ucidef_add_switch
"switch0" \
506 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
509 ucidef_add_switch
"switch0" \
510 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
513 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
514 ucidef_add_switch
"switch0" \
515 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
518 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
532 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
538 lan_mac
=$
(mtd_get_mac_binary caldata
0)
539 wan_mac
=$
(mtd_get_mac_binary caldata
6)
542 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
545 lan_mac
=$
(mtd_get_mac_binary product-info
8)
546 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
549 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
553 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
557 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
561 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
562 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
567 ar71xx_setup_interfaces
$board
568 ar71xx_setup_macs
$board