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"
141 ucidef_set_interface_lan
"eth0"
168 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
174 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
175 ucidef_add_switch
"switch0" \
176 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
186 ucidef_set_interface_lan
"eth0 eth1"
189 ucidef_add_switch
"switch0" \
190 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
198 rb-962uigs-5hact2hnt|\
201 ucidef_add_switch
"switch0" \
202 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
210 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
211 ucidef_add_switch
"switch0" \
212 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
218 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
219 ucidef_add_switch
"switch0" \
220 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
225 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
226 ucidef_add_switch
"switch0" \
227 "1:lan" "2:lan" "5@eth1"
232 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
233 ucidef_add_switch
"switch0" \
234 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
239 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
240 ucidef_add_switch
"switch0" \
241 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
244 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
245 ucidef_add_switch
"switch0" \
246 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
251 ucidef_set_interface_lan
"eth1"
254 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
255 ucidef_add_switch
"switch0" \
256 "0@eth1" "1:lan" "3:lan"
259 ucidef_add_switch
"switch0" \
260 "0@eth0" "3:wan" "4:lan"
263 ucidef_set_interface_lan
"eth0" "dhcp"
269 ucidef_add_switch
"switch0" \
270 "0@eth0" "5:lan" "4:wan"
273 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
274 ucidef_add_switch
"switch0" \
275 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
286 ucidef_add_switch
"switch0" \
287 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
290 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
293 ucidef_add_switch
"switch0" \
294 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
307 ucidef_add_switch
"switch0" \
308 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
311 ucidef_add_switch
"switch0" \
312 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
316 ucidef_add_switch
"switch1" \
317 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
331 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
332 ucidef_add_switch
"switch0" \
333 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
336 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
337 ucidef_add_switch
"switch0" \
338 "0@eth0" "1:lan" "2:lan" "3:lan"
344 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
345 ucidef_add_switch
"switch0" \
346 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
349 ucidef_set_interface_lan
"eth0"
350 ucidef_add_switch
"switch0" \
351 "0u@eth0" "2:lan" "3:lan" "4:lan"
352 ucidef_add_switch_attr
"switch0" "enable" "false"
355 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
356 ucidef_add_switch
"switch0" \
357 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
360 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
361 ucidef_add_switch
"switch0" \
362 "0:lan" "1:lan" "3@eth1"
370 ucidef_add_switch
"switch0" \
371 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
374 ucidef_add_switch
"switch0" \
375 "0@eth0" "1:lan" "2:lan" "3:wan"
378 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
379 ucidef_add_switch
"switch0" \
380 "0@eth0" "2:lan" "3:lan"
384 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
385 ucidef_add_switch
"switch0" \
386 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
390 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
391 ucidef_add_switch
"switch0" \
392 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
396 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
397 ucidef_add_switch
"switch0" \
398 "0@eth1" "1:lan" "2:lan"
401 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
402 ucidef_add_switch
"switch0" \
403 "0@eth0" "1:lan" "5:wan" "6@eth1"
406 ucidef_add_switch
"switch0" \
407 "0@eth0" "5:lan" "1:wan"
410 ucidef_set_interface_lan
"wlan0"
413 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
414 ucidef_add_switch
"switch0" \
415 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
418 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
419 ucidef_add_switch
"switch0" \
420 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
423 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
424 ucidef_add_switch
"switch0" \
425 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
426 ucidef_add_switch
"switch1" \
427 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
430 ucidef_add_switch
"switch0" \
431 "0@eth0" "1:wan" "2:lan"
434 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
435 ucidef_add_switch
"switch0" \
436 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
439 ucidef_set_interface_wan
"eth0"
440 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
447 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
448 ucidef_add_switch
"switch0" \
449 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
454 ucidef_add_switch
"switch0" \
455 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
458 ucidef_add_switch
"switch0" \
459 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
462 ucidef_add_switch
"switch0" \
463 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
466 ucidef_add_switch
"switch0" \
467 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
471 ucidef_set_interface_raw
"eth" "eth0"
472 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
476 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
477 ucidef_add_switch
"switch0" \
478 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
482 ucidef_add_switch
"switch0" \
483 "0@eth0" "1:lan" "2:wan"
487 ucidef_add_switch
"switch0" \
488 "0@eth0" "2:lan" "3:wan"
494 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
495 ucidef_add_switch
"switch0" \
496 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
498 ucidef_add_switch_attr
"switch0" "blinkrate" 2
499 ucidef_add_switch_port_attr
"switch0" 1 led
6
500 ucidef_add_switch_port_attr
"switch0" 2 led
9
501 ucidef_add_switch_port_attr
"switch0" 5 led
2
504 ucidef_add_switch
"switch0" \
505 "0@eth0" "3:lan" "2:wan"
508 ucidef_add_switch
"switch0" \
509 "5:lan" "1:wan" "6@eth0"
512 ucidef_add_switch
"switch0" \
513 "0@eth0" "2:lan" "3:wan"
516 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
517 ucidef_add_switch
"switch0" \
518 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
521 ucidef_add_switch
"switch0" \
522 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
525 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
526 ucidef_add_switch
"switch0" \
527 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
530 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
544 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
550 lan_mac
=$
(mtd_get_mac_binary caldata
0)
551 wan_mac
=$
(mtd_get_mac_binary caldata
6)
554 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
558 lan_mac
=$
(mtd_get_mac_binary product-info
8)
559 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
562 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
566 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
569 lan_mac
=$
(mtd_get_mac_ascii u-boot-env
"ethaddr")
570 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
574 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
578 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
579 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
584 ar71xx_setup_interfaces
$board
585 ar71xx_setup_macs
$board