ramips: add support for GL-inet GL-MT300N-V2
[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 gl-mt300n-v2)
170 status_led="$board:red:wlan"
171 ;;
172 m4-4M|\
173 m4-8M)
174 status_led="m4:blue:status"
175 ;;
176 miwifi-mini|\
177 zte-q7)
178 status_led="$board:red:status"
179 ;;
180 mr-102n)
181 status_led="$board:amber:status"
182 ;;
183 mr200)
184 status_led="$board:white:power"
185 ;;
186 nw718)
187 status_led="$board:amber:cpu"
188 ;;
189 newifi-d1)
190 status_led="$board:blue:status"
191 ;;
192 omega2| \
193 omega2p)
194 status_led="$board:amber:system"
195 ;;
196 oy-0001|\
197 sl-r7205)
198 status_led="$board:green:wifi"
199 ;;
200 psr-680w)
201 status_led="$board:red:wan"
202 ;;
203 px-4885-4M|\
204 px-4885-8M)
205 status_led="px-4885:orange:wifi"
206 ;;
207 re6500|\
208 whr-1166d|\
209 whr-600d|\
210 widora-neo)
211 status_led="$board:orange:wifi"
212 ;;
213 mzk-ex300np|\
214 rt-n10-plus|\
215 tew-691gr|\
216 tew-692gr|\
217 ur-326n4g|\
218 ur-336un|\
219 wf-2881)
220 status_led="$board:green:wps"
221 ;;
222 rb750gr3)
223 status_led="$board:blue:pwr"
224 ;;
225 sap-g3200u3)
226 status_led="$board:green:usb"
227 ;;
228 v22rw-2x2)
229 status_led="$board:green:security"
230 ;;
231 vocore-8M|\
232 vocore-16M)
233 status_led="vocore:green:status"
234 ;;
235 vocore2)
236 status_led="$board:fuchsia:status"
237 ;;
238 w306r-v20|\
239 witi|\
240 zbt-wr8305rt)
241 status_led="$board:green:sys"
242 ;;
243 wcr-1166ds|\
244 whr-300hp2|\
245 wsr-1166|\
246 wsr-600)
247 status_led="$board:green:power"
248 ;;
249 wcr-150gn|\
250 wl-351)
251 status_led="$board:amber:power"
252 ;;
253 whr-g300n|\
254 wlr-6000|\
255 zbt-we2026)
256 status_led="$board:red:power"
257 ;;
258 wzr-agl300nh)
259 status_led="$board:green:router"
260 ;;
261 wizfi630a)
262 status_led="$board::run"
263 ;;
264 wr512-3gn-4M|\
265 wr512-3gn-8M)
266 status_led="wr512-3gn:green:wps"
267 ;;
268 wrtnode2r | \
269 wrtnode2p | \
270 wrtnode)
271 status_led="wrtnode:blue:indicator"
272 ;;
273 wt3020-4M|\
274 wt3020-8M)
275 status_led="wt3020:blue:power"
276 ;;
277 zbt-cpe102)
278 status_led="$board:green:4g-0"
279 ;;
280 zbt-we826-16M|\
281 zbt-we826-32M)
282 status_led="zbt-we826:green:power"
283 ;;
284 zbt-wg3526-16M|\
285 zbt-wg3526-32M)
286 status_led="zbt-wg3526:green:status"
287 ;;
288 esac
289 }
290
291 set_state() {
292 get_status_led $1
293
294 case "$1" in
295 preinit)
296 status_led_blink_preinit
297 ;;
298 failsafe)
299 status_led_blink_failsafe
300 ;;
301 upgrade | \
302 preinit_regular)
303 status_led_blink_preinit_regular
304 ;;
305 done)
306 status_led_on
307 ;;
308 esac
309 }