a1c0c0e6906d296462c7f5a01b9d4d80777cca67
[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 m2m)
249 set_wifi_led "$boardname:blue:wifi"
250 ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0"
251 ;;
252 miniembplug)
253 set_wifi_led "$boardname:red:wlan"
254 set_usb_led "$boardname:green:mobile"
255 ;;
256 mir3g)
257 ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
258 ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
259 ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
260 ;;
261 miwifi-mini)
262 ucidef_set_led_default "power" "power" "$boardname:red:status" "1"
263 ;;
264 mlw221|\
265 mlwg2)
266 set_wifi_led "$boardname:blue:wifi"
267 ucidef_set_led_default "system" "system" "$boardname:blue:system" "1"
268 ;;
269 mpr-a1|\
270 mpr-a2)
271 set_wifi_led "$boardname:blue:system"
272 ;;
273 mr-102n)
274 set_wifi_led "$boardname:green:wlan"
275 set_usb_led "$boardname:green:usb"
276 ;;
277 mr200)
278 ucidef_set_led_default "power" "power" "$boardname:white:power" "1"
279 ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
280 ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
281 set_wifi_led "$boardname:white:wlan"
282 ;;
283 mzk-ex750np)
284 ucidef_set_led_default "power" "power" "$boardname:red:power" "1"
285 set_wifi_led "$boardname:red:wifi"
286 ;;
287 na930)
288 set_usb_led "$boardname:blue:status"
289 ;;
290 newifi-d1)
291 set_usb_led "$boardname:red:status"
292 ;;
293 nw718)
294 set_usb_led "$boardname:amber:usb"
295 ;;
296 oy-0001)
297 ucidef_set_led_default "power" "power" "$boardname:green:power" "1"
298 set_wifi_led "$boardname:green:wifi"
299 ;;
300 pbr-d1)
301 set_usb_led "$boardname:orange:usb"
302 ;;
303 pbr-m1)
304 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
305 ucidef_set_led_default "power" "power" "$boardname:blue:power" "1"
306 ucidef_set_led_default "sys" "sys" "$boardname:blue:sys" "1"
307 ;;
308 d-team,newifi-d2)
309 set_usb_led "$boardname:blue:usb"
310 ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
311 ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
312 ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
313 ;;
314 psg1208)
315 set_wifi_led "$boardname:white:wlan2g"
316 ;;
317 psg1218a|\
318 psg1218b)
319 ucidef_set_led_netdev "Network" "Network" "$boardname:blue:status" "eth0"
320 ucidef_set_led_default "status" "STATUS" "$boardname:yellow:status" "0"
321 ;;
322 px-4885-4M|\
323 px-4885-8M)
324 set_wifi_led "px-4885:orange:wifi"
325 set_usb_led "px-4885:blue:storage"
326 ;;
327 r6220)
328 ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2
329 set_wifi_led "$boardname:green:wifi"
330 set_usb_led "$boardname:green:usb"
331 ;;
332 re350-v1)
333 ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
334 ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
335 ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx"
336 ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01"
337 ;;
338 re6500)
339 ucidef_set_led_default "power" "power" "$boardname:white:power" "1"
340 ucidef_set_led_default "wifi" "wifi" "$boardname:orange:wifi" "1"
341 ;;
342 rp-n53)
343 ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0"
344 set_wifi_led "$boardname:blue:wifi"
345 ;;
346 rt-ac51u)
347 set_wifi_led "$boardname:blue:wifi"
348 set_usb_led "$boardname:blue:usb" "1-1"
349 ;;
350 rt-n12p)
351 ucidef_set_led_default "power" "power" "$board:green:power" "1"
352 ucidef_set_led_netdev "lan" "lan" "$board:green:lan" eth0.1
353 ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2
354 set_wifi_led "$board:green:air"
355 ;;
356 rt-n14u)
357 ucidef_set_led_default "power" "power" "$boardname:blue:power" "1"
358 ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1
359 ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2
360 set_wifi_led "$boardname:blue:air"
361 set_usb_led "$boardname:blue:usb"
362 ;;
363 tew-714tru)
364 set_usb_led "$boardname:red:usb"
365 set_wifi_led "$boardname:green:wifi"
366 ;;
367 tiny-ac)
368 set_wifi_led "$boardname:orange:wifi"
369 set_usb_led "$boardname:green:usb"
370 ;;
371 tl-wr840n-v4)
372 set_wifi_led "$boardname:green:wlan"
373 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
374 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
375 ;;
376 tl-wr841n-v13)
377 set_wifi_led "$boardname:green:wlan"
378 ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2"
379 ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4"
380 ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8"
381 ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10"
382 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
383 ;;
384 tplink,tl-mr3420-v5)
385 set_usb_led "$boardname:green:usb"
386 set_wifi_led "$boardname:green:wlan"
387 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
388 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
389 ;;
390 u25awf-h1)
391 set_wifi_led "u25awf:red:wifi"
392 ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0"
393 ;;
394 u7628-01-128M-16M)
395 ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
396 ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
397 ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
398 ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
399 ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
400 set_usb_led "u7628-01:green:usb"
401 set_wifi_led "u7628-01:green:wlan"
402 ;;
403 vocore-8M|\
404 vocore-16M)
405 ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
406 set_wifi_led "vocore:green:status"
407 ;;
408 vocore2)
409 set_wifi_led "$boardname:fuchsia:status"
410 ;;
411 vocore2lite)
412 set_wifi_led "$boardname:green:status"
413 ;;
414 w502u)
415 set_usb_led "$boardname:blue:usb"
416 set_wifi_led "rt2800pci-phy0::radio"
417 ;;
418 wcr-150gn)
419 set_usb_led "$boardname:amber:user"
420 ;;
421 we1026-5g-16m)
422 ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
423 set_wifi_led "we1026-5g:green:wifi"
424 set_usb_led "we1026-5g:green:usb" "1-1.1"
425 ;;
426 whr-1166d|\
427 whr-300hp2|\
428 whr-600d)
429 ucidef_set_led_default "power" "power" "$boardname:green:power" "1"
430 ucidef_set_led_default "router" "router" "$boardname:green:router" "1"
431 ;;
432 wl-wn575a3)
433 ucidef_set_rssimon "wlan1" "200000" "1"
434 ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49"
435 ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84"
436 ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100"
437 ;;
438 wrh-300cr)
439 set_wifi_led "$boardname:green:wlan"
440 ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
441 ;;
442 wndr3700v5)
443 ucidef_set_led_default "power" "POWER" "$boardname:green:power" "0"
444 ;;
445 wt3020-4M|\
446 wt3020-8M)
447 ucidef_set_led_default "power" "power" "wt3020:blue:power" "0"
448 ;;
449 y1)
450 set_usb_led "$boardname:blue:usb"
451 ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1"
452 ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0"
453 ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0.1" "tx rx"
454 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
455 ;;
456 y1s)
457 set_usb_led "$boardname:blue:usb"
458 ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1"
459 ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0"
460 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
461 ;;
462 zbt-ape522ii)
463 ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1"
464 ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx"
465 ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx"
466 ;;
467 zbt-cpe102)
468 ucidef_set_led_default "power" "power" "$boardname:green:4g-0" "0"
469 ;;
470 zbt-wa05)
471 ucidef_set_led_default "power" "power" "$boardname:blue:power" "1"
472 set_wifi_led "$boardname:blue:air"
473 set_usb_led "$boardname:blue:usb"
474 ;;
475 zbt-we2026)
476 set_wifi_led "$boardname:green:wlan"
477 ;;
478 zbt-we826-16M|\
479 zbt-we826-32M)
480 set_wifi_led "zbt-we826:green:wifi"
481 set_usb_led "zbt-we826:green:usb"
482 ;;
483 zbt-wr8305rt)
484 ucidef_set_led_default "power" "power" "$boardname:green:sys" "1"
485 set_usb_led "$boardname:green:usb"
486 set_wifi_led "$boardname:green:wifi"
487 ;;
488 zte-q7)
489 set_wifi_led "$boardname:blue:status"
490 ;;
491 youku-yk1)
492 set_wifi_led "$boardname:blue:air"
493 set_usb_led "$boardname:blue:usb"
494 ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
495 ;;
496 esac
497
498 board_config_flush
499
500 exit 0