5dee0d5a69716711e725c5bf90fbdcbd0fe008dc
[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 3g150b|\
21 3g300m)
22 set_usb_led "$board:blue:3g"
23 ;;
24 3g-6200n)
25 set_wifi_led "$board:amber:wlan"
26 set_usb_led "$board:blue:3g"
27 ;;
28 3g-6200nl|\
29 br-6475nd|\
30 mzk-w300nh2)
31 set_wifi_led "$board:amber:wlan"
32 ;;
33 a5-v11|\
34 cs-qr10)
35 ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
36 ;;
37 ai-br100)
38 ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2"
39 set_wifi_led "$board:blue:wlan"
40 ;;
41 air3gii)
42 set_wifi_led "$board:green:wlan"
43 set_usb_led "$board:green:mobile"
44 ;;
45 all0239-3g|\
46 hw550-3g|\
47 mofi3500-3gn|\
48 sap-g3200u3|\
49 sk-wb8|\
50 wf-2881)
51 set_usb_led "$board:green:usb"
52 ;;
53 all0256n)
54 ucidef_set_rssimon "wlan0" "40000" "1"
55 ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:rssilow" "wlan0" "1" "40" "0" "6"
56 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:green:rssimed" "wlan0" "30" "80" "-29" "5"
57 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssihigh" "wlan0" "70" "100" "-69" "8"
58 set_wifi_led "rt2800pci-phy0::radio"
59 ;;
60 ar670w|\
61 ar725w|\
62 awapn2403)
63 set_wifi_led "rt2800soc-phy0::radio"
64 ;;
65 asl26555)
66 ucidef_set_led_default "power" "POWER" "$board:green:power" "1"
67 ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
68 set_wifi_led "$board:green:wlan"
69 set_usb_led "$board:green:3g"
70 ;;
71 bc2)
72 set_usb_led "$board:blue:usb"
73 ;;
74 br-6425)
75 set_wifi_led "$board:orange:wlan"
76 ;;
77 broadway)
78 set_usb_led "$board:red:diskmounted"
79 set_wifi_led "$board:red:wps_active"
80 ;;
81 c20i)
82 ucidef_set_led_switch "lan" "lan" "$board:blue:lan" "switch0" "0x1e"
83 ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x01"
84 set_usb_led "$board:blue:usb" "2-1"
85 ucidef_set_led_wlan "wlan" "wlan" "$board:blue:wlan" "phy0radio"
86 ;;
87 c50)
88 ucidef_set_led_default "power" "power" "$board:blue:power" "0"
89 ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" "eth0.2"
90 set_usb_led "$board:blue:usb"
91 ucidef_set_led_wlan "wlan2g" "wlan2g" "$board:blue:wlan2g" "phy1radio"
92 ucidef_set_led_wlan "wlan5g" "wlan5g" "$board:blue:wlan5g" "phy0radio"
93 ;;
94 cf-wr800n)
95 ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1
96 set_wifi_led "$board:white:wifi"
97 ;;
98 cy-swr1100)
99 ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
100 set_usb_led "$board:blue:usb"
101 ;;
102 d105)
103 ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
104 set_usb_led "$board:green:usb"
105 ;;
106 db-wrt01)
107 ucidef_set_led_default "power" "power" "$board:orange:power" "1"
108 ;;
109 dch-m225)
110 ucidef_set_led_default "power" "POWER" "$board:geeen:power" "1"
111 ucidef_set_led_default "status" "STATUS" "$board:red:status" "0"
112 ;;
113 dcs-930l-b1)
114 ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
115 ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps"
116 ;;
117 dir-300-b1|\
118 dir-600-b1|\
119 dir-600-b2|\
120 dir-620-a1)
121 ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1"
122 set_wifi_led "rt2800pci-phy0::radio"
123 ;;
124 dir-300-b7|\
125 dir-320-b1|\
126 dir-610-a1|\
127 esr-9753|\
128 hlk-rm04|\
129 sl-r7205|\
130 v11st-fe|\
131 w306r-v20|\
132 wt1520)
133 set_wifi_led "rt2800pci-phy0::radio"
134 ;;
135 dir-615-d|\
136 dir-615-h1)
137 ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0"
138 set_wifi_led "rt2800pci-phy0::radio"
139 ;;
140 dir-620-d1|\
141 mzk-ex300np)
142 set_wifi_led "$board:green:wifi"
143 ;;
144 dir-810l|\
145 mzk-750dhp|\
146 mzk-dp150n)
147 ucidef_set_led_default "power" "power" "$board:green:power" "1"
148 ;;
149 dir-860l-b1)
150 ucidef_set_led_netdev "wan" "wan" "$board:green:net" "eth0.2"
151 ;;
152 ex2700)
153 ucidef_set_led_default "power_r" "POWER (red)" "$board:red:power" "0"
154 set_wifi_led "$board:green:router"
155 ;;
156 f5d8235-v1|\
157 f5d8235-v2)
158 set_usb_led "$board:blue:storage"
159 ;;
160 fonera20n)
161 set_usb_led "$board:orange:usb"
162 set_wifi_led "$board:orange:wifi"
163 ;;
164 gl-mt300a|\
165 gl-mt300n|\
166 gl-mt750)
167 set_wifi_led "$board:wlan"
168 ;;
169 hc5661)
170 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
171 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
172 set_wifi_led "$board:blue:wlan2g"
173 ;;
174 hc5761)
175 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
176 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
177 set_wifi_led "$board:blue:wlan2g"
178 ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
179 ;;
180 hc5861)
181 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
182 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
183 set_wifi_led "$board:blue:wlan2g"
184 ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
185 ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0"
186 ;;
187 hg255d)
188 set_wifi_led "$board:green:wlan"
189 set_usb_led "$board:green:usb"
190 ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2"
191 ;;
192 hpm)
193 ucidef_set_led_default "power" "POWER" "$board:orange:power" "1"
194 ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
195 set_wifi_led "$board:green:wifi"
196 ;;
197 ht-tm02)
198 ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
199 set_wifi_led "$board:blue:wlan"
200 ;;
201 m2m)
202 set_wifi_led "$board:blue:wifi"
203 ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0"
204 ;;
205 miniembplug)
206 set_wifi_led "$board:red:wlan"
207 set_usb_led "$board:green:mobile"
208 ;;
209 miwifi-mini|\
210 miwifi-nano)
211 ucidef_set_led_default "power" "power" "$board:red:status" "1"
212 ;;
213 miwifi-nano)
214 ucidef_set_led_default "power" "power" "$board:red:status" "1"
215 ucidef_set_led_wlan "radio_led" "radio" "$board:amber:radio" "phy0radio"
216 ucidef_set_led_wlan "wifi_led" "wifi" "$board:blue:wifi" "phy0assoc"
217 ;;
218 mlw221|\
219 mlwg2)
220 set_wifi_led "$board:blue:wifi"
221 ucidef_set_led_default "system" "system" "$board:blue:system" "1"
222 ;;
223 mpr-a1|\
224 mpr-a2)
225 set_wifi_led "$board:blue:system"
226 ;;
227 mr-102n)
228 set_wifi_led "$board:green:wlan"
229 set_usb_led "$board:green:usb"
230 ;;
231 mzk-ex750np)
232 ucidef_set_led_default "power" "power" "$board:red:power" "1"
233 set_wifi_led "$board:red:wifi"
234 ;;
235 na930)
236 set_usb_led "$board:blue:status"
237 ;;
238 nw718)
239 set_usb_led "$board:amber:usb"
240 ;;
241 oy-0001)
242 ucidef_set_led_default "power" "power" "$board:green:power" "1"
243 set_wifi_led "$board:green:wifi"
244 ;;
245 pbr-d1)
246 set_usb_led "$board:orange:usb"
247 ;;
248 pbr-m1)
249 ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
250 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
251 ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1"
252 ;;
253 psg1208)
254 set_wifi_led "$board:white:wlan2g"
255 ;;
256 px-4885)
257 set_wifi_led "$board:orange:wifi"
258 set_usb_led "$board:blue:storage"
259 ;;
260 re6500)
261 ucidef_set_led_default "power" "power" "$board:white:power" "1"
262 ucidef_set_led_default "wifi" "wifi" "$board:orange:wifi" "1"
263 ;;
264 rp-n53)
265 ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
266 set_wifi_led "$board:blue:wifi"
267 ;;
268 rt-n14u)
269 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
270 ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1
271 ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2
272 set_wifi_led "$board:blue:air"
273 set_usb_led "$board:blue:usb"
274 ;;
275 tew-714tru)
276 set_usb_led "$board:red:usb"
277 set_wifi_led "$board:green:wifi"
278 ;;
279 tiny-ac)
280 set_wifi_led "$board:orange:wifi"
281 set_usb_led "$board:green:usb"
282 ;;
283 vocore)
284 ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0"
285 set_wifi_led "$board:green:status"
286 ;;
287 w502u)
288 set_usb_led "$board:blue:usb"
289 set_wifi_led "rt2800pci-phy0::radio"
290 ;;
291 wcr-150gn)
292 set_usb_led "$board:amber:user"
293 ;;
294 whr-1166d|\
295 whr-300hp2|\
296 whr-600d)
297 ucidef_set_led_default "power" "power" "$board:green:power" "1"
298 ucidef_set_led_default "router" "router" "$board:green:router" "1"
299 ;;
300 wnce2001)
301 set_wifi_led "$board:green:wlan"
302 ;;
303 wrh-300cr)
304 set_wifi_led "$board:green:wlan"
305 ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0"
306 ;;
307 wndr3700v5)
308 ucidef_set_led_default "power" "POWER" "$board:green:power" "0"
309 ;;
310 wt3020)
311 ucidef_set_led_default "power" "power" "$board:blue:power" "0"
312 ;;
313 y1|\
314 y1s)
315 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
316 set_usb_led "$board:blue:usb"
317 set_wifi_led "$board:blue:wifi"
318 ;;
319 zbt-ape522ii)
320 ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1"
321 ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx"
322 ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx"
323 ;;
324 zbt-cpe102)
325 ucidef_set_led_default "power" "power" "$board:green:4g-0" "0"
326 ;;
327 zbt-wa05)
328 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
329 set_wifi_led "$board:blue:air"
330 set_usb_led "$board:blue:usb"
331 ;;
332 zbt-we826)
333 ucidef_set_led_default "power" "power" "$board:green:power" "1"
334 set_wifi_led "$board:green:wifi"
335 set_usb_led "$board:green:usb"
336 ;;
337 zbt-wr8305rt)
338 ucidef_set_led_default "power" "power" "$board:green:sys" "1"
339 set_usb_led "$board:green:usb"
340 set_wifi_led "$board:green:wifi"
341 ;;
342 zte-q7)
343 set_wifi_led "$board:blue:status"
344 ;;
345 youku-yk1)
346 ucidef_set_led_default "power" "power" "$board:blue:power" "1"
347 set_wifi_led "$board:blue:air"
348 set_usb_led "$board:blue:usb"
349 ;;
350 esac
351
352 board_config_flush
353
354 exit 0