c1873c16537bf42ec76a6e7853356df90331ae30
[openwrt/openwrt.git] / target / linux / ar71xx / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2015 OpenWrt.org
4 #
5
6 . /lib/functions/system.sh
7 . /lib/functions/uci-defaults.sh
8
9 ar71xx_setup_interfaces()
10 {
11 local board="$1"
12
13 case "$board" in
14 airgatewaypro)
15 ucidef_add_switch "switch0" \
16 "0@eth0" "4:lan" "5:wan"
17 ;;
18 airrouter|\
19 ap121|\
20 ap121-mini|\
21 ap96|\
22 dir-600-a1|\
23 dir-615-c1|\
24 dir-615-e1|\
25 dir-615-e4|\
26 hiwifi-hc6361|\
27 ja76pf|\
28 mc-mac1200r|\
29 minibox-v1|\
30 mynet-n600|\
31 oolite-v1|\
32 oolite-v5.2|\
33 oolite-v5.2-dev|\
34 qihoo-c301|\
35 r602n|\
36 rb-750|\
37 rb-751|\
38 som9331|\
39 t830|\
40 tew-632brp|\
41 tew-712br|\
42 tew-732br|\
43 tl-mr3220|\
44 tl-mr3420|\
45 tl-wdr3320-v2|\
46 tl-wdr3500|\
47 tl-wr740n-v6|\
48 tl-wr840n-v2|\
49 tl-wr840n-v3|\
50 tl-wr841n-v11|\
51 tl-wr841n-v9|\
52 tl-wr842n-v3|\
53 whr-g301n|\
54 whr-hp-g300n|\
55 whr-hp-gn|\
56 wzr-hp-ag300h|\
57 zbt-we1526)
58 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
59 ucidef_add_switch "switch0" \
60 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
61 ;;
62 alfa-ap120c|\
63 all0305|\
64 antminer-s1|\
65 antminer-s3|\
66 antrouter-r1|\
67 ap121f|\
68 ap91-5g|\
69 aw-nr580|\
70 bullet-m|\
71 bullet-m-xw|\
72 c-55|\
73 cap324|\
74 cap4200ag|\
75 cf-e380ac-v1|\
76 cf-e380ac-v2|\
77 cpe210-v2|\
78 cpe210-v3|\
79 cpe510-v2|\
80 dr342|\
81 eap120|\
82 eap300v2|\
83 eap7660d|\
84 el-mini|\
85 fritz300e|\
86 fritz450e|\
87 gl-usb150|\
88 hiveap-121|\
89 koala|\
90 lbe-m5|\
91 loco-m-xw|\
92 mr12|\
93 mr16|\
94 mr1750|\
95 mr1750v2|\
96 mr18|\
97 mr600|\
98 mr600v2|\
99 mr900|\
100 mr900v2|\
101 mynet-rext|\
102 pqi-air-pen|\
103 rb-411|\
104 rb-411u|\
105 rb-911-2hn|\
106 rb-911-5hn|\
107 rb-911g-2hpnd|\
108 rb-911g-5hpacd|\
109 rb-911g-5hpnd|\
110 rb-912uag-2hpnd|\
111 rb-912uag-5hpnd|\
112 rb-921gs-5hpacd-r2|\
113 rb-922uags-5hpacd|\
114 rb-lhg-5nd|\
115 rb-mapl-2nd|\
116 rb-sxt2n|\
117 rb-sxt-2nd-r3|\
118 rb-sxt5n|\
119 rb-wap-2nd|\
120 rb-wapr-2nd|\
121 rb-wapg-5hact2hnd|\
122 re355|\
123 re450|\
124 rocket-m-xw|\
125 sc300m |\
126 tl-mr10u|\
127 tl-mr11u|\
128 tl-mr12u|\
129 tl-mr13u|\
130 tl-mr3020|\
131 tl-mr3040|\
132 tl-mr3040-v2|\
133 tl-wa701nd-v2|\
134 tl-wa7210n-v2|\
135 tl-wa750re|\
136 tl-wa801nd-v2|\
137 tl-wa830re-v2|\
138 tl-wa850re|\
139 tl-wa850re-v2|\
140 tl-wa855re-v1|\
141 tl-wa901nd|\
142 tl-wa901nd-v2|\
143 tl-wa901nd-v3|\
144 tl-wa901nd-v4|\
145 tl-wa901nd-v5|\
146 tl-wr703n|\
147 tl-wr802n-v1|\
148 tl-wr802n-v2|\
149 tl-wr902ac-v1|\
150 ts-d084|\
151 tube2h|\
152 unifi|\
153 unifiac-lite|\
154 wi2a-ac200i|\
155 wifi-pineapple-nano|\
156 wndap360|\
157 wp543)
158 ucidef_set_interface_lan "eth0"
159 ;;
160 a40|\
161 a60|\
162 alfa-ap96|\
163 alfa-nx|\
164 dr344|\
165 gl-ar150|\
166 gl-ar300m|\
167 gl-domino|\
168 gl-inet|\
169 gl-mifi|\
170 jwap003|\
171 om2p-hsv4|\
172 om2pv4|\
173 pb42|\
174 pb44|\
175 rb-951ui-2hnd|\
176 routerstation|\
177 tl-wr710n|\
178 tl-wr720n-v3|\
179 tl-wr810n|\
180 tl-wr810n-v2|\
181 wpe72|\
182 wrtnode2q)
183 ucidef_set_interfaces_lan_wan "eth1" "eth0"
184 ;;
185 all0258n|\
186 all0315n|\
187 dlan-hotspot|\
188 dlan-pro-500-wp|\
189 ja76pf2|\
190 rocket-m-ti|\
191 ubnt-unifi-outdoor)
192 ucidef_set_interface_lan "eth0 eth1"
193 ;;
194 wzr-hp-g300nh2)
195 ucidef_add_switch "switch0" \
196 "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
197 ;;
198 ap132|\
199 ap136|\
200 ap152|\
201 rb-750gl|\
202 rb-751g|\
203 rb-951g-2hnd|\
204 rb-962uigs-5hact2hnt|\
205 wlr8100|\
206 wzr-hp-g450h)
207 ucidef_add_switch "switch0" \
208 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
209 ;;
210 ap135-020|\
211 ap136-020|\
212 bhr-4grv2|\
213 tew-823dru|\
214 tl-wr1043nd-v2|\
215 wzr-450hp2)
216 ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
217 ucidef_add_switch "switch0" \
218 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
219 ;;
220 ap136-010|\
221 ap147-010|\
222 nbg6616|\
223 nbg6716)
224 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
225 ucidef_add_switch "switch0" \
226 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
227 ;;
228 ap143|\
229 rb-433|\
230 rb-433u)
231 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
232 ucidef_add_switch "switch0" \
233 "1:lan" "2:lan" "5@eth1"
234 ;;
235 archer-c5|\
236 archer-c7|\
237 tl-wdr4900-v2)
238 ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
239 ucidef_add_switch "switch0" \
240 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
241 ;;
242 archer-c25-v1|\
243 rb-750-r2|\
244 rb-750p-pbr2|\
245 rb-750up-r2|\
246 rb-951ui-2nd|\
247 rb-952ui-5ac2nd)
248 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
249 ucidef_add_switch "switch0" \
250 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
251 ;;
252 archer-c58-v1|\
253 archer-c59-v1|\
254 archer-c59-v2|\
255 fritz4020|\
256 rb-450g)
257 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
258 ucidef_add_switch "switch0" \
259 "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
260 ;;
261 archer-c60-v1|\
262 archer-c60-v2)
263 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
264 ucidef_add_switch "switch0" \
265 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
266 ;;
267 arduino-yun|\
268 dir-505-a1|\
269 tl-wa801nd-v3)
270 ucidef_set_interface_lan "eth1"
271 ;;
272 bsb)
273 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
274 ucidef_add_switch "switch0" \
275 "0@eth1" "1:lan" "3:lan"
276 ;;
277 c-60)
278 ucidef_add_switch "switch0" \
279 "0@eth0" "3:wan" "4:lan"
280 ;;
281 rme-eg200)
282 ucidef_set_interface_lan "eth0" "dhcp"
283 ;;
284 cf-e375ac|\
285 rb-map-2nd)
286 ucidef_add_switch "switch0" \
287 "0@eth0" "1:wan" "2:lan"
288 ;;
289 cf-e385ac)
290 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
291 ucidef_add_switch "switch0" \
292 "0@eth0" "2:lan" "1:wan" "6@eth1"
293 ;;
294 cpe210|\
295 cpe510|\
296 wbs210|\
297 wbs510)
298 ucidef_add_switch "switch0" \
299 "0@eth0" "5:lan" "4:wan"
300 ;;
301 cr3000)
302 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
303 ucidef_add_switch "switch0" \
304 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
305 ;;
306 cr5000|\
307 dgl-5500-a1|\
308 dhp-1565-a1|\
309 dir-825-c1|\
310 dir-835-a1|\
311 esr900|\
312 mynet-n750|\
313 sr3200)
314 ucidef_add_switch "switch0" \
315 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
316 ;;
317 tl-wr1043n-v5)
318 ucidef_add_switch "switch0" \
319 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
320 ;;
321 dap-2695-a1)
322 ucidef_add_switch "switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
323 ;;
324 rb-931-2nd)
325 ucidef_add_switch "switch0" \
326 "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1"
327 ;;
328 rb-941-2nd)
329 ucidef_add_switch "switch0" \
330 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
331 ;;
332 db120|\
333 rb-2011il|\
334 rb-2011ils|\
335 rb-2011l|\
336 rb-2011uas|\
337 rb-2011uas-2hnd|\
338 rb-2011uias|\
339 rb-2011uias-2hnd|\
340 rb-2011uias-2hnd-r2)
341 case "$board" in
342 rb-2011ils|\
343 rb-2011uas*|\
344 rb-2011uias|\
345 rb-2011uias-2hnd|\
346 rb-2011uias-2hnd-r2)
347 ucidef_add_switch "switch0" \
348 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
349 ;;
350 *)
351 ucidef_add_switch "switch0" \
352 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
353 ;;
354 esac
355
356 ucidef_add_switch "switch1" \
357 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
358 ;;
359 dir-615-i1|\
360 omy-g1|\
361 r6100|\
362 smart-300|\
363 tl-wdr6500-v2|\
364 tl-wr940n-v4|\
365 tl-wr940n-v6|\
366 tl-wr941nd-v6|\
367 wnr1000-v2|\
368 wnr2000-v4|\
369 wnr2200|\
370 wnr612-v2|\
371 wpn824n)
372 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
373 ucidef_add_switch "switch0" \
374 "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
375 ;;
376 tl-mr6400)
377 ucidef_set_interfaces_lan_wan "eth0.1 eth1" "usb0"
378 ucidef_add_switch "switch0" \
379 "0@eth0" "1:lan" "2:lan" "3:lan"
380 ;;
381 dir-825-b1|\
382 nbg460n_550n_550nh|\
383 tew-673gru|\
384 wzr-hp-g300nh)
385 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
386 ucidef_add_switch "switch0" \
387 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
388 ;;
389 dlan-pro-1200-ac)
390 ucidef_set_interface_lan "eth0"
391 ucidef_add_switch "switch0" \
392 "0u@eth0" "2:lan" "3:lan" "4:lan"
393 ucidef_add_switch_attr "switch0" "enable" "false"
394 ;;
395 e1700ac-v2|\
396 e750g-v8|\
397 unifiac-pro|\
398 xd3200)
399 ucidef_add_switch "switch0" \
400 "0@eth0" "2:lan" "3:wan"
401 ;;
402 e558-v2)
403 ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
404 ucidef_add_switch "switch0" \
405 "0@eth1" "4:lan" "5:lan" "6@eth0" "3:wan"
406 ;;
407 ebr-2310-c1)
408 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
409 ucidef_add_switch "switch0" \
410 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
411 ;;
412 el-m150)
413 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
414 ucidef_add_switch "switch0" \
415 "0:lan" "1:lan" "3@eth1"
416 ;;
417 dir-869-a1|\
418 epg5000|\
419 esr1750|\
420 tl-wr1043nd-v4|\
421 wndr3700v4|\
422 wndr4300)
423 ucidef_add_switch "switch0" \
424 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
425 ;;
426 ew-balin)
427 ucidef_set_interface "usb2" ifname "usb0" protocol "static"
428 ucidef_add_switch "switch0" \
429 "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
430 ;;
431 ew-dorin)
432 ucidef_add_switch "switch0" \
433 "0@eth0" "1:lan" "2:lan" "3:wan"
434 ;;
435 ew-dorin-router)
436 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
437 ucidef_add_switch "switch0" \
438 "0@eth0" "2:lan" "3:lan"
439 ;;
440 dw33d|\
441 f9k1115v2)
442 ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
443 ucidef_add_switch "switch0" \
444 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
445 ;;
446 gl-ar300|\
447 wnr2000-v3)
448 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
449 ucidef_add_switch "switch0" \
450 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
451 ;;
452 gl-ar750|\
453 rb-435g)
454 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
455 ucidef_add_switch "switch0" \
456 "0@eth1" "1:lan" "2:lan"
457 ;;
458 gl-ar750s)
459 ucidef_add_switch "switch0" \
460 "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
461 ;;
462 jwap230)
463 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
464 ucidef_add_switch "switch0" \
465 "0@eth0" "1:lan" "5:wan" "6@eth1"
466 ;;
467 nanostation-m-xw)
468 ucidef_add_switch "switch0" \
469 "0@eth0" "5:lan" "1:wan"
470 ;;
471 onion-omega)
472 ucidef_set_interface_lan "wlan0"
473 ;;
474 rb-450)
475 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
476 ucidef_add_switch "switch0" \
477 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
478 ;;
479 routerstation-pro)
480 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
481 ucidef_add_switch "switch0" \
482 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
483 ;;
484 rb-493g)
485 ucidef_set_interfaces_lan_wan "eth0.1 eth1.1" "eth1.2"
486 ucidef_add_switch "switch0" \
487 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
488 ucidef_add_switch "switch1" \
489 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
490 ;;
491 rut900)
492 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
493 ucidef_add_switch "switch0" \
494 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
495 ;;
496 tellstick-znet-lite)
497 ucidef_set_interface_wan "eth0"
498 ucidef_set_interface "wlan" ifname "wlan0" protocol "dhcp"
499 ;;
500 tl-mr3420-v2|\
501 tl-wr841n-v8|\
502 tl-wr842n-v2|\
503 tl-wr941nd-v5|\
504 tl-wr942n-v1)
505 ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
506 ucidef_add_switch "switch0" \
507 "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
508 ;;
509 archer-c7-v4|\
510 archer-c7-v5|\
511 tl-wdr4300|\
512 tl-wr1041n-v2)
513 ucidef_add_switch "switch0" \
514 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
515 ;;
516 tl-wpa8630)
517 ucidef_add_switch "switch0" \
518 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
519 ;;
520 tl-wr1043nd)
521 ucidef_add_switch "switch0" \
522 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
523 ;;
524 tl-wr2543n)
525 ucidef_add_switch "switch0" \
526 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
527 ;;
528 tl-mr3220-v2|\
529 tl-wr741nd-v4)
530 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
531 ucidef_add_switch "switch0" \
532 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
533 ;;
534 tl-wr841n-v1|\
535 tl-wr941nd)
536 ucidef_set_interface "eth" ifname "eth0"
537 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
538 ;;
539 tl-wr741nd|\
540 tl-wr841n-v7)
541 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
542 ucidef_add_switch "switch0" \
543 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
544 ;;
545 uap-pro|\
546 wpj342)
547 ucidef_add_switch "switch0" \
548 "0@eth0" "1:lan" "2:wan"
549 ;;
550 wndr3700|\
551 wndr3700v2|\
552 wndr3800|\
553 wndr3800ch)
554 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
555 ucidef_add_switch "switch0" \
556 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
557
558 ucidef_add_switch_attr "switch0" "blinkrate" 2
559 ucidef_add_switch_port_attr "switch0" 1 led 6
560 ucidef_add_switch_port_attr "switch0" 2 led 9
561 ucidef_add_switch_port_attr "switch0" 5 led 2
562 ;;
563 wpj344)
564 ucidef_add_switch "switch0" \
565 "0@eth0" "3:lan" "2:wan"
566 ;;
567 wpj558)
568 ucidef_add_switch "switch0" \
569 "5:lan" "1:wan" "6@eth0"
570 ;;
571 wpj563)
572 ucidef_add_switch "switch0" \
573 "0@eth0" "2:lan" "3:wan"
574 ;;
575 wrt160nl)
576 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
577 ucidef_add_switch "switch0" \
578 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
579 ;;
580 wzr-hp-g450h)
581 ucidef_add_switch "switch0" \
582 "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
583 ;;
584 z1)
585 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
586 ucidef_add_switch "switch0" \
587 "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
588 ;;
589 ens202ext)
590 ucidef_set_interfaces_lan_wan "eth1.1" "eth1.2"
591 ucidef_add_switch "switch0" \
592 "0@eth1" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
593 ;;
594 *)
595 ucidef_set_interfaces_lan_wan "eth0" "eth1"
596 ;;
597 esac
598 }
599
600 ar71xx_setup_macs()
601 {
602 local board="$1"
603 local lan_mac=""
604 local wan_mac=""
605
606 case $board in
607 archer-c7-v4)
608 base_mac=$(mtd_get_mac_binary config 8)
609 wan_mac=$(macaddr_add "$base_mac" 1)
610 ;;
611 archer-c7-v5)
612 base_mac=$(mtd_get_mac_binary info 8)
613 wan_mac=$(macaddr_add "$base_mac" 1)
614 ;;
615 dgl-5500-a1|\
616 dir-825-c1)
617 wan_mac=$(mtd_get_mac_ascii nvram "wan_mac")
618 ;;
619 dhp-1565-a1|\
620 dir-835-a1|\
621 wndr3700v4|\
622 wndr4300)
623 lan_mac=$(mtd_get_mac_binary caldata 0)
624 wan_mac=$(mtd_get_mac_binary caldata 6)
625 ;;
626 dir-869-a1|\
627 mynet-n750)
628 wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
629 ;;
630 esr900)
631 wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
632 ;;
633 fritz300e)
634 lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
635 ;;
636 tl-wr1043n-v5|\
637 tl-wr1043nd-v4)
638 lan_mac=$(mtd_get_mac_binary product-info 8)
639 wan_mac=$(macaddr_add "$lan_mac" 1)
640 ;;
641 wlr8100)
642 lan_mac=$(mtd_get_mac_ascii u-boot-env "ethaddr")
643 wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
644 ;;
645 wpj344|\
646 wpj558)
647 wan_mac=$(mtd_get_mac_binary u-boot 0x2e018)
648 ;;
649 esac
650
651 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
652 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
653 }
654
655 ar71xx_setup_ar8xxx_switch()
656 {
657 local board="$1"
658
659 case $board in
660 ap147-010|\
661 archer-c25-v1|\
662 archer-c58-v1|\
663 archer-c59-v1|\
664 archer-c59-v2|\
665 archer-c60-v1|\
666 archer-c60-v2|\
667 archer-c7-v4|\
668 archer-c7-v5|\
669 cf-e375ac|\
670 cf-e385ac|\
671 cr3000|\
672 dhp-1565-a1|\
673 mynet-n600|\
674 rb-2011il|\
675 rb-2011ils|\
676 rb-2011l|\
677 rb-2011uas|\
678 rb-2011uas-2hnd|\
679 rb-2011uias|\
680 rb-2011uias-2hnd|\
681 rb-2011uias-2hnd-r2|\
682 rb-750|\
683 rb-750p-pbr2|\
684 rb-750-r2|\
685 rb-750up-r2|\
686 rb-951ui-2nd|\
687 rb-952ui-5ac2nd|\
688 rb-map-2nd|\
689 tl-wr1043nd-v4|\
690 tl-wr1043n-v5|\
691 wndr3700v4|\
692 wndr3700v4|\
693 wndr4300|\
694 wnr1000-v2|\
695 wnr2000-v3|\
696 wnr2200|\
697 wnr612-v2|\
698 wpn824n)
699 ucidef_set_ar8xxx_switch_mib "switch0" 0 500
700 ;;
701 esac
702 }
703
704 board_config_update
705 board=$(board_name)
706 ar71xx_setup_interfaces $board
707 ar71xx_setup_macs $board
708 ar71xx_setup_ar8xxx_switch $board
709 board_config_flush
710
711 exit 0