ar71xx: add user-space support for the EnGenius EAP300 v2 board
[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)
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 pb44)
128 status_led="pb44:amber:jump1"
129 ;;
130 rb-2011l|\
131 rb-2011uas|\
132 rb-2011uas-2hnd)
133 status_led="rb:green:usr"
134 ;;
135 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
136 status_led="rb4xx:yellow:user"
137 ;;
138 rb-750)
139 status_led="rb750:green:act"
140 ;;
141 rb-911g-2hpnd|\
142 rb-911g-5hpnd|\
143 rb-912uag-2hpnd|\
144 rb-912uag-5hpnd)
145 status_led="rb:green:user"
146 ;;
147 rb-951ui-2hnd)
148 status_led="rb:green:act"
149 ;;
150 rb-sxt2n|\
151 rb-sxt5n)
152 status_led="rb:green:power"
153 ;;
154 routerstation | routerstation-pro)
155 status_led="ubnt:green:rf"
156 ;;
157 rw2458n)
158 status_led="rw2458n:green:d3"
159 ;;
160 oolite)
161 status_led="oolite:red:system"
162 ;;
163 tew-632brp)
164 status_led="tew-632brp:green:status"
165 ;;
166 tew-673gru)
167 status_led="trendnet:blue:wps"
168 ;;
169 tew-712br|\
170 tew-732br)
171 status_led="trendnet:green:power"
172 ;;
173 tl-mr3020)
174 status_led="tp-link:green:wps"
175 ;;
176 tl-wa750re)
177 status_led="tp-link:orange:re"
178 ;;
179 tl-wa850re)
180 status_led="tp-link:blue:re"
181 ;;
182 tl-wa860re)
183 status_led="tp-link:green:power"
184 ;;
185 tl-mr3220 | \
186 tl-mr3220-v2 | \
187 tl-mr3420 | \
188 tl-mr3420-v2 | \
189 tl-wa801nd-v2 | \
190 tl-wa901nd | \
191 tl-wa901nd-v2 | \
192 tl-wa901nd-v3 | \
193 tl-wdr3500 | \
194 tl-wr1041n-v2 | \
195 tl-wr1043nd | \
196 tl-wr1043nd-v2 | \
197 tl-wr741nd | \
198 tl-wr741nd-v4 | \
199 tl-wr841n-v1 | \
200 tl-wr841n-v7 | \
201 tl-wr841n-v8 | \
202 tl-wa830re-v2 | \
203 tl-wr842n-v2 | \
204 tl-wr941nd)
205 status_led="tp-link:green:system"
206 ;;
207 archer-c7 | \
208 tl-wdr4900-v2 | \
209 tl-mr10u | \
210 tl-mr13u | \
211 tl-wdr4300 | \
212 tl-wr703n | \
213 tl-wr710n | \
214 tl-wr720n-v3)
215 status_led="tp-link:blue:system"
216 ;;
217 tl-wr841n-v9)
218 status_led="tp-link:green:qss"
219 ;;
220 tl-wr2543n)
221 status_led="tp-link:green:wps"
222 ;;
223 tube2h)
224 status_led="alfa:green:signal4"
225 ;;
226 unifi)
227 status_led="ubnt:green:dome"
228 ;;
229 uap-pro)
230 status_led="ubnt:white:dome"
231 ;;
232 whr-g301n | \
233 whr-hp-g300n | \
234 whr-hp-gn | \
235 wzr-hp-g300nh)
236 status_led="buffalo:green:router"
237 ;;
238 wlae-ag300n)
239 status_led="buffalo:green:status"
240 ;;
241 wzr-hp-ag300h | \
242 wzr-hp-g300nh2)
243 status_led="buffalo:red:diag"
244 ;;
245 wndap360 | \
246 wndr3700 | \
247 wndr4300 | \
248 wnr2000 | \
249 wnr2200 |\
250 wnr612-v2)
251 status_led="netgear:green:power"
252 ;;
253 wp543)
254 status_led="wp543:green:diag"
255 ;;
256 wrt400n)
257 status_led="wrt400n:blue:wps"
258 ;;
259 wrt160nl)
260 status_led="wrt160nl:blue:wps"
261 ;;
262 zcn-1523h-2 | zcn-1523h-5)
263 status_led="zcn-1523h:amber:init"
264 ;;
265 wlr8100)
266 status_led="sitecom:amber:status"
267 ;;
268 esac
269 }
270
271 set_state() {
272 get_status_led
273
274 case "$1" in
275 preinit)
276 status_led_blink_preinit
277 ;;
278 failsafe)
279 status_led_blink_failsafe
280 ;;
281 done)
282 status_led_on
283 ;;
284 esac
285 }