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"
54 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
55 ucidef_add_switch
"switch0" \
56 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
119 ucidef_set_interface_lan
"eth0"
143 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
147 ucidef_set_interfaces_lan_wan
"eth1.1" "eth0"
148 ucidef_add_switch
"switch0" \
149 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
158 ucidef_set_interface_lan
"eth0 eth1"
161 ucidef_add_switch
"switch0" \
162 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
172 ucidef_add_switch
"switch0" \
173 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
181 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
182 ucidef_add_switch
"switch0" \
183 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
189 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
190 ucidef_add_switch
"switch0" \
191 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
196 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
197 ucidef_add_switch
"switch0" \
198 "1:lan" "2:lan" "5@eth1"
203 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
204 ucidef_add_switch
"switch0" \
205 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
210 ucidef_set_interface_lan
"eth1"
213 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
214 ucidef_add_switch
"switch0" \
215 "0@eth1" "1:lan" "3:lan"
218 ucidef_add_switch
"switch0" \
219 "0@eth0" "3:wan" "4:lan"
222 ucidef_set_interface_lan
"eth0" "dhcp"
228 ucidef_add_switch
"switch0" \
229 "0@eth0" "5:lan" "4:wan"
232 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
233 ucidef_add_switch
"switch0" \
234 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
246 ucidef_add_switch
"switch0" \
247 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
250 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
253 ucidef_add_switch
"switch0" \
254 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
266 ucidef_add_switch
"switch0" \
267 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
270 ucidef_add_switch
"switch0" \
271 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
275 ucidef_add_switch
"switch1" \
276 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
293 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
294 ucidef_add_switch
"switch0" \
295 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth1"
301 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
302 ucidef_add_switch
"switch0" \
303 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
306 ucidef_set_interface_lan
"eth0"
307 ucidef_add_switch
"switch0" \
308 "0@eth0" "2:lan" "3:lan" "4:lan"
309 ucidef_add_switch_attr
"switch0" "enable" "false"
312 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
313 ucidef_add_switch
"switch0" \
314 "0:lan" "1:lan" "3@eth1"
320 ucidef_add_switch
"switch0" \
321 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
324 ucidef_add_switch
"switch0" \
325 "0@eth0" "1:lan" "2:lan" "3:wan"
328 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
329 ucidef_add_switch
"switch0" \
330 "0@eth0" "2:lan" "3:lan"
334 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
335 ucidef_add_switch
"switch0" \
336 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
340 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
341 ucidef_add_switch
"switch0" \
342 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
345 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
346 ucidef_add_switch
"switch0" \
347 "0@eth0" "1:lan" "5:wan" "6@eth1"
350 ucidef_add_switch
"switch0" \
351 "0@eth0" "5:lan" "1:wan"
354 ucidef_set_interface_lan
"wlan0"
357 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
358 ucidef_add_switch
"switch0" \
359 "0@eth1" "1:lan" "2:lan"
362 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
363 ucidef_add_switch
"switch0" \
364 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
367 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
368 ucidef_add_switch
"switch0" \
369 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
372 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
373 ucidef_add_switch
"switch0" \
374 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
377 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
378 ucidef_add_switch
"switch0" \
379 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
380 ucidef_add_switch
"switch1" \
381 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
384 ucidef_set_interface_wan
"eth0"
385 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
389 ucidef_add_switch
"switch0" \
390 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
393 ucidef_add_switch
"switch0" \
394 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
397 ucidef_add_switch
"switch0" \
398 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
401 ucidef_add_switch
"switch0" \
402 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
406 ucidef_set_interface_raw
"eth" "eth0"
407 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
411 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
412 ucidef_add_switch
"switch0" \
413 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
416 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
417 ucidef_add_switch
"switch0" \
418 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
422 ucidef_add_switch
"switch0" \
423 "0@eth0" "1:lan" "2:wan"
427 ucidef_add_switch
"switch0" \
428 "0@eth0" "2:lan" "3:wan"
434 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
435 ucidef_add_switch
"switch0" \
436 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
438 ucidef_add_switch_attr
"switch0" "blinkrate" 2
439 ucidef_add_switch_port_attr
"switch0" 1 led
6
440 ucidef_add_switch_port_attr
"switch0" 2 led
9
441 ucidef_add_switch_port_attr
"switch0" 5 led
2
444 ucidef_add_switch
"switch0" \
445 "0@eth0" "3:lan" "2:wan"
448 ucidef_add_switch
"switch0" \
449 "5:lan" "1:wan" "6@eth0"
452 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
453 ucidef_add_switch
"switch0" \
454 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
457 ucidef_add_switch
"switch0" \
458 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
461 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
462 ucidef_add_switch
"switch0" \
463 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
466 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
480 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
486 lan_mac
=$
(mtd_get_mac_binary caldata
0)
487 wan_mac
=$
(mtd_get_mac_binary caldata
6)
490 lan_mac
=$
(mtd_get_mac_binary product-info
8)
491 wan_mac
=$
(macaddr_add
"$lan_mac" 1)
494 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
498 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
502 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
503 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
507 board
=$
(ar71xx_board_name
)
508 ar71xx_setup_interfaces
$board
509 ar71xx_setup_macs
$board