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