ramips: add support for A5-V11 board (resubmit)
[15.05/openwrt.git] / target / linux / ramips / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2010-2013 OpenWrt.org
3
4 . /lib/functions/leds.sh
5 . /lib/ramips.sh
6
7 get_status_led() {
8         case $(ramips_board_name) in
9         3g-6200n)
10                 status_led="edimax:green:power"
11                 ;;
12         3g300m | w150m)
13                 status_led="tenda:blue:ap"
14                 ;;
15         ar725w)
16                 status_led="ar725w:green:power"
17                 ;;
18         awapn2403)
19                 status_led="asiarf:green:wps"
20                 ;;
21         argus-atp52b)
22                 status_led="argus-atp52b:green:run"
23                 ;;
24         asl26555)
25                 status_led="asl26555:green:power"
26                 ;;
27         br6524n)
28                 status_led="edimax:blue:power"
29                 ;;
30         br6425 | br-6475nd)
31                 status_led="edimax:green:power"
32                 ;;
33         cy-swr1100)
34                 status_led="samsung:blue:wps"
35                 ;;
36         d105)
37                 status_led="d105:red:power"
38                 ;;
39         dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1)
40                 status_led="d-link:green:status"
41                 ;;
42         dir-645)
43                 status_led="d-link:green:wps"
44                 ;;
45         dap-1350)
46                 status_led="d-link:blue:power"
47                 ;;
48         esr-9753)
49                 status_led="esr-9753:orange:power"
50                 ;;
51         f5d8235-v2)
52                 status_led="f5d8235v2:blue:router"
53                 ;;
54         fonera20n)
55                 status_led="fonera20n:green:power"
56                 ;;
57         ip2202)
58                 status_led="ip2202:green:run"
59                 ;;
60         rt-n13u)
61                 status_led="rt-n13u:power"
62                 ;;
63         hlk-rm04)
64                 status_led="hlk-rm04:red:power"
65                 ;;
66         ht-tm02)
67                 status_led="ht-tm02:white:status"
68                 ;;
69         all0239-3g|\
70         hw550-3g)
71                 status_led="hw550-3g:green:status"
72                 ;;
73         m3)
74                 status_led="m3:blue:status"
75                 ;;
76         m4)
77                 status_led="m4:blue:status"
78                 ;;
79         mlw221)
80                 status_led="kingston:blue:status"
81                 ;;
82         mofi3500-3gn)
83                 status_led="mofi3500-3gn:green:status"
84                 ;;
85         mpr-a1)
86                 status_led="hame:red:power"
87                 ;;
88         mpr-a2)
89                 status_led="hame:red:power"
90                 ;;
91         nbg-419n)
92                 status_led="nbg-419n:green:power"
93                 ;;
94         nw718)
95                 status_led="nw718:amber:cpu"
96                 ;;
97         omni-emb|\
98         omni-emb-hpm)
99                 status_led="emb:green:status"
100                 ;;
101         psr-680w)
102                 status_led="psr-680w:red:wan"
103                 ;;
104         pwh2004)
105                 status_led="pwh2004:green:power"
106                 ;;
107         px4885)
108                 status_led="7links:orange:wifi"
109                 ;;
110         rt-n15)
111                 status_led="rt-n15:blue:power"
112                 ;;
113         rt-n10-plus)
114                 status_led="asus:green:wps"
115                 ;;
116         rt-n56u | wl-330n | wl-330n3g)
117                 status_led="asus:blue:power"
118                 ;;
119         rut5xx)
120                 status_led="rut5xx:green:status"
121                 ;;
122         sl-r7205)
123                 status_led="sl-r7205:green:status"
124                 ;;
125         tew-691gr|\
126         tew-692gr)
127                 status_led="trendnet:green:wps"
128                 ;;
129         v11st-fe)
130                 status_led="v11st-fe:green:status"
131                 ;;
132         v22rw-2x2)
133                 status_led="v22rw-2x2:green:security"
134                 ;;
135         vocore)
136                 status_led="vocore:green:status"
137                 ;;
138         w306r-v20)
139                 status_led="w306r-v20:green:sys"
140                 ;;
141         w502u)
142                 status_led="alfa:blue:wps"
143                 ;;
144         wcr-150gn)
145                 status_led="wcr150gn:amber:power"
146                 ;;
147         whr-g300n)
148                 status_led="whr-g300n:green:router"
149                 ;;
150         wmr300 | \
151         whr-300hp2 | \
152         whr-600d)
153                 status_led="buffalo:green:status"
154                 ;;
155         wli-tx4-ag300n)
156                 status_led="buffalo:blue:power"
157                 ;;
158         wl-351)
159                 status_led="wl-351:amber:power"
160                 ;;
161         wr512-3gn)
162                 status_led="wr512:green:wps"
163                 ;;
164         wr8305rt)
165                 status_led="wr8305rt:sys"
166                 ;;
167         wnce2001)
168                 status_led="netgear:green:power"
169                 ;;
170         nexx-wt1520)
171                 status_led="nexx-wt1520:white:power"
172                 ;;
173         nexx-wt3020)
174                 status_led="nexx:blue:power"
175                 ;;
176         mzk-w300nh2)
177                 status_led="mzkw300nh2:green:power"
178                 ;;
179         ur-326n4g)
180                 status_led="ur326:green:wps"
181                 ;;
182         ur-336un)
183                 status_led="ur336:green:wps"
184                 ;;
185         x5)
186                 status_led="x5:green:power"
187                 ;;
188         x8)
189                 status_led="x8:green:power"
190                 ;;
191         xdxrn502j)
192                 status_led="xdxrn502j:green:power"
193                 ;;
194         f7c027)
195                 status_led="belkin:orange:status"
196                 ;;
197         na930)
198                 status_led="na930:blue:power"
199                 ;;
200         y1 | \
201         y1s)
202                 status_led="lenovo:blue:power"
203                 ;;
204         esac
205 }
206
207 set_state() {
208         get_status_led
209
210         case "$1" in
211         preinit)
212                 status_led_blink_preinit
213                 ;;
214         failsafe)
215                 status_led_blink_failsafe
216                 ;;
217         done)
218                 status_led_on
219                 ;;
220         esac
221 }