ar71xx: split wndr4300 and wndr3700v4 into 2 seperate mips machines
[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 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 oolite)
164 status_led="oolite:red:system"
165 ;;
166 tew-632brp)
167 status_led="tew-632brp:green:status"
168 ;;
169 tew-673gru)
170 status_led="trendnet:blue:wps"
171 ;;
172 tew-712br|\
173 tew-732br)
174 status_led="trendnet:green:power"
175 ;;
176 tl-mr3020)
177 status_led="tp-link:green:wps"
178 ;;
179 tl-wa750re)
180 status_led="tp-link:orange:re"
181 ;;
182 tl-wa850re)
183 status_led="tp-link:blue:re"
184 ;;
185 tl-wa860re)
186 status_led="tp-link:green:power"
187 ;;
188 tl-mr3220 | \
189 tl-mr3220-v2 | \
190 tl-mr3420 | \
191 tl-mr3420-v2 | \
192 tl-wa801nd-v2 | \
193 tl-wa901nd | \
194 tl-wa901nd-v2 | \
195 tl-wa901nd-v3 | \
196 tl-wdr3500 | \
197 tl-wr1041n-v2 | \
198 tl-wr1043nd | \
199 tl-wr1043nd-v2 | \
200 tl-wr741nd | \
201 tl-wr741nd-v4 | \
202 tl-wr841n-v1 | \
203 tl-wr841n-v7 | \
204 tl-wr841n-v8 | \
205 tl-wa830re-v2 | \
206 tl-wr842n-v2 | \
207 tl-wr941nd)
208 status_led="tp-link:green:system"
209 ;;
210 archer-c7 | \
211 tl-wdr4900-v2 | \
212 tl-mr10u | \
213 tl-mr13u | \
214 tl-wdr4300 | \
215 tl-wr703n | \
216 tl-wr710n | \
217 tl-wr720n-v3)
218 status_led="tp-link:blue:system"
219 ;;
220 tl-wr841n-v9)
221 status_led="tp-link:green:qss"
222 ;;
223 tl-wr2543n)
224 status_led="tp-link:green:wps"
225 ;;
226 tube2h)
227 status_led="alfa:green:signal4"
228 ;;
229 unifi)
230 status_led="ubnt:green:dome"
231 ;;
232 uap-pro)
233 status_led="ubnt:white:dome"
234 ;;
235 airgateway)
236 status_led="ubnt:white:status"
237 ;;
238 whr-g301n | \
239 whr-hp-g300n | \
240 whr-hp-gn | \
241 wzr-hp-g300nh)
242 status_led="buffalo:green:router"
243 ;;
244 wlae-ag300n)
245 status_led="buffalo:green:status"
246 ;;
247 wzr-hp-ag300h | \
248 wzr-hp-g300nh2)
249 status_led="buffalo:red:diag"
250 ;;
251 wndap360 | \
252 wndr3700 | \
253 wndr3700v4 | \
254 wndr4300 | \
255 wnr2000 | \
256 wnr2200 |\
257 wnr612-v2)
258 status_led="netgear:green:power"
259 ;;
260 wp543)
261 status_led="wp543:green:diag"
262 ;;
263 wrt400n)
264 status_led="wrt400n:blue:wps"
265 ;;
266 wrt160nl)
267 status_led="wrt160nl:blue:wps"
268 ;;
269 zcn-1523h-2 | zcn-1523h-5)
270 status_led="zcn-1523h:amber:init"
271 ;;
272 wlr8100)
273 status_led="sitecom:amber:status"
274 ;;
275 esac
276 }
277
278 set_state() {
279 get_status_led
280
281 case "$1" in
282 preinit)
283 status_led_blink_preinit
284 ;;
285 failsafe)
286 status_led_blink_failsafe
287 ;;
288 done)
289 status_led_on
290 ;;
291 esac
292 }