ramips: add support for Xiaomi MiWiFi Mini devices
[openwrt/svn-archive/archive.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 case $(ramips_board_name) in
9 3g-6200n)
10 status_led="edimax:green:power"
11 ;;
12 3g150b | 3g300m | w150m)
13 status_led="tenda:blue:ap"
14 ;;
15 ai-br100)
16 status_led="aigale:blue:wlan"
17 ;;
18 ar670w)
19 status_led="ar670w:green:power"
20 ;;
21 ar725w)
22 status_led="ar725w:green:power"
23 ;;
24 awapn2403)
25 status_led="asiarf:green:wps"
26 ;;
27 argus-atp52b)
28 status_led="argus-atp52b:green:run"
29 ;;
30 asl26555)
31 status_led="asl26555:green:power"
32 ;;
33 br6524n)
34 status_led="edimax:blue:power"
35 ;;
36 br6425 | br-6475nd)
37 status_led="edimax:green:power"
38 ;;
39 cy-swr1100)
40 status_led="samsung:blue:wps"
41 ;;
42 d105)
43 status_led="d105:red:power"
44 ;;
45 dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1)
46 status_led="d-link:green:status"
47 ;;
48 dir-645)
49 status_led="d-link:green:wps"
50 ;;
51 dap-1350)
52 status_led="d-link:blue:power"
53 ;;
54 e1700)
55 status_led="linksys:green:power"
56 ;;
57 esr-9753)
58 status_led="esr-9753:orange:power"
59 ;;
60 f5d8235-v2)
61 status_led="f5d8235v2:blue:router"
62 ;;
63 fonera20n)
64 status_led="fonera20n:green:power"
65 ;;
66 ip2202)
67 status_led="ip2202:green:run"
68 ;;
69 rt-n13u)
70 status_led="rt-n13u:power"
71 ;;
72 hlk-rm04)
73 status_led="hlk-rm04:red:power"
74 ;;
75 ht-tm02)
76 status_led="ht-tm02:blue:wlan"
77 ;;
78 all0239-3g|\
79 hw550-3g)
80 status_led="hw550-3g:green:status"
81 ;;
82 m2m)
83 status_led="m2m:blue:wifi"
84 ;;
85 m3)
86 status_led="m3:blue:status"
87 ;;
88 m4)
89 status_led="m4:blue:status"
90 ;;
91 mlw221)
92 status_led="kingston:blue:status"
93 ;;
94 mlwg2)
95 status_led="kingston:blue:system"
96 ;;
97 mofi3500-3gn)
98 status_led="mofi3500-3gn:green:status"
99 ;;
100 mpr-a1)
101 status_led="hame:red:power"
102 ;;
103 mpr-a2)
104 status_led="hame:red:power"
105 ;;
106 nbg-419n)
107 status_led="nbg-419n:green:power"
108 ;;
109 nw718)
110 status_led="nw718:amber:cpu"
111 ;;
112 omni-emb|\
113 omni-emb-hpm)
114 status_led="emb:green:status"
115 ;;
116 psr-680w)
117 status_led="psr-680w:red:wan"
118 ;;
119 pwh2004)
120 status_led="pwh2004:green:power"
121 ;;
122 px4885)
123 status_led="7links:orange:wifi"
124 ;;
125 rt-n15)
126 status_led="rt-n15:blue:power"
127 ;;
128 rt-n10-plus)
129 status_led="asus:green:wps"
130 ;;
131 rt-n56u | wl-330n | wl-330n3g)
132 status_led="asus:blue:power"
133 ;;
134 rut5xx)
135 status_led="rut5xx:green:status"
136 ;;
137 sl-r7205)
138 status_led="sl-r7205:green:status"
139 ;;
140 tew-691gr|\
141 tew-692gr)
142 status_led="trendnet:green:wps"
143 ;;
144 v11st-fe)
145 status_led="v11st-fe:green:status"
146 ;;
147 v22rw-2x2)
148 status_led="v22rw-2x2:green:security"
149 ;;
150 vocore)
151 status_led="vocore:green:status"
152 ;;
153 w306r-v20)
154 status_led="w306r-v20:green:sys"
155 ;;
156 w502u)
157 status_led="alfa:blue:wps"
158 ;;
159 wcr-150gn)
160 status_led="wcr150gn:amber:power"
161 ;;
162 whr-g300n)
163 status_led="whr-g300n:green:router"
164 ;;
165 wmr300 | \
166 whr-300hp2 | \
167 whr-600d)
168 status_led="buffalo:green:status"
169 ;;
170 wli-tx4-ag300n)
171 status_led="buffalo:blue:power"
172 ;;
173 wl-351)
174 status_led="wl-351:amber:power"
175 ;;
176 wr512-3gn)
177 status_led="wr512:green:wps"
178 ;;
179 wr8305rt)
180 status_led="wr8305rt:sys"
181 ;;
182 wsr-600 | \
183 wsr-1166)
184 status_led="buffalo:orange:diag"
185 ;;
186 wnce2001)
187 status_led="netgear:green:power"
188 ;;
189 nexx-wt1520)
190 status_led="nexx-wt1520:white:power"
191 ;;
192 nexx-wt3020)
193 status_led="nexx:blue:power"
194 ;;
195 mzk-w300nh2)
196 status_led="mzkw300nh2:green:power"
197 ;;
198 ur-326n4g)
199 status_led="ur326:green:wps"
200 ;;
201 ur-336un)
202 status_led="ur336:green:wps"
203 ;;
204 x5)
205 status_led="x5:green:power"
206 ;;
207 x8)
208 status_led="x8:green:power"
209 ;;
210 xdxrn502j)
211 status_led="xdxrn502j:green:power"
212 ;;
213 xiaomi-mini)
214 status_led="xiaomi:red:status"
215 ;;
216 f7c027)
217 status_led="belkin:orange:status"
218 ;;
219 na930)
220 status_led="na930:blue:power"
221 ;;
222 y1 | \
223 y1s)
224 status_led="lenovo:blue:power"
225 ;;
226 esac
227 }
228
229 set_state() {
230 get_status_led
231
232 case "$1" in
233 preinit)
234 status_led_blink_preinit
235 ;;
236 failsafe)
237 status_led_blink_failsafe
238 ;;
239 preinit_regular)
240 status_led_blink_preinit_regular
241 ;;
242 done)
243 status_led_on
244 ;;
245 esac
246 }