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"
134 ucidef_set_interface_lan
"eth0"
161 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
166 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
167 ucidef_add_switch
"switch0" \
168 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
177 ucidef_set_interface_lan
"eth0 eth1"
180 ucidef_add_switch
"switch0" \
181 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
189 rb-962uigs-5hact2hnt|\
192 ucidef_add_switch
"switch0" \
193 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
201 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
202 ucidef_add_switch
"switch0" \
203 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
209 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
210 ucidef_add_switch
"switch0" \
211 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
216 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
217 ucidef_add_switch
"switch0" \
218 "1:lan" "2:lan" "5@eth1"
223 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
224 ucidef_add_switch
"switch0" \
225 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
230 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
231 ucidef_add_switch
"switch0" \
232 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
235 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
236 ucidef_add_switch
"switch0" \
237 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
242 ucidef_set_interface_lan
"eth1"
245 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
246 ucidef_add_switch
"switch0" \
247 "0@eth1" "1:lan" "3:lan"
250 ucidef_add_switch
"switch0" \
251 "0@eth0" "3:wan" "4:lan"
254 ucidef_set_interface_lan
"eth0" "dhcp"
260 ucidef_add_switch
"switch0" \
261 "0@eth0" "5:lan" "4:wan"
264 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
265 ucidef_add_switch
"switch0" \
266 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
276 ucidef_add_switch
"switch0" \
277 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
280 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
283 ucidef_add_switch
"switch0" \
284 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
297 ucidef_add_switch
"switch0" \
298 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
301 ucidef_add_switch
"switch0" \
302 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
306 ucidef_add_switch
"switch1" \
307 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
321 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
322 ucidef_add_switch
"switch0" \
323 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
326 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
327 ucidef_add_switch
"switch0" \
328 "0@eth0" "1:lan" "2:lan" "3:lan"
334 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
335 ucidef_add_switch
"switch0" \
336 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
339 ucidef_set_interface_lan
"eth0"
340 ucidef_add_switch
"switch0" \
341 "0u@eth0" "2:lan" "3:lan" "4:lan"
342 ucidef_add_switch_attr
"switch0" "enable" "false"
345 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
346 ucidef_add_switch
"switch0" \
347 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
350 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
351 ucidef_add_switch
"switch0" \
352 "0:lan" "1:lan" "3@eth1"
360 ucidef_add_switch
"switch0" \
361 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
364 ucidef_add_switch
"switch0" \
365 "0@eth0" "1:lan" "2:lan" "3:wan"
368 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
369 ucidef_add_switch
"switch0" \
370 "0@eth0" "2:lan" "3:lan"
374 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
375 ucidef_add_switch
"switch0" \
376 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
380 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
381 ucidef_add_switch
"switch0" \
382 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
385 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
386 ucidef_add_switch
"switch0" \
387 "0@eth0" "1:lan" "5:wan" "6@eth1"
390 ucidef_add_switch
"switch0" \
391 "0@eth0" "5:lan" "1:wan"
394 ucidef_set_interface_lan
"wlan0"
397 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
398 ucidef_add_switch
"switch0" \
399 "0@eth1" "1:lan" "2:lan"
402 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
403 ucidef_add_switch
"switch0" \
404 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
407 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
408 ucidef_add_switch
"switch0" \
409 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
412 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
413 ucidef_add_switch
"switch0" \
414 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
415 ucidef_add_switch
"switch1" \
416 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
419 ucidef_set_interface_wan
"eth0"
420 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
427 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
428 ucidef_add_switch
"switch0" \
429 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
434 ucidef_add_switch
"switch0" \
435 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
438 ucidef_add_switch
"switch0" \
439 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
442 ucidef_add_switch
"switch0" \
443 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
446 ucidef_add_switch
"switch0" \
447 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
451 ucidef_set_interface_raw
"eth" "eth0"
452 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
456 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
457 ucidef_add_switch
"switch0" \
458 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
462 ucidef_add_switch
"switch0" \
463 "0@eth0" "1:lan" "2:wan"
467 ucidef_add_switch
"switch0" \
468 "0@eth0" "2:lan" "3:wan"
474 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
475 ucidef_add_switch
"switch0" \
476 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
478 ucidef_add_switch_attr
"switch0" "blinkrate" 2
479 ucidef_add_switch_port_attr
"switch0" 1 led
6
480 ucidef_add_switch_port_attr
"switch0" 2 led
9
481 ucidef_add_switch_port_attr
"switch0" 5 led
2
484 ucidef_add_switch
"switch0" \
485 "0@eth0" "3:lan" "2:wan"
488 ucidef_add_switch
"switch0" \
489 "5:lan" "1:wan" "6@eth0"
492 ucidef_add_switch
"switch0" \
493 "0@eth0" "2:lan" "3:wan"
496 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
497 ucidef_add_switch
"switch0" \
498 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
501 ucidef_add_switch
"switch0" \
502 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
505 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
506 ucidef_add_switch
"switch0" \
507 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
510 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
524 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
530 lan_mac
=$
(mtd_get_mac_binary caldata
0)
531 wan_mac
=$
(mtd_get_mac_binary caldata
6)
534 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
537 lan_mac
=$
(mtd_get_mac_binary product-info
8)
538 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
541 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
545 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
549 wan_mac
=$
(mtd_get_mac_binary u-boot
0x2e018)
553 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
554 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
559 ar71xx_setup_interfaces
$board
560 ar71xx_setup_macs
$board