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