ramips: add support for ALFA Network AWUSFREE1
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2010-2013 OpenWrt.org
3
4 . /lib/functions.sh
5 . /lib/functions/leds.sh
6
7 get_status_led() {
8 board=$(board_name)
9 boardname="${board##*,}"
10
11 case $board in
12 3g150b|\
13 3g300m|\
14 w150m)
15 status_led="$boardname:blue:ap"
16 ;;
17 3g-6200n|\
18 ar670w|\
19 ar725w|\
20 br-6475nd|\
21 c50|\
22 dch-m225|\
23 dir-860l-b1|\
24 e1700|\
25 ex2700|\
26 ex3700|\
27 fonera20n|\
28 firewrt|\
29 hg255d|\
30 kn|\
31 kn_rc|\
32 kn_rf|\
33 kng_rc|\
34 mzk-750dhp|\
35 mzk-dp150n|\
36 mzk-w300nh2|\
37 nbg-419n|\
38 nbg-419n2|\
39 pwh2004|\
40 r6220|\
41 tplink,c20-v4|\
42 tplink,c50-v3|\
43 tplink,tl-mr3420-v5|\
44 tl-wr840n-v4|\
45 tl-wr840n-v5|\
46 tl-wr841n-v13|\
47 vr500|\
48 wnce2001|\
49 wndr3700v5|\
50 x5|\
51 x8|\
52 xdxrn502j|\
53 wn3000rpv3)
54 status_led="$boardname:green:power"
55 ;;
56 3g-6200nl)
57 status_led="$boardname:green:internet"
58 ;;
59 a5-v11|\
60 cs-qr10|\
61 d105|\
62 dcs-930l-b1|\
63 hlk-rm04|\
64 jhr-n825r|\
65 mpr-a1|\
66 mpr-a2|\
67 mzk-ex750np)
68 status_led="$boardname:red:power"
69 ;;
70 ai-br100|\
71 ht-tm02)
72 status_led="$boardname:blue:wlan"
73 ;;
74 alfa-network,ac1200rm|\
75 awapn2403|\
76 dir-645|\
77 sk-wb8|\
78 wrh-300cr)
79 status_led="$boardname:green:wps"
80 ;;
81 alfa-network,awusfree1)
82 status_led="$boardname:orange:system"
83 ;;
84 all0239-3g|\
85 dcs-930|\
86 dir-300-b1|\
87 dir-300-b7|\
88 dir-320-b1|\
89 dir-600-b1|\
90 dir-610-a1|\
91 dir-615-d|\
92 dir-615-h1|\
93 dir-620-a1|\
94 dir-620-d1|\
95 dwr-512-b|\
96 gb-pc1|\
97 gnubee,gb-pc2|\
98 hpm|\
99 hw550-3g|\
100 mac1200rv2|\
101 miniembwifi|\
102 mofi3500-3gn|\
103 rut5xx|\
104 v11st-fe|\
105 wmr-300|\
106 zbt-wg2626)
107 status_led="$boardname:green:status"
108 ;;
109 asl26555-8M|\
110 asl26555-16M)
111 status_led="asl26555:green:power"
112 ;;
113 atp-52b|\
114 ew1200|\
115 ip2202)
116 status_led="$boardname:green:run"
117 ;;
118 c108)
119 status_led="$boardname:green:lan"
120 ;;
121 cf-wr800n|\
122 psg1208)
123 status_led="$boardname:white:wps"
124 ;;
125 psg1218a|\
126 psg1218b)
127 status_led="$boardname:yellow:status"
128 ;;
129 cy-swr1100|\
130 w502u)
131 status_led="$boardname:blue:wps"
132 ;;
133 d240|\
134 dap-1350|\
135 na930|\
136 d-team,newifi-d2|\
137 pbr-m1|\
138 re350-v1|\
139 rt-ac51u|\
140 rt-n13u|\
141 rt-n14u|\
142 rt-n15|\
143 rt-n56u|\
144 tplink,c20-v1|\
145 wl-330n|\
146 wl-330n3g|\
147 wli-tx4-ag300n|\
148 y1|\
149 y1s|\
150 youku-yk1)
151 status_led="$boardname:blue:power"
152 ;;
153 dlink,dap-1522-a1|\
154 k2p|\
155 m3|\
156 mir3g|\
157 miwifi-nano)
158 status_led="$boardname:blue:status"
159 ;;
160 db-wrt01|\
161 esr-9753|\
162 pbr-d1)
163 status_led="$boardname:orange:power"
164 ;;
165 f5d8235-v1)
166 status_led="$boardname:blue:wired"
167 ;;
168 f5d8235-v2)
169 status_led="$boardname:blue:router"
170 ;;
171 f7c027|\
172 timecloud)
173 status_led="$boardname:orange:status"
174 ;;
175 hc5*61|\
176 hc5661a|\
177 jhr-n805r|\
178 jhr-n926r|\
179 mlw221|\
180 mlwg2|\
181 vonets,var11n-300)
182 status_led="$boardname:blue:system"
183 ;;
184 hc5962)
185 status_led="$boardname:white:status"
186 ;;
187 linkits7688)
188 status_led="linkit-smart-7688:orange:wifi"
189 ;;
190 m2m)
191 status_led="$boardname:blue:wifi"
192 ;;
193 gl-mt300n-v2)
194 status_led="$boardname:red:wlan"
195 ;;
196 m4-4M|\
197 m4-8M)
198 status_led="m4:blue:status"
199 ;;
200 miwifi-mini|\
201 zte-q7)
202 status_led="$boardname:red:status"
203 ;;
204 mr-102n)
205 status_led="$boardname:amber:status"
206 ;;
207 mr200)
208 status_led="$boardname:white:power"
209 ;;
210 nw718)
211 status_led="$boardname:amber:cpu"
212 ;;
213 newifi-d1)
214 status_led="$boardname:blue:status"
215 ;;
216 omega2| \
217 omega2p)
218 status_led="$boardname:amber:system"
219 ;;
220 oy-0001|\
221 sl-r7205)
222 status_led="$boardname:green:wifi"
223 ;;
224 psr-680w)
225 status_led="$boardname:red:wan"
226 ;;
227 px-4885-4M|\
228 px-4885-8M)
229 status_led="px-4885:orange:wifi"
230 ;;
231 re6500|\
232 whr-1166d|\
233 whr-600d)
234 status_led="$boardname:orange:wifi"
235 ;;
236 mzk-ex300np|\
237 rt-n10-plus|\
238 tew-638apb-v2|\
239 tew-691gr|\
240 tew-692gr|\
241 ur-326n4g|\
242 ur-336un|\
243 wf-2881)
244 status_led="$boardname:green:wps"
245 ;;
246 rb750gr3)
247 status_led="$boardname:blue:pwr"
248 ;;
249 sap-g3200u3)
250 status_led="$boardname:green:usb"
251 ;;
252 u25awf-h1)
253 status_led="u25awf:red:wifi"
254 ;;
255 u7621-06-256M-16M)
256 status_led="u7621-06:green:status"
257 ;;
258 u7628-01-128M-16M)
259 status_led="u7628-01:green:power"
260 ;;
261 v22rw-2x2)
262 status_led="$boardname:green:security"
263 ;;
264 vocore-8M|\
265 vocore-16M)
266 status_led="vocore:green:status"
267 ;;
268 vocore2)
269 status_led="$boardname:fuchsia:status"
270 ;;
271 vocore2lite)
272 status_led="$boardname:green:status"
273 ;;
274 w306r-v20|\
275 witi|\
276 zbt-wr8305rt)
277 status_led="$boardname:green:sys"
278 ;;
279 wcr-1166ds|\
280 whr-300hp2|\
281 wsr-1166|\
282 wsr-600)
283 status_led="$boardname:green:power"
284 ;;
285 wcr-150gn|\
286 wl-351)
287 status_led="$boardname:amber:power"
288 ;;
289 whr-g300n|\
290 wlr-6000|\
291 zbt-we2026)
292 status_led="$boardname:red:power"
293 ;;
294 widora,neo-16m|\
295 widora,neo-32m)
296 status_led="widora:orange:wifi"
297 ;;
298 wzr-agl300nh)
299 status_led="$boardname:green:router"
300 ;;
301 wizfi630a)
302 status_led="$boardname::run"
303 ;;
304 wr512-3gn-4M|\
305 wr512-3gn-8M)
306 status_led="wr512-3gn:green:wps"
307 ;;
308 wrtnode2r | \
309 wrtnode2p | \
310 wrtnode)
311 status_led="wrtnode:blue:indicator"
312 ;;
313 wt3020-4M|\
314 wt3020-8M)
315 status_led="wt3020:blue:power"
316 ;;
317 zbt-cpe102)
318 status_led="$boardname:green:4g-0"
319 ;;
320 zbt-we826-16M|\
321 zbt-we826-32M)
322 status_led="zbt-we826:green:power"
323 ;;
324 zbtlink,zbt-we1226)
325 status_led="$boardname:green:wlan"
326 ;;
327 zbt-wg3526-16M|\
328 zbt-wg3526-32M)
329 status_led="zbt-wg3526:green:status"
330 ;;
331 esac
332 }
333
334 set_state() {
335 get_status_led $1
336
337 case "$1" in
338 preinit)
339 status_led_blink_preinit
340 ;;
341 failsafe)
342 status_led_blink_failsafe
343 ;;
344 upgrade | \
345 preinit_regular)
346 status_led_blink_preinit_regular
347 ;;
348 done)
349 status_led_on
350 ;;
351 esac
352 }