kernel: fix typo in fb-sys-fops autoload
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / board.d / 02_network
1 #!/bin/sh
2
3 . /lib/functions.sh
4 . /lib/functions/uci-defaults.sh
5 . /lib/functions/system.sh
6
7 ramips_setup_rt3x5x_vlans()
8 {
9 if [ ! -x /sbin/swconfig ]; then
10 # legacy default
11 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
12 return
13 fi
14 local wanports=""
15 local lanports=""
16 for port in 5 4 3 2 1 0; do
17 if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
18 continue
19 fi
20 if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
21 wanports="$port:wan $wanports"
22 else
23 lanports="$port:lan $lanports"
24 fi
25 done
26 ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0"
27 }
28
29 ramips_setup_interfaces()
30 {
31 local board="$1"
32
33 case $board in
34 11acnas|\
35 d-team,newifi-d2|\
36 dir-615-h1|\
37 w2914nsv2|\
38 zbt-we2026)
39 ucidef_add_switch "switch0" \
40 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
41 ;;
42 3g150b|\
43 3g300m|\
44 a5-v11|\
45 all0256n-4M|\
46 all0256n-8M|\
47 all5002|\
48 all5003|\
49 bocco|\
50 broadway|\
51 dcs-930|\
52 dcs-930l-b1|\
53 ht-tm02|\
54 kimax,u35wf|\
55 linkits7688 | \
56 m2m|\
57 microwrt|\
58 mikrotik,rbm11g|\
59 mpr-a2|\
60 ncs601w|\
61 omega2 | \
62 omega2p | \
63 timecloud|\
64 tplink,tl-wa801nd-v5|\
65 w150m|\
66 widora,neo-16m|\
67 widora,neo-32m|\
68 wnce2001|\
69 zbt-cpe102|\
70 zorlik,zl5900v2|\
71 zte-q7)
72 ucidef_add_switch "switch0"
73 ucidef_add_switch_attr "switch0" "enable" "false"
74 ucidef_set_interface_lan "eth0"
75 ;;
76 mlw221|\
77 mr-102n)
78 ucidef_set_interface_lan "eth0.2"
79 ;;
80 3g-6200n|\
81 ai-br100|\
82 alfa-network,ac1200rm|\
83 mediatek,ap-mt7621a-v60|\
84 xzwifi,creativebox-v1|\
85 d240|\
86 db-wrt01|\
87 dir-300-b7|\
88 dir-320-b1|\
89 dir-610-a1|\
90 dir-810l|\
91 dlink,dwr-116-a1|\
92 dlink,dwr-921-c1|\
93 dlink,dwr-922-e2|\
94 ew1200|\
95 firewrt|\
96 hc5661a|\
97 hc5962|\
98 hlk-rm04|\
99 k2p|\
100 kn|\
101 kn_rc|\
102 mac1200rv2|\
103 miwifi-mini|\
104 miwifi-nano|\
105 mt7621|\
106 mt7628|\
107 mtc,wr1201|\
108 mzk-750dhp|\
109 mzk-w300nh2|\
110 nixcore-x1-8M|\
111 nixcore-x1-16M|\
112 oy-0001|\
113 pbr-m1|\
114 psg1208|\
115 psg1218a|\
116 rt-n12p|\
117 sap-g3200u3|\
118 sk-wb8|\
119 telco-electronics,x1|\
120 totolink,lr1200|\
121 unielec,u7621-06-256m-16m|\
122 unielec,u7621-06-512m-64m|\
123 vr500|\
124 wavlink,wl-wn570ha1|\
125 wavlink,wl-wn575a3|\
126 wf-2881|\
127 whr-g300n|\
128 mqmaker,witi-256m|\
129 mqmaker,witi-512m|\
130 youku-yk1|\
131 youku,yk-l2|\
132 zbt-ape522ii|\
133 zbt-we1326|\
134 zbtlink,zbt-we826-e|\
135 zbtlink,zbt-we3526|\
136 zbt-we826-16M|\
137 zbt-we826-32M|\
138 zbt-wg2626|\
139 zbt-wg3526-16M|\
140 zbt-wg3526-32M|\
141 zbt-wr8305rt)
142 ucidef_add_switch "switch0" \
143 "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
144 ;;
145 gehua,ghl-r-001)
146 ucidef_add_switch "switch0" \
147 "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
148 ;;
149 alfa-network,awusfree1|\
150 alfa-network,tube-e4g|\
151 cs-qr10|\
152 d105|\
153 dlink,dap-1522-a1|\
154 dch-m225|\
155 ex2700|\
156 ex3700|\
157 hpm|\
158 mzk-ex300np|\
159 mzk-ex750np|\
160 na930|\
161 pbr-d1|\
162 ravpower,wd03|\
163 tama,w06|\
164 tplink,tl-mr3020-v3|\
165 tplink,tl-wr802n-v4|\
166 u25awf-h1|\
167 wli-tx4-ag300n|\
168 wmdr-143n|\
169 wmr-300|\
170 wn3000rpv3|\
171 wrh-300cr)
172 ucidef_set_interface_lan "eth0"
173 ;;
174 dlink,dwr-118-a1)
175 ucidef_add_switch "switch0" \
176 "1:lan:2" "2:lan:3" "3:lan:1" "4:lan:0" "5:wan" "6@eth0"
177 ;;
178 dlink,dwr-118-a2)
179 ucidef_add_switch "switch0" \
180 "1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0"
181 ;;
182 psg1218b)
183 ucidef_add_switch "switch0" \
184 "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
185 ;;
186 whr-300hp2|\
187 whr-600d|\
188 wsr-1166|\
189 wsr-600)
190 ucidef_add_switch "switch0" \
191 "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0"
192 ;;
193 ar670w|\
194 ar725w|\
195 rakwireless,rak633|\
196 rt-ac51u)
197 ucidef_add_switch "switch0" \
198 "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
199 ;;
200 belkin,f9k1109v1|\
201 rt-n15|\
202 wl-351)
203 ucidef_add_switch "switch0" \
204 "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0"
205 ;;
206 asl26555-8M|\
207 asl26555-16M|\
208 rp-n53)
209 ucidef_add_switch "switch0" \
210 "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
211 ;;
212 asus,rt-ac57u|\
213 atp-52b|\
214 awm002-evb-4M|\
215 awm002-evb-8M|\
216 bdcom,wap2100-sk|\
217 c20i|\
218 dir-645|\
219 gl-mt300a|\
220 gl-mt300n|\
221 gl-mt750|\
222 hilink,hlk-7628n|\
223 hiwifi,hc5861b|\
224 jhr-n805r|\
225 jhr-n825r|\
226 jhr-n926r|\
227 mikrotik,rb750gr3|\
228 mikrotik,rbm33g|\
229 mzk-wdpr|\
230 rt-n14u|\
231 skylab,skw92a|\
232 tplink,c20-v4|\
233 tplink,c50-v3|\
234 tplink,c50-v4|\
235 tplink,tl-mr3420-v5|\
236 tplink,tl-wr842n-v5|\
237 tl-wr840n-v4|\
238 tl-wr840n-v5|\
239 tl-wr841n-v13|\
240 u7628-01-128M-16M|\
241 ubnt-erx|\
242 ubnt-erx-sfp|\
243 ur-326n4g|\
244 wrtnode|\
245 wrtnode2p | \
246 wrtnode2r | \
247 youhua,wr1200js|\
248 zbt-wa05|\
249 zyxel,keenetic-extra-ii)
250 ucidef_add_switch "switch0" \
251 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
252 ;;
253 c50|\
254 tplink,c20-v1)
255 ucidef_add_switch "switch0" \
256 "1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0"
257 ;;
258 dir-860l-b1|\
259 elecom,wrc-1167ghbk2-s|\
260 elecom,wrc-2533gst|\
261 elecom,wrc-1900gst|\
262 hg255d|\
263 iodata,wn-ax1167gr|\
264 iodata,wn-gx300gr)
265 ucidef_add_switch "switch0" \
266 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
267 ;;
268 gnubee,gb-pc1|\
269 gnubee,gb-pc2)
270 ucidef_add_switch "switch0" \
271 "0:lan" "4:lan" "6@eth0"
272 ;;
273 gl-mt300n-v2)
274 ucidef_add_switch "switch0" \
275 "1:lan" "0:wan" "6@eth0"
276 ;;
277 awapn2403)
278 ucidef_add_switch "switch0" \
279 "0:lan" "1:wan" "6@eth0"
280 ;;
281 b2c|\
282 nw718|\
283 psr-680w|\
284 sl-r7205|\
285 ur-336un|\
286 w502u|\
287 wr6202)
288 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
289 ;;
290 br-6475nd)
291 ucidef_add_switch "switch0" \
292 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
293 ;;
294 c108|\
295 cf-wr800n)
296 ucidef_add_switch "switch0" \
297 "4:lan" "6t@eth0"
298 ;;
299 cudy,wr1000)
300 ucidef_add_switch "switch0" \
301 "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
302 ;;
303 cy-swr1100)
304 ucidef_add_switch "switch0" \
305 "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0"
306 ;;
307 duzun-dm06)
308 ucidef_add_switch "switch0" \
309 "1:lan" "0:wan" "6@eth0"
310 ;;
311 e1700|\
312 mt7620a_mt7530)
313 ucidef_add_switch "switch1" \
314 "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
315 ;;
316 edimax,br-6478ac-v2|\
317 tplink,c2-v1)
318 ucidef_add_switch "switch1" \
319 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
320 ;;
321 hc5661|\
322 head-weblink,hdrm200|\
323 y1s)
324 ucidef_add_switch "switch0" \
325 "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0"
326 ;;
327 hc5861)
328 ucidef_add_switch "switch0" \
329 "0:lan" "1:lan" "5:wan" "6@eth0"
330 ;;
331 iodata,wn-ac1167gr|\
332 iodata,wn-ac733gr3)
333 ucidef_add_switch "switch1" \
334 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
335 ;;
336 kn_rf)
337 ucidef_add_switch "switch0" \
338 "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0"
339 ;;
340 kng_rc)
341 ucidef_add_switch "switch1" \
342 "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0"
343 ;;
344 mlwg2|\
345 wizard8800|\
346 wl-330n)
347 ucidef_set_interface_lan "eth0.1"
348 ;;
349 mr200)
350 ucidef_add_switch "switch0" \
351 "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
352 ucidef_set_interface_wan "usb0"
353 ;;
354 netgear,r6120|\
355 r6220|\
356 netgear,r6350|\
357 wndr3700v5)
358 ucidef_add_switch "switch0" \
359 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
360 ;;
361 hc5761)
362 ucidef_add_switch "switch0" \
363 "1:lan" "4:lan" "0:wan" "6@eth0"
364 ;;
365 mzk-dp150n|\
366 vocore-8M|\
367 vocore-16M)
368 ucidef_add_switch "switch0" \
369 "0:lan" "4:lan" "6t@eth0"
370 ;;
371 newifi-d1)
372 ucidef_add_switch "switch0" \
373 "1:lan:2" "2:lan:1" "4:wan" "6@eth0"
374 ;;
375 phicomm,k2g)
376 ucidef_add_switch "switch0" \
377 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0"
378 ;;
379 dlink,dir-510l|\
380 glinet,vixmini|\
381 netgear,ex6150|\
382 re350-v1)
383 ucidef_add_switch "switch0" \
384 "0:lan" "6@eth0"
385 ;;
386 re6500)
387 ucidef_add_switch "switch0" \
388 "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
389 ;;
390 rt-n56u)
391 ucidef_add_switch "switch0" \
392 "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0"
393 ;;
394 tew-638apb-v2)
395 ucidef_add_switch "switch0" \
396 "4:lan" "6@eth0"
397 ;;
398 lava,lr-25g001|\
399 tew-691gr|\
400 tew-692gr|\
401 wlr-6000)
402 ucidef_add_switch "switch0" \
403 "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
404 ;;
405 tplink,tl-wr902ac-v3)
406 ucidef_add_switch "switch0" \
407 "4:lan" "6@eth0"
408 ;;
409 vonets,var11n-300|\
410 wt1520-4M|\
411 wt1520-8M)
412 ucidef_add_switch "switch0" \
413 "0:lan" "4:wan" "6@eth0"
414 ;;
415 vocore2|\
416 vocore2lite)
417 ucidef_add_switch "switch0" \
418 "0:lan" "2:lan" "6t@eth0"
419 ;;
420 f5d8235-v1|\
421 f5d8235-v2|\
422 tew-714tru|\
423 v11st-fe|\
424 wzr-agl300nh)
425 ucidef_add_switch "switch0" \
426 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
427 ;;
428 wcr-1166ds)
429 ucidef_add_switch "switch0" \
430 "3:lan" "4:wan" "6@eth0"
431 ;;
432 wcr-150gn|\
433 we1026-5g-16m)
434 ucidef_add_switch "switch0" \
435 "0:lan" "6t@eth0"
436 ;;
437 whr-1166d)
438 ucidef_add_switch "switch0" \
439 "0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0"
440 ;;
441 wizfi630a)
442 ucidef_add_switch "switch0" \
443 "0:lan" "1:lan" "2:wan" "6@eth0"
444 ;;
445 wiznet,wizfi630s)
446 ucidef_add_switch "switch0" \
447 "0:wan" "3:lan" "4:lan" "6@eth0"
448 ;;
449 wt3020-4M|\
450 wt3020-8M)
451 ucidef_add_switch "switch0" \
452 "4:lan" "0:wan" "6@eth0"
453 ;;
454 xiaomi,mir3g)
455 ucidef_add_switch "switch0" \
456 "2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
457 ;;
458 xiaomi,mir3p)
459 ucidef_add_switch "switch0" \
460 "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
461 ;;
462 xiaomi,mir4a-100m)
463 ucidef_add_switch "switch0" \
464 "4:lan:1" "2:lan:2" "0:wan" "6@eth0"
465 ;;
466 zbtlink,zbt-we1226|\
467 y1)
468 ucidef_add_switch "switch0" \
469 "0:lan:2" "1:lan:1" "4:wan" "6@eth0"
470 ;;
471 zyxel,keenetic-start)
472 ucidef_add_switch "switch0" \
473 "0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0"
474 ;;
475 *)
476 RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
477 if [ -n "${RT3X5X}" ]; then
478 ramips_setup_rt3x5x_vlans
479 else
480 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
481 fi
482 ;;
483 esac
484 }
485
486 ramips_setup_macs()
487 {
488 local board="$1"
489 local lan_mac=""
490 local wan_mac=""
491
492 case $board in
493 a5-v11|\
494 ht-tm02|\
495 wmdr-143n)
496 lan_mac=$(cat /sys/class/net/eth0/address)
497 ;;
498 asus,rt-ac57u|\
499 vr500)
500 lan_mac=$(mtd_get_mac_binary factory 57344)
501 wan_mac=$(mtd_get_mac_binary factory 57350)
502 ;;
503 carambola|\
504 freestation5|\
505 w502u|\
506 wnce2001)
507 wan_mac=$(mtd_get_mac_binary factory 46)
508 ;;
509 bc2|\
510 broadway|\
511 d105|\
512 dir-300-b7|\
513 dir-320-b1|\
514 dir-620-a1|\
515 esr-9753|\
516 hilink,hlk-7628n|\
517 hlk-rm04|\
518 mpr-a1|\
519 psr-680w|\
520 sl-r7205|\
521 y1|\
522 y1s)
523 lan_mac=$(cat /sys/class/net/eth0/address)
524 lan_mac=$(macaddr_setbit_la "$lan_mac")
525 wan_mac=$(macaddr_add "$lan_mac" 1)
526 ;;
527 belkin,f9k1109v1)
528 wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC)
529 lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC)
530 ;;
531 br-6475nd)
532 lan_mac=$(cat /sys/class/net/eth0/address)
533 wan_mac=$(mtd_get_mac_binary devdata 7)
534 ;;
535 cy-swr1100|\
536 dch-m225)
537 lan_mac=$(mtd_get_mac_ascii factory lanmac)
538 ;;
539 dir-645)
540 lan_mac=$(mtd_get_mac_ascii nvram lanmac)
541 wan_mac=$(mtd_get_mac_ascii nvram wanmac)
542 ;;
543 dir-860l-b1)
544 lan_mac=$(mtd_get_mac_ascii factory lanmac)
545 wan_mac=$(mtd_get_mac_ascii factory wanmac)
546 ;;
547 dlink,dir-510l|\
548 dlink,dwr-116-a1|\
549 dlink,dwr-118-a1|\
550 dlink,dwr-118-a2|\
551 dlink,dwr-921-c1|\
552 dlink,dwr-922-e2|\
553 lava,lr-25g001)
554 wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
555 lan_mac=$(macaddr_add "$wan_mac" 1)
556 ;;
557 e1700)
558 wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
559 ;;
560 edimax,br-6478ac-v2|\
561 netgear,r6350)
562 lan_mac=$(cat /sys/class/net/eth0/address)
563 wan_mac=$(macaddr_add "$lan_mac" 2)
564 ;;
565 elecom,wrc-1167ghbk2-s|\
566 elecom,wrc-2533gst|\
567 elecom,wrc-1900gst|\
568 sk-wb8)
569 wan_mac=$(mtd_get_mac_binary factory 57350)
570 ;;
571 gl-mt300n-v2|\
572 whr-g300n)
573 wan_mac=$(mtd_get_mac_binary factory 4)
574 ;;
575 hc5*61|\
576 hc5661a|\
577 hc5962|\
578 hiwifi,hc5861b)
579 lan_mac=`mtd_get_mac_ascii bdinfo "Vfac_mac "`
580 [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
581 wan_mac=$(macaddr_add "$lan_mac" 1)
582 ;;
583 iodata,wn-ac1167gr|\
584 iodata,wn-ac733gr3)
585 wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" -1)
586 ;;
587 iodata,wn-ax1167gr|\
588 iodata,wn-gx300gr)
589 wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1)
590 ;;
591 kn_rc|\
592 kn_rf|\
593 kng_rc)
594 wan_mac=$(mtd_get_mac_binary factory 40)
595 ;;
596 linkits7688)
597 wan_mac=$(mtd_get_mac_binary factory 4)
598 lan_mac=$(mtd_get_mac_binary factory 46)
599 ;;
600 mac1200rv2)
601 lan_mac=$(mtd_get_mac_binary factory_info 13)
602 wan_mac=$(macaddr_add "$lan_mac" 1)
603 ;;
604 miwifi-mini)
605 wan_mac=$(cat /sys/class/net/eth0/address)
606 lan_mac=$(macaddr_setbit_la "$wan_mac")
607 ;;
608 m3|\
609 m4-4M|\
610 m4-8M|\
611 x5|\
612 x8)
613 lan_mac=$(cat /sys/class/net/eth0/address)
614 lan_mac=$(macaddr_add "$lan_mac" -2)
615 ;;
616 newifi-d1)
617 lan_mac=$(cat /sys/class/net/eth0/address)
618 lan_mac=$(macaddr_add "$lan_mac" 2)
619 ;;
620 omega2|\
621 omega2p)
622 wan_mac=$(mtd_get_mac_binary factory 4)
623 lan_mac=$(mtd_get_mac_binary factory 46)
624 ;;
625 oy-0001|\
626 phicomm,k2g)
627 lan_mac=$(mtd_get_mac_binary factory 40)
628 wan_mac=$(mtd_get_mac_binary factory 46)
629 ;;
630 rt-n56u)
631 lan_mac=$(cat /sys/class/net/eth0/address)
632 lan_mac=$(macaddr_setbit_la "$lan_mac")
633 wan_mac=$(mtd_get_mac_binary factory 32772)
634 ;;
635 skylab,skw92a)
636 lan_mac=$(mtd_get_mac_binary factory 40)
637 wan_mac=$(mtd_get_mac_binary factory 46)
638 ;;
639 tew-691gr)
640 wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 3)
641 ;;
642 tew-692gr)
643 wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 1)
644 ;;
645 tiny-ac)
646 lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR)
647 wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR)
648 ;;
649 w306r-v20)
650 lan_mac=$(cat /sys/class/net/eth0/address)
651 wan_mac=$(macaddr_add "$lan_mac" 5)
652 ;;
653 wcr-1166ds|\
654 wsr-1166)
655 local index="$(find_mtd_index "board_data")"
656 wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
657 lan_mac=$wan_mac
658 ;;
659 wcr-150gn)
660 wan_mac=$(mtd_get_mac_binary factory 40)
661 ;;
662 whr-1166d|\
663 whr-300hp2|\
664 whr-600d|\
665 wsr-600)
666 wan_mac=$(mtd_get_mac_binary factory 4)
667 lan_mac=$wan_mac
668 ;;
669 wizfi630a)
670 lan_mac=$(mtd_get_mac_binary factory 4)
671 wan_mac=$(mtd_get_mac_binary factory 40)
672 ;;
673 wlr-6000)
674 wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
675 ;;
676 xiaomi,mir3g|\
677 xiaomi,mir3p)
678 lan_mac=$(mtd_get_mac_binary Factory 0xe006)
679 ;;
680 zyxel,keenetic-start)
681 wan_mac=$(mtd_get_mac_binary factory 40)
682 ;;
683 *)
684 lan_mac=$(cat /sys/class/net/eth0/address)
685 wan_mac=$(macaddr_add "$lan_mac" 1)
686 ;;
687 esac
688
689 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
690 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
691 }
692
693 board_config_update
694 board=$(board_name)
695 ramips_setup_interfaces $board
696 ramips_setup_macs $board
697 board_config_flush
698
699 exit 0