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