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