ar71xx: use netgear prefix for WNR2000 LED names
[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 mynet-n600)
81 status_led="wd:blue:power"
82 ;;
83 mzk-w04nu | \
84 mzk-w300nh)
85 status_led="planex:green:status"
86 ;;
87 nbg460n_550n_550nh)
88 status_led="nbg460n:green:power"
89 ;;
90 om2p | \
91 om2p-hs | \
92 om2p-lc)
93 status_led="om2p:blue:power"
94 ;;
95 pb44)
96 status_led="pb44:amber:jump1"
97 ;;
98 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
99 status_led="rb4xx:yellow:user"
100 ;;
101 rb-750)
102 status_led="rb750:green:act"
103 ;;
104 routerstation | routerstation-pro)
105 status_led="ubnt:green:rf"
106 ;;
107 rw2458n)
108 status_led="rw2458n:green:d3"
109 ;;
110 tew-632brp)
111 status_led="tew-632brp:green:status"
112 ;;
113 tew-673gru)
114 status_led="trendnet:blue:wps"
115 ;;
116 tew-712br)
117 status_led="trendnet:green:power"
118 ;;
119 tl-mr3020)
120 status_led="tp-link:green:wps"
121 ;;
122 tl-mr3220 | \
123 tl-mr3220-v2 | \
124 tl-mr3420 | \
125 tl-mr3420-v2 | \
126 tl-wa901nd | \
127 tl-wa901nd-v2 | \
128 tl-wdr3500 | \
129 tl-wr1041n-v2 | \
130 tl-wr1043nd | \
131 tl-wr741nd | \
132 tl-wr741nd-v4 | \
133 tl-wr841n-v1 | \
134 tl-wr841n-v7 | \
135 tl-wr841n-v8 | \
136 tl-wr941nd)
137 status_led="tp-link:green:system"
138 ;;
139 archer-c7 | \
140 tl-mr10u | \
141 tl-mr13u | \
142 tl-wdr4300 | \
143 tl-wr703n | \
144 tl-wr710n | \
145 tl-wr720n-v3)
146 status_led="tp-link:blue:system"
147 ;;
148 tl-wr2543n)
149 status_led="tp-link:green:wps"
150 ;;
151 unifi)
152 status_led="ubnt:green:dome"
153 ;;
154 uap-pro)
155 status_led="ubnt:white:dome"
156 ;;
157 whr-g301n | \
158 whr-hp-g300n | \
159 whr-hp-gn | \
160 wzr-hp-g300nh)
161 status_led="buffalo:green:router"
162 ;;
163 wlae-ag300n)
164 status_led="buffalo:green:status"
165 ;;
166 wzr-hp-ag300h | \
167 wzr-hp-g300nh2)
168 status_led="buffalo:red:diag"
169 ;;
170 wndap360)
171 status_led="wndap360:green:power"
172 ;;
173 wndr3700)
174 status_led="netgear:green:power"
175 ;;
176 wndr4300)
177 status_led="netgear:green:power"
178 ;;
179 wnr2000)
180 status_led="netgear:green:power"
181 ;;
182 wnr2200)
183 status_led="wnr2200:amber:power"
184 ;;
185 wnr612-v2)
186 status_led="wnr612v2:green:power"
187 ;;
188 wp543)
189 status_led="wp543:green:diag"
190 ;;
191 wrt400n)
192 status_led="wrt400n:blue:wps"
193 ;;
194 wrt160nl)
195 status_led="wrt160nl:blue:wps"
196 ;;
197 zcn-1523h-2 | zcn-1523h-5)
198 status_led="zcn-1523h:amber:init"
199 ;;
200 esac
201 }
202
203 set_state() {
204 get_status_led
205
206 case "$1" in
207 preinit)
208 status_led_blink_preinit
209 ;;
210 failsafe)
211 status_led_blink_failsafe
212 ;;
213 done)
214 status_led_on
215 ;;
216 esac
217 }