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