9322228a10a555aae0e7bf08578337f525da09f2
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / board.d / 01_leds
1 #!/bin/sh
2
3 . /lib/functions/uci-defaults.sh
4 . /lib/ramips.sh
5
6 set_usb_led() {
7 ucidef_set_led_usbdev "usb" "USB" "${1}" "${2:-1-1}"
8 }
9
10 set_wifi_led() {
11 ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
12 }
13
14
15 board=$(ramips_board_name)
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 "$board:green:usb"
30 ;;
31 3g150b|\
32 3g300m)
33 set_usb_led "$board:blue:3g"
34 ;;
35 3g-6200n)
36 set_wifi_led "$board:amber:wlan"
37 set_usb_led "$board:blue:3g"
38 ;;
39 3g-6200nl|\
40 wnce2001)
41 set_wifi_led "$board:green:wlan"
42 ;;
43 br-6475nd|\
44 mzk-w300nh2)
45 set_wifi_led "$board:amber:wlan"
46 ;;
47 a5-v11|\
48 cs-qr10)
49 ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
50 ;;
51 ai-br100)
52 ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2"
53 set_wifi_led "$board:blue:wlan"
54 ;;
55 air3gii)
56 set_wifi_led "$board:green:wlan"
57 set_usb_led "$board: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 "$board:blue:usb"
81 ;;
82 br-6425)
83 set_wifi_led "$board:orange:wlan"
84 ;;
85 broadway)
86 set_usb_led "$board:red:diskmounted"
87 set_wifi_led "$board:red:wps_active"
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_default "power" "power" "$board:green:power" "0"
97 ucidef_set_led_switch "lan" "lan" "$board:green:lan" "switch0" "0x1e"
98 ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01"
99 set_usb_led "$board:green:usb"
100 ucidef_set_led_netdev "wlan2g" "wlan2g" "$board:green:wlan2g" wlan1
101 set_wifi_led "$board:green:wlan5g"
102 ;;
103 cf-wr800n)
104 ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1
105 set_wifi_led "$board:white:wifi"
106 ;;
107 cy-swr1100)
108 ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
109 set_usb_led "$board:blue:usb"
110 ;;
111 d105)
112 ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
113 set_usb_led "$board:green:usb"
114 ;;
115 d240)
116 set_wifi_led "$board:blue:wifi"
117 set_usb_led "$board:blue:usb"
118 ;;
119 db-wrt01)
120 ucidef_set_led_default "power" "power" "$board:orange:power" "1"
121 ;;
122 dch-m225)
123 ucidef_set_led_default "power" "POWER" "$board:geeen:power" "1"
124 ucidef_set_led_default "status" "STATUS" "$board:red:status" "0"
125 ;;
126 dcs-930l-b1)
127 ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
128 ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
129 ;;
130 dir-300-b1|\
131 dir-600-b1|\
132 dir-620-a1)
133 ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1"
134 set_wifi_led "rt2800pci-phy0::radio"
135 ;;
136 dir-300-b7|\
137 dir-320-b1|\
138 dir-610-a1|\
139 esr-9753|\
140 hlk-rm04|\
141 sl-r7205|\
142 v11st-fe|\
143 w306r-v20|\
144 wt1520-4M|\
145 wt1520-8M)
146 set_wifi_led "rt2800pci-phy0::radio"
147 ;;
148 dir-615-d|\
149 dir-615-h1)
150 ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0"
151 set_wifi_led "rt2800pci-phy0::radio"
152 ;;
153 dir-620-d1|\
154 mzk-ex300np)
155 set_wifi_led "$board:green:wifi"
156 ;;
157 dir-810l|\
158 mzk-750dhp|\
159 mzk-dp150n|\
160 vr500)
161 ucidef_set_led_default "power" "power" "$board:green:power" "1"
162 ;;
163 dir-860l-b1)
164 ucidef_set_led_netdev "wan" "wan" "$board:green:net" "eth0.2"
165 ;;
166 ex2700|\
167 wn3000rpv3)
168 ucidef_set_led_default "power_r" "POWER (red)" "$board:red:power" "0"
169 set_wifi_led "$board:green:router"
170 ;;
171 ex3700)
172 ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$board:green:router" "wlan0"
173 ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$board:green:device" "wlan1"
174 ;;
175 f5d8235-v1)
176 ucidef_set_led_default "lan" "lan" "$board:blue:wired" "0"
177 set_usb_led "$board:blue:storage"
178 set_wifi_led "$board:blue:wireless"
179 ;;
180 f5d8235-v2)
181 set_usb_led "$board:blue:storage"
182 ;;
183 fonera20n)
184 set_usb_led "$board:orange:usb"
185 set_wifi_led "$board:orange:wifi"
186 ;;
187 gl-mt300a|\
188 gl-mt300n|\
189 gl-mt750)
190 set_wifi_led "$board:wlan"
191 ;;
192 hc5661|\
193 hc5661a)
194 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
195 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
196 set_wifi_led "$board:blue:wlan2g"
197 ;;
198 hc5761)
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 ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
203 ;;
204 hc5861)
205 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
206 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
207 set_wifi_led "$board:blue:wlan2g"
208 ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
209 ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0"
210 ;;
211 hg255d)
212 set_wifi_led "$board:green:wlan"
213 set_usb_led "$board:green:usb"
214 ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2"
215 ;;
216 hpm)
217 ucidef_set_led_default "power" "POWER" "$board:orange:power" "1"
218 ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
219 set_wifi_led "$board:green:wifi"
220 ;;
221 ht-tm02)
222 ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
223 set_wifi_led "$board:blue:wlan"
224 ;;
225 kn|\
226 nbg-419n2)
227 set_usb_led "$board:green:usb"
228 set_wifi_led "rt2800pci-phy0::radio"
229 ;;
230 kn_rc|\
231 kn_rf|\
232 kng_rc)
233 set_usb_led "$board:green:usb"
234 set_wifi_led "$board:green:wifi"
235 ;;
236 m2m)
237 set_wifi_led "$board:blue:wifi"
238 ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0"
239 ;;
240 miniembplug)
241 set_wifi_led "$board:red:wlan"
242 set_usb_led "$board:green:mobile"
243 ;;
244 miwifi-mini)
245 ucidef_set_led_default "power" "power" "$board:red:status" "1"
246 ;;
247 mlw221|\
248 mlwg2)
249 set_wifi_led "$board:blue:wifi"
250 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
251 ;;
252 mpr-a1|\
253 mpr-a2)
254 set_wifi_led "$board:blue:system"
255 ;;
256 mr-102n)
257 set_wifi_led "$board:green:wlan"
258 set_usb_led "$board:green:usb"
259 ;;
260 mr200)
261 ucidef_set_led_default "power" "power" "$board:white:power" "1"
262 ucidef_set_led_netdev "lan" "lan" "$board:white:lan" "eth0.1"
263 ucidef_set_led_netdev "wan" "wan" "$board:white:wan" "usb0"
264 set_wifi_led "$board:white:wlan"
265 ;;
266 mzk-ex750np)
267 ucidef_set_led_default "power" "power" "$board:red:power" "1"
268 set_wifi_led "$board:red:wifi"
269 ;;
270 na930)
271 set_usb_led "$board:blue:status"
272 ;;
273 newifi-d1)
274 set_usb_led "$board:red:status"
275 ;;
276 nw718)
277 set_usb_led "$board:amber:usb"
278 ;;
279 oy-0001)
280 ucidef_set_led_default "power" "power" "$board:green:power" "1"
281 set_wifi_led "$board:green:wifi"
282 ;;
283 pbr-d1)
284 set_usb_led "$board:orange:usb"
285 ;;
286 pbr-m1)
287 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
288 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
289 ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1"
290 ;;
291 psg1208)
292 set_wifi_led "$board:white:wlan2g"
293 ;;
294 psg1218a|\
295 psg1218b)
296 ucidef_set_led_netdev "Network" "Network" "$board:blue:status" "eth0"
297 ucidef_set_led_default "status" "STATUS" "$board:yellow:status" "0"
298 ;;
299 px-4885-4M|\
300 px-4885-8M)
301 set_wifi_led "px-4885:orange:wifi"
302 set_usb_led "px-4885:blue:storage"
303 ;;
304 r6220)
305 ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2
306 set_wifi_led "$board:green:wifi"
307 set_usb_led "$board:green:usb"
308 ;;
309 re6500)
310 ucidef_set_led_default "power" "power" "$board:white:power" "1"
311 ucidef_set_led_default "wifi" "wifi" "$board:orange:wifi" "1"
312 ;;
313 rp-n53)
314 ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
315 set_wifi_led "$board:blue:wifi"
316 ;;
317 rt-n14u)
318 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
319 ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1
320 ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2
321 set_wifi_led "$board:blue:air"
322 set_usb_led "$board:blue:usb"
323 ;;
324 tew-714tru)
325 set_usb_led "$board:red:usb"
326 set_wifi_led "$board:green:wifi"
327 ;;
328 tiny-ac)
329 set_wifi_led "$board:orange:wifi"
330 set_usb_led "$board:green:usb"
331 ;;
332 vocore-8M|\
333 vocore-16M)
334 ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
335 set_wifi_led "vocore:green:status"
336 ;;
337 vocore2)
338 set_wifi_led "$board:fuchsia:status"
339 ;;
340 w502u)
341 set_usb_led "$board:blue:usb"
342 set_wifi_led "rt2800pci-phy0::radio"
343 ;;
344 wcr-150gn)
345 set_usb_led "$board:amber:user"
346 ;;
347 whr-1166d|\
348 whr-300hp2|\
349 whr-600d)
350 ucidef_set_led_default "power" "power" "$board:green:power" "1"
351 ucidef_set_led_default "router" "router" "$board:green:router" "1"
352 ;;
353 wl-wn575a3)
354 ucidef_set_rssimon "wlan1" "200000" "1"
355 ucidef_set_led_rssi "wifi-low" "wifi-low" "$board:green:wifi-low" "wlan1" "1" "49" "0" "1"
356 ucidef_set_led_rssi "wifi-med" "wifi-med" "$board:green:wifi-med" "wlan1" "50" "84" "0" "1"
357 ucidef_set_led_rssi "wifi-high" "wifi-high" "$board:green:wifi-high" "wlan1" "85" "100" "0" "1"
358 ;;
359 wrh-300cr)
360 set_wifi_led "$board:green:wlan"
361 ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0"
362 ;;
363 wndr3700v5)
364 ucidef_set_led_default "power" "POWER" "$board:green:power" "0"
365 ;;
366 wt3020-4M|\
367 wt3020-8M)
368 ucidef_set_led_default "power" "power" "wt3020:blue:power" "0"
369 ;;
370 y1)
371 set_usb_led "$board:blue:usb"
372 ucidef_set_led_netdev "wifi" "WIFI" "$board:blue:wifi" "wlan1"
373 ucidef_set_led_netdev "wifi5g" "WIFI5G" "$board:blue:wifi5g" "wlan0"
374 ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0.1" "tx rx"
375 ucidef_set_led_netdev "wan" "WAN" "$board:blue:internet" "eth0.2" "tx rx"
376 ;;
377 y1s)
378 set_usb_led "$board:blue:usb"
379 ucidef_set_led_netdev "wifi" "WIFI" "$board:yellow:wifi" "wlan1"
380 ucidef_set_led_netdev "wifi5g" "WIFI5G" "$board:blue:wifi" "wlan0"
381 ucidef_set_led_netdev "wan" "WAN" "$board:blue:internet" "eth0.2" "tx rx"
382 ;;
383 zbt-ape522ii)
384 ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1"
385 ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx"
386 ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx"
387 ;;
388 zbt-cpe102)
389 ucidef_set_led_default "power" "power" "$board:green:4g-0" "0"
390 ;;
391 zbt-wa05)
392 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
393 set_wifi_led "$board:blue:air"
394 set_usb_led "$board:blue:usb"
395 ;;
396 zbt-we2026)
397 set_wifi_led "$board:green:wlan"
398 ;;
399 zbt-we826-16M|\
400 zbt-we826-32M)
401 set_wifi_led "zbt-we826:green:wifi"
402 set_usb_led "zbt-we826:green:usb"
403 ;;
404 zbt-wr8305rt)
405 ucidef_set_led_default "power" "power" "$board:green:sys" "1"
406 set_usb_led "$board:green:usb"
407 set_wifi_led "$board:green:wifi"
408 ;;
409 zte-q7)
410 set_wifi_led "$board:blue:status"
411 ;;
412 youku-yk1)
413 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
414 set_wifi_led "$board:blue:air"
415 set_usb_led "$board:blue:usb"
416 ;;
417 esac
418
419 board_config_flush
420
421 exit 0