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