ramips: fix Linkit smart 7688 support
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / board.d / 01_leds
1 #!/bin/sh
2
3 . /lib/functions/uci-defaults.sh
4
5 set_usb_led() {
6 ucidef_set_led_usbdev "usb" "USB" "${1}" "${2:-1-1}"
7 }
8
9 set_wifi_led() {
10 ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
11 }
12
13
14 board=$(board_name)
15 boardname="${board##*,}"
16
17 board_config_update
18
19 case $board in
20 11acnas|\
21 all0239-3g|\
22 ew1200|\
23 hw550-3g|\
24 mofi3500-3gn|\
25 sap-g3200u3|\
26 sk-wb8|\
27 w2914nsv2|\
28 wf-2881)
29 set_usb_led "$boardname:green:usb"
30 ;;
31 3g150b|\
32 3g300m)
33 set_usb_led "$boardname:blue:3g"
34 ;;
35 3g-6200n)
36 set_wifi_led "$boardname:amber:wlan"
37 set_usb_led "$boardname:blue:3g"
38 ;;
39 3g-6200nl|\
40 wnce2001)
41 set_wifi_led "$boardname:green:wlan"
42 ;;
43 br-6475nd|\
44 mzk-w300nh2)
45 set_wifi_led "$boardname:amber:wlan"
46 ;;
47 a5-v11|\
48 cs-qr10)
49 ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1"
50 ;;
51 ai-br100)
52 ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
53 set_wifi_led "$boardname:blue:wlan"
54 ;;
55 air3gii)
56 set_wifi_led "$boardname:green:wlan"
57 set_usb_led "$boardname:green:mobile"
58 ;;
59 all0256n-4M|\
60 all0256n-8M)
61 ucidef_set_rssimon "wlan0" "200000" "1"
62 ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
63 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
64 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
65 set_wifi_led "rt2800pci-phy0::radio"
66 ;;
67 ar670w|\
68 ar725w|\
69 awapn2403)
70 set_wifi_led "rt2800soc-phy0::radio"
71 ;;
72 asl26555-8M|\
73 asl26555-16M)
74 ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
75 ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
76 set_wifi_led "asl26555:green:wlan"
77 set_usb_led "asl26555:green:3g"
78 ;;
79 bc2)
80 set_usb_led "$boardname:blue:usb"
81 ;;
82 broadway)
83 set_usb_led "$boardname:red:diskmounted"
84 set_wifi_led "$boardname:red:wps_active"
85 ;;
86 c108)
87 ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
88 ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0"
89 ;;
90 c20)
91 ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
92 ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
93 set_usb_led "$boardname:blue:usb"
94 ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0"
95 ;;
96 c20i)
97 ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
98 ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
99 set_usb_led "$boardname:blue:usb" "2-1"
100 ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio"
101 ;;
102 c50)
103 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
104 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
105 set_usb_led "$boardname:green:usb"
106 ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1
107 set_wifi_led "$boardname:green:wlan5g"
108 ;;
109 cf-wr800n)
110 ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
111 set_wifi_led "$boardname:white:wifi"
112 ;;
113 cy-swr1100)
114 ucidef_set_led_default "wps" "WPS" "$boardname:blue:wps" "0"
115 set_usb_led "$boardname:blue:usb"
116 ;;
117 d105)
118 ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1"
119 set_usb_led "$boardname:green:usb"
120 ;;
121 d240)
122 set_wifi_led "$boardname:blue:wifi"
123 set_usb_led "$boardname:blue:usb"
124 ;;
125 db-wrt01)
126 ucidef_set_led_default "power" "power" "$boardname:orange:power" "1"
127 ;;
128 dch-m225)
129 ucidef_set_led_default "power" "POWER" "$board:geeen:power" "1"
130 ucidef_set_led_default "status" "STATUS" "$board:red:status" "0"
131 ;;
132 dcs-930l-b1)
133 ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1"
134 ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
135 ;;
136 dir-300-b1|\
137 dir-600-b1|\
138 dir-620-a1)
139 ucidef_set_led_default "wan" "WAN LED (amber)" "$boardname:amber:wan" "1"
140 set_wifi_led "rt2800pci-phy0::radio"
141 ;;
142 dir-300-b7|\
143 dir-320-b1|\
144 dir-610-a1|\
145 esr-9753|\
146 hlk-rm04|\
147 sl-r7205|\
148 v11st-fe|\
149 w306r-v20|\
150 wt1520-4M|\
151 wt1520-8M)
152 set_wifi_led "rt2800pci-phy0::radio"
153 ;;
154 dir-615-d|\
155 dir-615-h1)
156 ucidef_set_led_default "status" "Status LED (amber)" "$boardname:amber:status" "0"
157 set_wifi_led "rt2800pci-phy0::radio"
158 ;;
159 dir-620-d1|\
160 mzk-ex300np)
161 set_wifi_led "$boardname:green:wifi"
162 ;;
163 dir-810l|\
164 mzk-750dhp|\
165 mzk-dp150n|\
166 vr500)
167 ucidef_set_led_default "power" "power" "$boardname:green:power" "1"
168 ;;
169 dir-860l-b1)
170 ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
171 ;;
172 ex2700|\
173 wn3000rpv3)
174 set_wifi_led "$boardname:green:router"
175 ;;
176 ex3700)
177 ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0"
178 ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
179 ;;
180 f5d8235-v1)
181 ucidef_set_led_default "lan" "lan" "$boardname:blue:wired" "0"
182 set_usb_led "$boardname:blue:storage"
183 set_wifi_led "$boardname:blue:wireless"
184 ;;
185 f5d8235-v2)
186 set_usb_led "$boardname:blue:storage"
187 ;;
188 fonera20n)
189 set_usb_led "$boardname:orange:usb"
190 set_wifi_led "$boardname:orange:wifi"
191 ;;
192 gb-pc1)
193 ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
194 ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
195 ;;
196 gl-mt300a|\
197 gl-mt300n|\
198 gl-mt750)
199 set_wifi_led "$boardname:wlan"
200 ;;
201 gl-mt300n-v2)
202 set_wifi_led "$boardname:red:wlan"
203 ;;
204 hc5661|\
205 hc5661a)
206 ucidef_set_led_default "system" "system" "$boardname:blue:system" "1"
207 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
208 set_wifi_led "$boardname:blue:wlan2g"
209 ;;
210 hc5761)
211 ucidef_set_led_default "system" "system" "$boardname:blue:system" "1"
212 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
213 set_wifi_led "$boardname:blue:wlan2g"
214 ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0"
215 ;;
216 hc5861)
217 ucidef_set_led_default "system" "system" "$boardname:blue:system" "1"
218 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
219 set_wifi_led "$boardname:blue:wlan2g"
220 ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0"
221 ucidef_set_led_default "turbo" "turbo" "$boardname:blue:turbo" "0"
222 ;;
223 hg255d)
224 set_wifi_led "$boardname:green:wlan"
225 set_usb_led "$boardname:green:usb"
226 ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2"
227 ;;
228 hpm)
229 ucidef_set_led_default "power" "POWER" "$boardname:orange:power" "1"
230 ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
231 set_wifi_led "$boardname:green:wifi"
232 ;;
233 ht-tm02)
234 ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0"
235 set_wifi_led "$boardname:blue:wlan"
236 ;;
237 kn|\
238 nbg-419n2)
239 set_usb_led "$boardname:green:usb"
240 set_wifi_led "rt2800pci-phy0::radio"
241 ;;
242 kn_rc|\
243 kn_rf|\
244 kng_rc)
245 set_usb_led "$boardname:green:usb"
246 set_wifi_led "$boardname:green:wifi"
247 ;;
248 linkits7688)
249 ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
250 ;;
251 m2m)
252 set_wifi_led "$boardname:blue:wifi"
253 ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0"
254 ;;
255 miniembplug)
256 set_wifi_led "$boardname:red:wlan"
257 set_usb_led "$boardname:green:mobile"
258 ;;
259 mir3g)
260 ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
261 ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
262 ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
263 ;;
264 miwifi-mini)
265 ucidef_set_led_default "power" "power" "$boardname:red:status" "1"
266 ;;
267 mlw221|\
268 mlwg2)
269 set_wifi_led "$boardname:blue:wifi"
270 ucidef_set_led_default "system" "system" "$boardname:blue:system" "1"
271 ;;
272 mpr-a1|\
273 mpr-a2)
274 set_wifi_led "$boardname:blue:system"
275 ;;
276 mr-102n)
277 set_wifi_led "$boardname:green:wlan"
278 set_usb_led "$boardname:green:usb"
279 ;;
280 mr200)
281 ucidef_set_led_default "power" "power" "$boardname:white:power" "1"
282 ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
283 ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
284 set_wifi_led "$boardname:white:wlan"
285 ;;
286 mzk-ex750np)
287 ucidef_set_led_default "power" "power" "$boardname:red:power" "1"
288 set_wifi_led "$boardname:red:wifi"
289 ;;
290 na930)
291 set_usb_led "$boardname:blue:status"
292 ;;
293 newifi-d1)
294 set_usb_led "$boardname:red:status"
295 ;;
296 nw718)
297 set_usb_led "$boardname:amber:usb"
298 ;;
299 oy-0001)
300 ucidef_set_led_default "power" "power" "$boardname:green:power" "1"
301 set_wifi_led "$boardname:green:wifi"
302 ;;
303 pbr-d1)
304 set_usb_led "$boardname:orange:usb"
305 ;;
306 pbr-m1)
307 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
308 ucidef_set_led_default "power" "power" "$boardname:blue:power" "1"
309 ucidef_set_led_default "sys" "sys" "$boardname:blue:sys" "1"
310 ;;
311 d-team,newifi-d2)
312 set_usb_led "$boardname:blue:usb"
313 ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
314 ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
315 ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
316 ;;
317 psg1208)
318 set_wifi_led "$boardname:white:wlan2g"
319 ;;
320 psg1218a|\
321 psg1218b)
322 ucidef_set_led_netdev "Network" "Network" "$boardname:blue:status" "eth0"
323 ucidef_set_led_default "status" "STATUS" "$boardname:yellow:status" "0"
324 ;;
325 px-4885-4M|\
326 px-4885-8M)
327 set_wifi_led "px-4885:orange:wifi"
328 set_usb_led "px-4885:blue:storage"
329 ;;
330 r6220)
331 ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2
332 set_wifi_led "$boardname:green:wifi"
333 set_usb_led "$boardname:green:usb"
334 ;;
335 re350-v1)
336 ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
337 ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
338 ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx"
339 ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01"
340 ;;
341 re6500)
342 ucidef_set_led_default "power" "power" "$boardname:white:power" "1"
343 ucidef_set_led_default "wifi" "wifi" "$boardname:orange:wifi" "1"
344 ;;
345 rp-n53)
346 ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0"
347 set_wifi_led "$boardname:blue:wifi"
348 ;;
349 rt-ac51u)
350 set_wifi_led "$boardname:blue:wifi"
351 set_usb_led "$boardname:blue:usb" "1-1"
352 ;;
353 rt-n12p)
354 ucidef_set_led_default "power" "power" "$board:green:power" "1"
355 ucidef_set_led_netdev "lan" "lan" "$board:green:lan" eth0.1
356 ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2
357 set_wifi_led "$board:green:air"
358 ;;
359 rt-n14u)
360 ucidef_set_led_default "power" "power" "$boardname:blue:power" "1"
361 ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1
362 ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2
363 set_wifi_led "$boardname:blue:air"
364 set_usb_led "$boardname:blue:usb"
365 ;;
366 tew-714tru)
367 set_usb_led "$boardname:red:usb"
368 set_wifi_led "$boardname:green:wifi"
369 ;;
370 tiny-ac)
371 set_wifi_led "$boardname:orange:wifi"
372 set_usb_led "$boardname:green:usb"
373 ;;
374 tl-wr840n-v4)
375 set_wifi_led "$boardname:green:wlan"
376 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
377 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
378 ;;
379 tl-wr841n-v13)
380 set_wifi_led "$boardname:green:wlan"
381 ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2"
382 ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4"
383 ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8"
384 ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10"
385 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
386 ;;
387 tplink,tl-mr3420-v5)
388 set_usb_led "$boardname:green:usb"
389 set_wifi_led "$boardname:green:wlan"
390 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
391 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
392 ;;
393 u25awf-h1)
394 set_wifi_led "u25awf:red:wifi"
395 ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0"
396 ;;
397 u7628-01-128M-16M)
398 ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
399 ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
400 ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
401 ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
402 ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
403 set_usb_led "u7628-01:green:usb"
404 set_wifi_led "u7628-01:green:wlan"
405 ;;
406 vocore-8M|\
407 vocore-16M)
408 ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
409 set_wifi_led "vocore:green:status"
410 ;;
411 vocore2)
412 set_wifi_led "$boardname:fuchsia:status"
413 ;;
414 vocore2lite)
415 set_wifi_led "$boardname:green:status"
416 ;;
417 w502u)
418 set_usb_led "$boardname:blue:usb"
419 set_wifi_led "rt2800pci-phy0::radio"
420 ;;
421 wcr-150gn)
422 set_usb_led "$boardname:amber:user"
423 ;;
424 we1026-5g-16m)
425 ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
426 set_wifi_led "we1026-5g:green:wifi"
427 set_usb_led "we1026-5g:green:usb" "1-1.1"
428 ;;
429 whr-1166d|\
430 whr-300hp2|\
431 whr-600d)
432 ucidef_set_led_default "power" "power" "$boardname:green:power" "1"
433 ucidef_set_led_default "router" "router" "$boardname:green:router" "1"
434 ;;
435 wl-wn575a3)
436 ucidef_set_rssimon "wlan1" "200000" "1"
437 ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49"
438 ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84"
439 ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100"
440 ;;
441 wrh-300cr)
442 set_wifi_led "$boardname:green:wlan"
443 ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
444 ;;
445 wndr3700v5)
446 ucidef_set_led_default "power" "POWER" "$boardname:green:power" "0"
447 ;;
448 wt3020-4M|\
449 wt3020-8M)
450 ucidef_set_led_default "power" "power" "wt3020:blue:power" "0"
451 ;;
452 y1)
453 set_usb_led "$boardname:blue:usb"
454 ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1"
455 ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0"
456 ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0.1" "tx rx"
457 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
458 ;;
459 y1s)
460 set_usb_led "$boardname:blue:usb"
461 ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1"
462 ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0"
463 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
464 ;;
465 zbt-ape522ii)
466 ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1"
467 ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx"
468 ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx"
469 ;;
470 zbt-cpe102)
471 ucidef_set_led_default "power" "power" "$boardname:green:4g-0" "0"
472 ;;
473 zbt-wa05)
474 ucidef_set_led_default "power" "power" "$boardname:blue:power" "1"
475 set_wifi_led "$boardname:blue:air"
476 set_usb_led "$boardname:blue:usb"
477 ;;
478 zbt-we2026)
479 set_wifi_led "$boardname:green:wlan"
480 ;;
481 zbt-we826-16M|\
482 zbt-we826-32M)
483 set_wifi_led "zbt-we826:green:wifi"
484 set_usb_led "zbt-we826:green:usb"
485 ;;
486 zbt-wr8305rt)
487 ucidef_set_led_default "power" "power" "$boardname:green:sys" "1"
488 set_usb_led "$boardname:green:usb"
489 set_wifi_led "$boardname:green:wifi"
490 ;;
491 zte-q7)
492 set_wifi_led "$boardname:blue:status"
493 ;;
494 youku-yk1)
495 set_wifi_led "$boardname:blue:air"
496 set_usb_led "$boardname:blue:usb"
497 ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
498 ;;
499 esac
500
501 board_config_flush
502
503 exit 0