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" "eth1"
56 ucidef_add_switch
"switch0" \
57 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
120 ucidef_set_interface_lan
"eth0"
144 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
153 ucidef_set_interface_lan
"eth0 eth1"
156 ucidef_add_switch
"switch0" \
157 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
167 ucidef_add_switch
"switch0" \
168 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
176 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
177 ucidef_add_switch
"switch0" \
178 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
184 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
185 ucidef_add_switch
"switch0" \
186 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
191 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
192 ucidef_add_switch
"switch0" \
193 "1:lan" "2:lan" "5@eth1"
198 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
199 ucidef_add_switch
"switch0" \
200 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
205 ucidef_set_interface_lan
"eth1"
208 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
209 ucidef_add_switch
"switch0" \
210 "0@eth1" "1:lan" "3:lan"
213 ucidef_add_switch
"switch0" \
214 "0@eth0" "3:wan" "4:lan"
217 ucidef_set_interface_lan
"eth0" "dhcp"
223 ucidef_add_switch
"switch0" \
224 "0@eth0" "5:lan" "4:wan"
227 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
228 ucidef_add_switch
"switch0" \
229 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
241 ucidef_add_switch
"switch0" \
242 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
245 ucidef_add_switch
"switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
248 ucidef_add_switch
"switch0" \
249 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
261 ucidef_add_switch
"switch0" \
262 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
265 ucidef_add_switch
"switch0" \
266 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
270 ucidef_add_switch
"switch1" \
271 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
288 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
289 ucidef_add_switch
"switch0" \
290 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth1"
296 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
297 ucidef_add_switch
"switch0" \
298 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
301 ucidef_set_interface_lan
"eth0"
302 ucidef_add_switch
"switch0" \
303 "0@eth0" "2:lan" "3:lan" "4:lan"
304 ucidef_add_switch_attr
"switch0" "enable" "false"
307 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
308 ucidef_add_switch
"switch0" \
309 "0:lan" "1:lan" "3@eth1"
315 ucidef_add_switch
"switch0" \
316 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
319 ucidef_add_switch
"switch0" \
320 "0@eth0" "1:lan" "2:lan" "3:wan"
323 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
324 ucidef_add_switch
"switch0" \
325 "0@eth0" "2:lan" "3:lan"
329 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
330 ucidef_add_switch
"switch0" \
331 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
335 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
336 ucidef_add_switch
"switch0" \
337 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
340 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
341 ucidef_add_switch
"switch0" \
342 "0@eth0" "1:lan" "5:wan" "6@eth1"
345 ucidef_add_switch
"switch0" \
346 "0@eth0" "5:lan" "1:wan"
349 ucidef_set_interface_lan
"wlan0"
352 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
353 ucidef_add_switch
"switch0" \
354 "0@eth1" "1:lan" "2:lan"
357 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
358 ucidef_add_switch
"switch0" \
359 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
362 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
363 ucidef_add_switch
"switch0" \
364 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
367 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
368 ucidef_add_switch
"switch0" \
369 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
372 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
373 ucidef_add_switch
"switch0" \
374 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
375 ucidef_add_switch
"switch1" \
376 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
379 ucidef_set_interface_wan
"eth0"
380 ucidef_set_interface_raw
"wlan" "wlan0" "dhcp"
384 ucidef_add_switch
"switch0" \
385 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
388 ucidef_add_switch
"switch0" \
389 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
392 ucidef_add_switch
"switch0" \
393 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
396 ucidef_add_switch
"switch0" \
397 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
401 ucidef_set_interface_raw
"eth" "eth0"
402 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
405 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
406 ucidef_add_switch
"switch0" \
407 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
410 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
411 ucidef_add_switch
"switch0" \
412 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
416 ucidef_add_switch
"switch0" \
417 "0@eth0" "1:lan" "2:wan"
421 ucidef_add_switch
"switch0" \
422 "0@eth0" "2:lan" "3:wan"
428 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
429 ucidef_add_switch
"switch0" \
430 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
432 ucidef_add_switch_attr
"switch0" "blinkrate" 2
433 ucidef_add_switch_port_attr
"switch0" 1 led
6
434 ucidef_add_switch_port_attr
"switch0" 2 led
9
435 ucidef_add_switch_port_attr
"switch0" 5 led
2
438 ucidef_add_switch
"switch0" \
439 "0@eth0" "3:lan" "2:wan"
442 ucidef_add_switch
"switch0" \
443 "5:lan" "1:wan" "6@eth0"
446 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
447 ucidef_add_switch
"switch0" \
448 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
451 ucidef_add_switch
"switch0" \
452 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
455 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
456 ucidef_add_switch
"switch0" \
457 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
460 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
474 wan_mac
=$
(mtd_get_mac_ascii nvram
"wan_mac")
480 lan_mac
=$
(mtd_get_mac_binary caldata
0)
481 wan_mac
=$
(mtd_get_mac_binary caldata
6)
484 wan_mac
=$
(mtd_get_mac_binary config
0x1017c)
487 wan_mac
=$
(mtd_get_mac_ascii u-boot-env
"wanaddr")
491 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
495 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
496 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
500 board
=$
(ar71xx_board_name
)
501 ar71xx_setup_interfaces
$board
502 ar71xx_setup_macs
$board