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