ar71xx: add user-space support for the WNR2200 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)
38 status_led="ubnt:green:link4"
39 ;;
40 cap4200ag)
41 status_led="senao:green:pwr"
42 ;;
43 db120)
44 status_led="db120:green:status"
45 ;;
46 dir-505-a1 |\
47 dir-600-a1 |\
48 dir-615-e4)
49 status_led="d-link:green:power"
50 ;;
51 dir-615-c1)
52 status_led="d-link:green:status"
53 ;;
54 dir-825-b1 |\
55 dir-835-a1)
56 status_led="d-link:orange:power"
57 ;;
58 dir-825-c1)
59 status_led="d-link:orange:power"
60 ;;
61 eap7660d)
62 status_led="eap7660d:green:ds4"
63 ;;
64 hornet-ub)
65 status_led="alfa:blue:wps"
66 ;;
67 ja76pf | \
68 ja76pf2)
69 status_led="jjplus:green:led1"
70 ;;
71 ls-sr71)
72 status_led="ubnt:green:d22"
73 ;;
74 mr600)
75 status_led="mr600:orange:power"
76 ;;
77 mr600v2)
78 status_led="mr600:blue:power"
79 ;;
80 mzk-w04nu | \
81 mzk-w300nh)
82 status_led="planex:green:status"
83 ;;
84 nbg460n_550n_550nh)
85 status_led="nbg460n:green:power"
86 ;;
87 om2p | \
88 om2p-hs | \
89 om2p-lc)
90 status_led="om2p:blue:power"
91 ;;
92 pb44)
93 status_led="pb44:amber:jump1"
94 ;;
95 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
96 status_led="rb4xx:yellow:user"
97 ;;
98 rb-750)
99 status_led="rb750:green:act"
100 ;;
101 routerstation | routerstation-pro)
102 status_led="ubnt:green:rf"
103 ;;
104 rw2458n)
105 status_led="rw2458n:green:d3"
106 ;;
107 tew-632brp)
108 status_led="tew-632brp:green:status"
109 ;;
110 tew-673gru)
111 status_led="trendnet:blue:wps"
112 ;;
113 tew-712br)
114 status_led="trendnet:green:power"
115 ;;
116 tl-mr3020)
117 status_led="tp-link:green:wps"
118 ;;
119 tl-mr3220 | \
120 tl-mr3220-v2 | \
121 tl-mr3420 | \
122 tl-mr3420-v2 | \
123 tl-wa901nd | \
124 tl-wa901nd-v2 | \
125 tl-wdr3500 | \
126 tl-wr1041n-v2 | \
127 tl-wr1043nd | \
128 tl-wr741nd | \
129 tl-wr741nd-v4 | \
130 tl-wr841n-v1 | \
131 tl-wr841n-v7 | \
132 tl-wr841n-v8 | \
133 tl-wr941nd)
134 status_led="tp-link:green:system"
135 ;;
136 archer-c7 | \
137 tl-mr10u | \
138 tl-wdr4300 | \
139 tl-wr703n | \
140 tl-wr710n | \
141 tl-wr720n-v3)
142 status_led="tp-link:blue:system"
143 ;;
144 tl-wr2543n)
145 status_led="tp-link:green:wps"
146 ;;
147 unifi)
148 status_led="ubnt:green:dome"
149 ;;
150 uap-pro)
151 status_led="ubnt:white:dome"
152 ;;
153 whr-g301n | \
154 whr-hp-g300n | \
155 whr-hp-gn | \
156 wzr-hp-g300nh)
157 status_led="buffalo:green:router"
158 ;;
159 wlae-ag300n)
160 status_led="buffalo:green:status"
161 ;;
162 wzr-hp-ag300h | \
163 wzr-hp-g300nh2)
164 status_led="buffalo:red:diag"
165 ;;
166 wndap360)
167 status_led="wndap360:green:power"
168 ;;
169 wndr3700)
170 status_led="wndr3700:green:power"
171 ;;
172 wndr4300)
173 status_led="netgear:green:power"
174 ;;
175 wnr2000)
176 status_led="wnr2000:green:power"
177 ;;
178 wnr2200)
179 status_led="wnr2200:amber:power"
180 ;;
181 wnr612-v2)
182 status_led="wnr612v2:green:power"
183 ;;
184 wp543)
185 status_led="wp543:green:diag"
186 ;;
187 wrt400n)
188 status_led="wrt400n:blue:wps"
189 ;;
190 wrt160nl)
191 status_led="wrt160nl:blue:wps"
192 ;;
193 zcn-1523h-2 | zcn-1523h-5)
194 status_led="zcn-1523h:amber:init"
195 ;;
196 esac
197 }
198
199 set_state() {
200 get_status_led
201
202 case "$1" in
203 preinit)
204 status_led_blink_preinit
205 ;;
206 failsafe)
207 status_led_blink_failsafe
208 ;;
209 done)
210 status_led_on
211 ;;
212 esac
213 }