ar71xx: Fixes for 951Ui-2HnD board support
[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)
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 eap7660d)
66 status_led="eap7660d:green:ds4"
67 ;;
68 hiwifi-hc6361)
69 status_led="hiwifi:blue:system"
70 ;;
71 hornet-ub)
72 status_led="alfa:blue:wps"
73 ;;
74 ja76pf | \
75 ja76pf2)
76 status_led="jjplus:green:led1"
77 ;;
78 ls-sr71)
79 status_led="ubnt:green:d22"
80 ;;
81 mr600)
82 status_led="mr600:orange:power"
83 ;;
84 mr600v2)
85 status_led="mr600:blue:power"
86 ;;
87 mynet-n600 | \
88 mynet-n750)
89 status_led="wd:blue:power"
90 ;;
91 mynet-rext)
92 status_led="wd:blue:power"
93 ;;
94 mzk-w04nu | \
95 mzk-w300nh)
96 status_led="planex:green:status"
97 ;;
98 nbg460n_550n_550nh)
99 status_led="nbg460n:green:power"
100 ;;
101 nbg6716)
102 status_led="nbg6716:white:power"
103 ;;
104 om2p | \
105 om2pv2 | \
106 om2p-hs | \
107 om2p-hsv2 | \
108 om2p-lc)
109 status_led="om2p:blue:power"
110 ;;
111 pb44)
112 status_led="pb44:amber:jump1"
113 ;;
114 rb-2011l|\
115 rb-2011uas|\
116 rb-2011uas-2hnd)
117 status_led="rb:green:usr"
118 ;;
119 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
120 status_led="rb4xx:yellow:user"
121 ;;
122 rb-750)
123 status_led="rb750:green:act"
124 ;;
125 rb-911g-2hpnd|\
126 rb-911g-5hpnd|\
127 rb-912uag-2hpnd|\
128 rb-912uag-5hpnd)
129 status_led="rb:green:user"
130 ;;
131 rb-951ui-2hnd)
132 status_led="rb:green:act"
133 ;;
134 routerstation | routerstation-pro)
135 status_led="ubnt:green:rf"
136 ;;
137 rw2458n)
138 status_led="rw2458n:green:d3"
139 ;;
140 oolite)
141 status_led="oolite:red:system"
142 ;;
143 tew-632brp)
144 status_led="tew-632brp:green:status"
145 ;;
146 tew-673gru)
147 status_led="trendnet:blue:wps"
148 ;;
149 tew-712br|\
150 tew-732br)
151 status_led="trendnet:green:power"
152 ;;
153 tl-mr3020)
154 status_led="tp-link:green:wps"
155 ;;
156 tl-wa750re)
157 status_led="tp-link:orange:re"
158 ;;
159 tl-wa850re)
160 status_led="tp-link:blue:re"
161 ;;
162 tl-mr3220 | \
163 tl-mr3220-v2 | \
164 tl-mr3420 | \
165 tl-mr3420-v2 | \
166 tl-wa801nd-v2 | \
167 tl-wa901nd | \
168 tl-wa901nd-v2 | \
169 tl-wa901nd-v3 | \
170 tl-wdr3500 | \
171 tl-wr1041n-v2 | \
172 tl-wr1043nd | \
173 tl-wr1043nd-v2 | \
174 tl-wr741nd | \
175 tl-wr741nd-v4 | \
176 tl-wr841n-v1 | \
177 tl-wr841n-v7 | \
178 tl-wr841n-v8 | \
179 tl-wr842n-v2 | \
180 tl-wr941nd)
181 status_led="tp-link:green:system"
182 ;;
183 archer-c7 | \
184 tl-wdr4900-v2 | \
185 tl-mr10u | \
186 tl-mr13u | \
187 tl-wdr4300 | \
188 tl-wr703n | \
189 tl-wr710n | \
190 tl-wr720n-v3)
191 status_led="tp-link:blue:system"
192 ;;
193 tl-wr841n-v9)
194 status_led="tp-link:green:qss"
195 ;;
196 tl-wr2543n)
197 status_led="tp-link:green:wps"
198 ;;
199 unifi)
200 status_led="ubnt:green:dome"
201 ;;
202 uap-pro)
203 status_led="ubnt:white:dome"
204 ;;
205 whr-g301n | \
206 whr-hp-g300n | \
207 whr-hp-gn | \
208 wzr-hp-g300nh)
209 status_led="buffalo:green:router"
210 ;;
211 wlae-ag300n)
212 status_led="buffalo:green:status"
213 ;;
214 wzr-hp-ag300h | \
215 wzr-hp-g300nh2)
216 status_led="buffalo:red:diag"
217 ;;
218 wndap360 | \
219 wndr3700 | \
220 wndr4300 | \
221 wnr2000 | \
222 wnr2200 |\
223 wnr612-v2)
224 status_led="netgear:green:power"
225 ;;
226 wp543)
227 status_led="wp543:green:diag"
228 ;;
229 wrt400n)
230 status_led="wrt400n:blue:wps"
231 ;;
232 wrt160nl)
233 status_led="wrt160nl:blue:wps"
234 ;;
235 zcn-1523h-2 | zcn-1523h-5)
236 status_led="zcn-1523h:amber:init"
237 ;;
238 wlr8100)
239 status_led="sitecom:amber:status"
240 ;;
241 esac
242 }
243
244 set_state() {
245 get_status_led
246
247 case "$1" in
248 preinit)
249 status_led_blink_preinit
250 ;;
251 failsafe)
252 status_led_blink_failsafe
253 ;;
254 done)
255 status_led_on
256 ;;
257 esac
258 }