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