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"
138 ucidef_set_interface_lan
"eth0"
165 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
171 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
172 ucidef_add_switch
"switch0" \
173 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
183 ucidef_set_interface_lan
"eth0 eth1"
186 ucidef_add_switch
"switch0" \
187 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
195 rb-962uigs-5hact2hnt|\
198 ucidef_add_switch
"switch0" \
199 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
207 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
208 ucidef_add_switch
"switch0" \
209 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
215 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
216 ucidef_add_switch
"switch0" \
217 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
222 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
223 ucidef_add_switch
"switch0" \
224 "1:lan" "2:lan" "5@eth1"
229 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
230 ucidef_add_switch
"switch0" \
231 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
236 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
237 ucidef_add_switch
"switch0" \
238 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
241 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
242 ucidef_add_switch
"switch0" \
243 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
248 ucidef_set_interface_lan
"eth1"
251 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
252 ucidef_add_switch
"switch0" \
253 "0@eth1" "1:lan" "3:lan"
256 ucidef_add_switch
"switch0" \
257 "0@eth0" "3:wan" "4:lan"
260 ucidef_set_interface_lan
"eth0" "dhcp"
266 ucidef_add_switch
"switch0" \
267 "0@eth0" "5:lan" "4:wan"
270 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
271 ucidef_add_switch
"switch0" \
272 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
283 ucidef_add_switch
"switch0" \
284 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
287 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
290 ucidef_add_switch
"switch0" \
291 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
304 ucidef_add_switch
"switch0" \
305 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
308 ucidef_add_switch
"switch0" \
309 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
313 ucidef_add_switch
"switch1" \
314 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
328 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
329 ucidef_add_switch
"switch0" \
330 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
333 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
334 ucidef_add_switch
"switch0" \
335 "0@eth0" "1:lan" "2:lan" "3:lan"
341 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
342 ucidef_add_switch
"switch0" \
343 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
346 ucidef_set_interface_lan
"eth0"
347 ucidef_add_switch
"switch0" \
348 "0u@eth0" "2:lan" "3:lan" "4:lan"
349 ucidef_add_switch_attr
"switch0" "enable" "false"
352 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
353 ucidef_add_switch
"switch0" \
354 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
357 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
358 ucidef_add_switch
"switch0" \
359 "0:lan" "1:lan" "3@eth1"
367 ucidef_add_switch
"switch0" \
368 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
371 ucidef_add_switch
"switch0" \
372 "0@eth0" "1:lan" "2:lan" "3:wan"
375 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
376 ucidef_add_switch
"switch0" \
377 "0@eth0" "2:lan" "3:lan"
381 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
382 ucidef_add_switch
"switch0" \
383 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
387 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
388 ucidef_add_switch
"switch0" \
389 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
392 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
393 ucidef_add_switch
"switch0" \
394 "0@eth0" "1:lan" "5:wan" "6@eth1"
397 ucidef_add_switch
"switch0" \
398 "0@eth0" "5:lan" "1:wan"
401 ucidef_set_interface_lan
"wlan0"
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
"eth1.1" "eth0"
410 ucidef_add_switch
"switch0" \
411 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
414 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
415 ucidef_add_switch
"switch0" \
416 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
419 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
420 ucidef_add_switch
"switch0" \
421 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
422 ucidef_add_switch
"switch1" \
423 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
426 ucidef_add_switch
"switch0" \
427 "0@eth0" "1:wan" "2:lan"
430 ucidef_set_interface_wan
"eth0"
431 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
438 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
439 ucidef_add_switch
"switch0" \
440 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
445 ucidef_add_switch
"switch0" \
446 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
449 ucidef_add_switch
"switch0" \
450 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
453 ucidef_add_switch
"switch0" \
454 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
457 ucidef_add_switch
"switch0" \
458 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
462 ucidef_set_interface_raw
"eth" "eth0"
463 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
467 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
468 ucidef_add_switch
"switch0" \
469 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
473 ucidef_add_switch
"switch0" \
474 "0@eth0" "1:lan" "2:wan"
478 ucidef_add_switch
"switch0" \
479 "0@eth0" "2:lan" "3:wan"
485 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
486 ucidef_add_switch
"switch0" \
487 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
489 ucidef_add_switch_attr
"switch0" "blinkrate" 2
490 ucidef_add_switch_port_attr
"switch0" 1 led
6
491 ucidef_add_switch_port_attr
"switch0" 2 led
9
492 ucidef_add_switch_port_attr
"switch0" 5 led
2
495 ucidef_add_switch
"switch0" \
496 "0@eth0" "3:lan" "2:wan"
499 ucidef_add_switch
"switch0" \
500 "5:lan" "1:wan" "6@eth0"
503 ucidef_add_switch
"switch0" \
504 "0@eth0" "2:lan" "3:wan"
507 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
508 ucidef_add_switch
"switch0" \
509 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
512 ucidef_add_switch
"switch0" \
513 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
516 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
517 ucidef_add_switch
"switch0" \
518 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
521 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
535 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
541 lan_mac
=$
(mtd_get_mac_binary caldata
0)
542 wan_mac
=$
(mtd_get_mac_binary caldata
6)
545 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
549 lan_mac
=$
(mtd_get_mac_binary product-info
8)
550 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
553 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
557 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
561 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
565 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
566 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
571 ar71xx_setup_interfaces
$board
572 ar71xx_setup_macs
$board