ar71xx: add board support for ubnt loco m xw
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2009-2013 OpenWrt.org
3
4 . /lib/functions/leds.sh
5 . /lib/ar71xx.sh
6
7 get_status_led() {
8 case $(ar71xx_board_name) in
9 alfa-nx)
10 status_led="alfa:green:led_8"
11 ;;
12 all0305)
13 status_led="eap7660d:green:ds4"
14 ;;
15 ap132)
16 status_led="ap132:green:status"
17 ;;
18 ap136-010|\
19 ap136-020)
20 status_led="ap136:green:status"
21 ;;
22 ap135-020)
23 status_led="ap135:green:status"
24 ;;
25 ap81)
26 status_led="ap81:green:status"
27 ;;
28 ap83)
29 status_led="ap83:green:power"
30 ;;
31 ap96)
32 status_led="ap96:green:led2"
33 ;;
34 aw-nr580)
35 status_led="aw-nr580:green:ready"
36 ;;
37 bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw)
38 status_led="ubnt:green:link4"
39 ;;
40 bxu2000n-2-a1)
41 status_led="bhu:green:status"
42 ;;
43 cap4200ag)
44 status_led="senao:green:pwr"
45 ;;
46 db120)
47 status_led="db120:green:status"
48 ;;
49 dir-505-a1 |\
50 dir-600-a1 |\
51 dir-615-e1 |\
52 dir-615-e4)
53 status_led="d-link:green:power"
54 ;;
55 dir-615-c1)
56 status_led="d-link:green:status"
57 ;;
58 dir-825-b1)
59 status_led="d-link:orange:power"
60 ;;
61 dir-825-c1 |\
62 dir-835-a1)
63 status_led="d-link:amber:power"
64 ;;
65 eap300v2)
66 status_led="engenius:blue:power"
67 ;;
68 eap7660d)
69 status_led="eap7660d:green:ds4"
70 ;;
71 el-mini | \
72 el-m150)
73 status_led="EasyLink:green:system"
74 ;;
75 gl-inet)
76 status_led="gl-connect:green:lan"
77 ;;
78 esr1750)
79 status_led="esr1750:amber:power"
80 ;;
81 esr900)
82 status_led="engenius:amber:power"
83 ;;
84 hiwifi-hc6361)
85 status_led="hiwifi:blue:system"
86 ;;
87 hornet-ub)
88 status_led="alfa:blue:wps"
89 ;;
90 ja76pf | \
91 ja76pf2)
92 status_led="jjplus:green:led1"
93 ;;
94 ls-sr71)
95 status_led="ubnt:green:d22"
96 ;;
97 mr600)
98 status_led="mr600:orange:power"
99 ;;
100 mr600v2)
101 status_led="mr600:blue:power"
102 ;;
103 mynet-n600 | \
104 mynet-n750)
105 status_led="wd:blue:power"
106 ;;
107 mynet-rext)
108 status_led="wd:blue:power"
109 ;;
110 mzk-w04nu | \
111 mzk-w300nh)
112 status_led="planex:green:status"
113 ;;
114 nbg460n_550n_550nh)
115 status_led="nbg460n:green:power"
116 ;;
117 nbg6716)
118 status_led="nbg6716:white:power"
119 ;;
120 om2p | \
121 om2pv2 | \
122 om2p-hs | \
123 om2p-hsv2 | \
124 om2p-lc)
125 status_led="om2p:blue:power"
126 ;;
127 om5p)
128 status_led="om5p:blue:power"
129 ;;
130 pb44)
131 status_led="pb44:amber:jump1"
132 ;;
133 rb-2011l|\
134 rb-2011uas|\
135 rb-2011uas-2hnd)
136 status_led="rb:green:usr"
137 ;;
138 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
139 status_led="rb4xx:yellow:user"
140 ;;
141 rb-750)
142 status_led="rb750:green:act"
143 ;;
144 rb-911g-2hpnd|\
145 rb-911g-5hpnd|\
146 rb-912uag-2hpnd|\
147 rb-912uag-5hpnd)
148 status_led="rb:green:user"
149 ;;
150 rb-951ui-2hnd)
151 status_led="rb:green:act"
152 ;;
153 rb-sxt2n|\
154 rb-sxt5n)
155 status_led="rb:green:power"
156 ;;
157 routerstation | routerstation-pro)
158 status_led="ubnt:green:rf"
159 ;;
160 rw2458n)
161 status_led="rw2458n:green:d3"
162 ;;
163 smart-300)
164 status_led="nc-link:green:system"
165 ;;
166 oolite)
167 status_led="oolite:red:system"
168 ;;
169 tew-632brp)
170 status_led="tew-632brp:green:status"
171 ;;
172 tew-673gru)
173 status_led="trendnet:blue:wps"
174 ;;
175 tew-712br|\
176 tew-732br)
177 status_led="trendnet:green:power"
178 ;;
179 tl-mr3020)
180 status_led="tp-link:green:wps"
181 ;;
182 tl-wa750re)
183 status_led="tp-link:orange:re"
184 ;;
185 tl-wa850re)
186 status_led="tp-link:blue:re"
187 ;;
188 tl-wa860re)
189 status_led="tp-link:green:power"
190 ;;
191 tl-mr3220 | \
192 tl-mr3220-v2 | \
193 tl-mr3420 | \
194 tl-mr3420-v2 | \
195 tl-wa801nd-v2 | \
196 tl-wa901nd | \
197 tl-wa901nd-v2 | \
198 tl-wa901nd-v3 | \
199 tl-wdr3500 | \
200 tl-wr1041n-v2 | \
201 tl-wr1043nd | \
202 tl-wr1043nd-v2 | \
203 tl-wr741nd | \
204 tl-wr741nd-v4 | \
205 tl-wr841n-v1 | \
206 tl-wr841n-v7 | \
207 tl-wr841n-v8 | \
208 tl-wa830re-v2 | \
209 tl-wr842n-v2 | \
210 tl-wr941nd)
211 status_led="tp-link:green:system"
212 ;;
213 archer-c5 | \
214 archer-c7 | \
215 tl-wdr4900-v2 | \
216 tl-mr10u | \
217 tl-mr13u | \
218 tl-wdr4300 | \
219 tl-wr703n | \
220 tl-wr710n | \
221 tl-wr720n-v3)
222 status_led="tp-link:blue:system"
223 ;;
224 tl-wr841n-v9)
225 status_led="tp-link:green:qss"
226 ;;
227 tl-wr2543n)
228 status_led="tp-link:green:wps"
229 ;;
230 tube2h)
231 status_led="alfa:green:signal4"
232 ;;
233 unifi)
234 status_led="ubnt:green:dome"
235 ;;
236 uap-pro)
237 status_led="ubnt:white:dome"
238 ;;
239 airgateway)
240 status_led="ubnt:white:status"
241 ;;
242 whr-g301n | \
243 whr-hp-g300n | \
244 whr-hp-gn | \
245 wzr-hp-g300nh)
246 status_led="buffalo:green:router"
247 ;;
248 wlae-ag300n)
249 status_led="buffalo:green:status"
250 ;;
251 wzr-hp-ag300h | \
252 wzr-hp-g300nh2)
253 status_led="buffalo:red:diag"
254 ;;
255 wndap360 | \
256 wndr3700 | \
257 wndr3700v4 | \
258 wndr4300 | \
259 wnr2000 | \
260 wnr2200 |\
261 wnr612-v2)
262 status_led="netgear:green:power"
263 ;;
264 wp543)
265 status_led="wp543:green:diag"
266 ;;
267 wrt400n)
268 status_led="wrt400n:blue:wps"
269 ;;
270 wrt160nl)
271 status_led="wrt160nl:blue:wps"
272 ;;
273 zcn-1523h-2 | zcn-1523h-5)
274 status_led="zcn-1523h:amber:init"
275 ;;
276 wlr8100)
277 status_led="sitecom:amber:status"
278 ;;
279 esac
280 }
281
282 set_state() {
283 get_status_led
284
285 case "$1" in
286 preinit)
287 status_led_blink_preinit
288 ;;
289 failsafe)
290 status_led_blink_failsafe
291 ;;
292 done)
293 status_led_on
294 ;;
295 esac
296 }