3 # Copyright (C) 2011-2015 OpenWrt.org
6 .
/lib
/functions
/system.sh
7 .
/lib
/functions
/uci-defaults.sh
10 ar71xx_setup_interfaces
()
16 ucidef_add_switch
"switch0" \
17 "0@eth0" "4:lan" "5:wan"
55 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
56 ucidef_add_switch
"switch0" \
57 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
123 ucidef_set_interface_lan
"eth0"
149 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
159 ucidef_set_interface_lan
"eth0 eth1"
162 ucidef_add_switch
"switch0" \
163 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
173 ucidef_add_switch
"switch0" \
174 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
182 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
183 ucidef_add_switch
"switch0" \
184 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
190 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
191 ucidef_add_switch
"switch0" \
192 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
197 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
198 ucidef_add_switch
"switch0" \
199 "1:lan" "2:lan" "5@eth1"
204 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
205 ucidef_add_switch
"switch0" \
206 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
210 ucidef_add_switch
"switch0" \
211 "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan"
216 ucidef_set_interface_lan
"eth1"
219 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
220 ucidef_add_switch
"switch0" \
221 "0@eth1" "1:lan" "3:lan"
224 ucidef_add_switch
"switch0" \
225 "0@eth0" "3:wan" "4:lan"
228 ucidef_set_interface_lan
"eth0" "dhcp"
234 ucidef_add_switch
"switch0" \
235 "0@eth0" "5:lan" "4:wan"
238 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
239 ucidef_add_switch
"switch0" \
240 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
252 ucidef_add_switch
"switch0" \
253 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
256 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
259 ucidef_add_switch
"switch0" \
260 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
272 ucidef_add_switch
"switch0" \
273 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
276 ucidef_add_switch
"switch0" \
277 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
281 ucidef_add_switch
"switch1" \
282 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
299 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
300 ucidef_add_switch
"switch0" \
301 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth1"
307 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
308 ucidef_add_switch
"switch0" \
309 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
312 ucidef_set_interface_lan
"eth0"
313 ucidef_add_switch
"switch0" \
314 "0u@eth0" "2:lan" "3:lan" "4:lan"
315 ucidef_add_switch_attr
"switch0" "enable" "false"
318 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
319 ucidef_add_switch
"switch0" \
320 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
323 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
324 ucidef_add_switch
"switch0" \
325 "0:lan" "1:lan" "3@eth1"
331 ucidef_add_switch
"switch0" \
332 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
335 ucidef_add_switch
"switch0" \
336 "0@eth0" "1:lan" "2:lan" "3:wan"
339 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
340 ucidef_add_switch
"switch0" \
341 "0@eth0" "2:lan" "3:lan"
345 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0.2"
346 ucidef_add_switch
"switch0" \
347 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
351 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
352 ucidef_add_switch
"switch0" \
353 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
356 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1.2"
357 ucidef_add_switch
"switch0" \
358 "0@eth0" "1:lan" "5:wan" "6@eth1"
361 ucidef_add_switch
"switch0" \
362 "0@eth0" "5:lan" "1:wan"
365 ucidef_set_interface_lan
"wlan0"
368 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
369 ucidef_add_switch
"switch0" \
370 "0@eth1" "1:lan" "2:lan"
373 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
374 ucidef_add_switch
"switch0" \
375 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
378 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
379 ucidef_add_switch
"switch0" \
380 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
383 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
384 ucidef_add_switch
"switch0" \
385 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
388 ucidef_set_interfaces_lan_wan
"eth0.1 eth1.1" "eth1.2"
389 ucidef_add_switch
"switch0" \
390 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
391 ucidef_add_switch
"switch1" \
392 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
395 ucidef_set_interface_wan
"eth0"
396 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
400 ucidef_add_switch
"switch0" \
401 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
404 ucidef_add_switch
"switch0" \
405 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
408 ucidef_add_switch
"switch0" \
409 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
412 ucidef_add_switch
"switch0" \
413 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
417 ucidef_set_interface_raw
"eth" "eth0"
418 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
421 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
422 ucidef_add_switch
"switch0" \
423 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
426 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
427 ucidef_add_switch
"switch0" \
428 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
432 ucidef_add_switch
"switch0" \
433 "0@eth0" "1:lan" "2:wan"
437 ucidef_add_switch
"switch0" \
438 "0@eth0" "2:lan" "3:wan"
444 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
445 ucidef_add_switch
"switch0" \
446 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
448 ucidef_add_switch_attr
"switch0" "blinkrate" 2
449 ucidef_add_switch_port_attr
"switch0" 1 led
6
450 ucidef_add_switch_port_attr
"switch0" 2 led
9
451 ucidef_add_switch_port_attr
"switch0" 5 led
2
454 ucidef_add_switch
"switch0" \
455 "0@eth0" "3:lan" "2:wan"
458 ucidef_add_switch
"switch0" \
459 "5:lan" "1:wan" "6@eth0"
462 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
463 ucidef_add_switch
"switch0" \
464 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
467 ucidef_add_switch
"switch0" \
468 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
471 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
472 ucidef_add_switch
"switch0" \
473 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
476 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
490 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
496 lan_mac
=$
(mtd_get_mac_binary caldata
0)
497 wan_mac
=$
(mtd_get_mac_binary caldata
6)
500 wan_mac
=$
(mtd_get_mac_binary config
0x1017c)
503 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
507 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
511 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
512 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
516 board
=$
(ar71xx_board_name
)
517 ar71xx_setup_interfaces
$board
518 ar71xx_setup_macs
$board