ramips: add support for PandoraBox PBR-M1
[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         3g150b | 3g300m | w150m)
13                 status_led="tenda:blue:ap"
14                 ;;
15         ai-br100)
16                 status_led="aigale:blue:wlan"
17                 ;;
18         ar670w)
19                 status_led="ar670w:green:power"
20                 ;;
21         ar725w)
22                 status_led="ar725w:green:power"
23                 ;;
24         awapn2403)
25                 status_led="asiarf:green:wps"
26                 ;;
27         argus-atp52b)
28                 status_led="argus-atp52b:green:run"
29                 ;;
30         asl26555)
31                 status_led="asl26555:green:power"
32                 ;;
33         br6524n)
34                 status_led="edimax:blue:power"
35                 ;;
36         br6425 | br-6475nd)
37                 status_led="edimax:green:power"
38                 ;;
39         cf-wr800n)
40                 status_led="comfast:white:wps"
41                 ;;
42         cy-swr1100)
43                 status_led="samsung:blue:wps"
44                 ;;
45         d105)
46                 status_led="d105:red:power"
47                 ;;
48         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)
49                 status_led="d-link:green:status"
50                 ;;
51         dir-645)
52                 status_led="d-link:green:wps"
53                 ;;
54         dap-1350)
55                 status_led="d-link:blue:power"
56                 ;;
57         e1700)
58                 status_led="linksys:green:power"
59                 ;;
60         esr-9753)
61                 status_led="esr-9753:orange:power"
62                 ;;
63         f5d8235-v2)
64                 status_led="f5d8235v2:blue:router"
65                 ;;
66         fonera20n)
67                 status_led="fonera20n:green:power"
68                 ;;
69         ip2202)
70                 status_led="ip2202:green:run"
71                 ;;
72         rt-n13u)
73                 status_led="rt-n13u:power"
74                 ;;
75         hlk-rm04)
76                 status_led="hlk-rm04:red:power"
77                 ;;
78         ht-tm02)
79                 status_led="ht-tm02:blue:wlan"
80                 ;;
81         all0239-3g|\
82         hw550-3g)
83                 status_led="hw550-3g:green:status"
84                 ;;
85         m2m)
86                 status_led="m2m:blue:wifi"
87                 ;;
88         m3)
89                 status_led="m3:blue:status"
90                 ;;
91         m4)
92                 status_led="m4:blue:status"
93                 ;;
94         mlw221|\
95         mlwg2)
96                 status_led="kingston:blue:system"
97                 ;;
98         mofi3500-3gn)
99                 status_led="mofi3500-3gn:green:status"
100                 ;;
101         mpr-a1)
102                 status_led="hame:red:power"
103                 ;;
104         mpr-a2)
105                 status_led="hame:red:power"
106                 ;;
107         mr-102n)
108                 status_led="mr-102n:amber:status"
109                 ;;
110         nbg-419n)
111                 status_led="nbg-419n:green:power"
112                 ;;
113         nw718)
114                 status_led="nw718:amber:cpu"
115                 ;;
116         omni-emb|\
117         omni-emb-hpm)
118                 status_led="emb:green:status"
119                 ;;
120         pbr-m1)
121                 status_led="pbr-m1:green:sys"
122                 ;;
123         psr-680w)
124                 status_led="psr-680w:red:wan"
125                 ;;
126         pwh2004)
127                 status_led="pwh2004:green:power"
128                 ;;
129         px4885)
130                 status_led="7links:orange:wifi"
131                 ;;
132         rt-n15)
133                 status_led="rt-n15:blue:power"
134                 ;;
135         rt-n10-plus)
136                 status_led="asus:green:wps"
137                 ;;
138         rt-n14u | rt-n56u | wl-330n | wl-330n3g)
139                 status_led="asus:blue:power"
140                 ;;
141         rut5xx)
142                 status_led="rut5xx:green:status"
143                 ;;
144         sl-r7205)
145                 status_led="sl-r7205:green:status"
146                 ;;
147         tew-691gr|\
148         tew-692gr)
149                 status_led="trendnet:green:wps"
150                 ;;
151         v11st-fe)
152                 status_led="v11st-fe:green:status"
153                 ;;
154         v22rw-2x2)
155                 status_led="v22rw-2x2:green:security"
156                 ;;
157         vocore)
158                 status_led="vocore:green:status"
159                 ;;
160         w306r-v20)
161                 status_led="w306r-v20:green:sys"
162                 ;;
163         w502u)
164                 status_led="alfa:blue:wps"
165                 ;;
166         wcr-150gn)
167                 status_led="wcr150gn:amber:power"
168                 ;;
169         whr-g300n)
170                 status_led="whr-g300n:green:router"
171                 ;;
172         wmr300)
173                 status_led="buffalo:green:status"
174                 ;;
175         wli-tx4-ag300n)
176                 status_led="buffalo:blue:power"
177                 ;;
178         wzr-agl300nh)
179                 status_led="buffalo:green:router"
180                 ;;
181         wl-351)
182                 status_led="wl-351:amber:power"
183                 ;;
184         wr512-3gn)
185                 status_led="wr512:green:wps"
186                 ;;
187         wr8305rt)
188                 status_led="wr8305rt:sys"
189                 ;;
190         whr-300hp2 | \
191         whr-600d | \
192         whr-1166d | \
193         wsr-600 | \
194         wsr-1166)
195                 status_led="buffalo:orange:diag"
196                 ;;
197         wnce2001)
198                 status_led="netgear:green:power"
199                 ;;
200         nexx-wt1520)
201                 status_led="nexx-wt1520:white:power"
202                 ;;
203         wt3020)
204                 status_led="nexx:blue:power"
205                 ;;
206         mzk-w300nh2)
207                 status_led="mzkw300nh2:green:power"
208                 ;;
209         ur-326n4g)
210                 status_led="ur326:green:wps"
211                 ;;
212         ur-336un)
213                 status_led="ur336:green:wps"
214                 ;;
215         x5)
216                 status_led="x5:green:power"
217                 ;;
218         x8)
219                 status_led="x8:green:power"
220                 ;;
221         xdxrn502j)
222                 status_led="xdxrn502j:green:power"
223                 ;;
224         xiaomi-mini)
225                 status_led="xiaomi:red:status"
226                 ;;
227         f7c027)
228                 status_led="belkin:orange:status"
229                 ;;
230         na930)
231                 status_led="na930:blue:power"
232                 ;;
233         y1 | \
234         y1s)
235                 status_led="lenovo:blue:power"
236                 ;;
237         zte-q7)
238                 status_led="zte:red:status"
239                 ;;
240         esac
241 }
242
243 set_state() {
244         get_status_led
245
246         case "$1" in
247         preinit)
248                 status_led_blink_preinit
249                 ;;
250         failsafe)
251                 status_led_blink_failsafe
252                 ;;
253         preinit_regular)
254                 status_led_blink_preinit_regular
255                 ;;
256         done)
257                 status_led_on
258                 ;;
259         esac
260 }