ramips: add support for Zbtlink ZBT-WE2026
[oweals/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         board=$(ramips_board_name)
9
10         case $board in
11         3g150b|\
12         3g300m|\
13         w150m)
14                 status_led="$board:blue:ap"
15                 ;;
16         3g-6200n|\
17         ar670w|\
18         ar725w|\
19         asl26555|\
20         br-6425|\
21         br-6475nd|\
22         c50|\
23         dch-m225|\
24         dir-860l-b1|\
25         e1700|\
26         ex3700|\
27         fonera20n|\
28         kn_rc|\
29         kn_rf|\
30         kng_rc|\
31         mzk-750dhp|\
32         mzk-dp150n|\
33         mzk-w300nh2|\
34         nbg-419n|\
35         nbg-419n2|\
36         pwh2004|\
37         r6220|\
38         vr500|\
39         wnce2001|\
40         wndr3700v5|\
41         x5|\
42         x8|\
43         xdxrn502j)
44                 status_led="$board:green:power"
45                 ;;
46         3g-6200nl)
47                 status_led="$board:green:internet"
48                 ;;
49         a5-v11|\
50         cs-qr10|\
51         d105|\
52         dcs-930l-b1|\
53         ex2700|\
54         hlk-rm04|\
55         jhr-n825r|\
56         mpr-a1|\
57         mpr-a2|\
58         mzk-ex750np|\
59         wn3000rpv3)
60                 status_led="$board:red:power"
61                 ;;
62         ac1200pro|\
63         all0239-3g|\
64         dcs-930|\
65         dir-300-b1|\
66         dir-300-b7|\
67         dir-320-b1|\
68         dir-600-b1|\
69         dir-610-a1|\
70         dir-615-d|\
71         dir-615-h1|\
72         dir-620-a1|\
73         dir-620-d1|\
74         dwr-512-b|\
75         hpm|\
76         hw550-3g|\
77         mac1200rv2|\
78         miniembwifi|\
79         mofi3500-3gn|\
80         rut5xx|\
81         v11st-fe|\
82         vocore|\
83         wmr-300|\
84         zbt-wg2626|\
85         zbt-wg3526)
86                 status_led="$board:green:status"
87                 ;;
88         ai-br100|\
89         ht-tm02)
90                 status_led="$board:blue:wlan"
91                 ;;
92         atp-52b|\
93         ew1200|\
94         ip2202)
95                 status_led="$board:green:run"
96                 ;;
97         awapn2403|\
98         dir-645|\
99         sk-wb8|\
100         wrh-300cr)
101                 status_led="$board:green:wps"
102                 ;;
103         cf-wr800n|\
104         psg1208)
105                 status_led="$board:white:wps"
106                 ;;
107         psg1218)
108                 status_led="$board:yellow:status"
109                 ;;
110         cy-swr1100|\
111         w502u)
112                 status_led="$board:blue:wps"
113                 ;;
114         d240|\
115         dap-1350|\
116         na930|\
117         pbr-m1|\
118         rt-n13u|\
119         rt-n14u|\
120         rt-n15|\
121         rt-n56u|\
122         wl-330n|\
123         wl-330n3g|\
124         wli-tx4-ag300n|\
125         wt3020|\
126         y1|\
127         y1s)
128                 status_led="$board:blue:power"
129                 ;;
130         db-wrt01|\
131         esr-9753|\
132         pbr-d1)
133                 status_led="$board:orange:power"
134                 ;;
135         f5d8235-v1)
136                 status_led="$board:blue:wired"
137                 ;;
138         f5d8235-v2)
139                 status_led="$board:blue:router"
140                 ;;
141         f7c027|\
142         timecloud)
143                 status_led="$board:orange:status"
144                 ;;
145         hc5*61|\
146         hc5661a|\
147         jhr-n805r|\
148         jhr-n926r|\
149         mlw221|\
150         mlwg2)
151                 status_led="$board:blue:system"
152                 ;;
153         hc5962)
154                 status_led="$board:white:status"
155                 ;;
156         linkits7688| \
157         linkits7688d)
158                 [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
159                 ;;
160         m2m)
161                 status_led="$board:blue:wifi"
162                 ;;
163         m3|\
164         m4|\
165         miwifi-nano)
166                 status_led="$board:blue:status"
167                 ;;
168         miwifi-mini|\
169         zte-q7)
170                 status_led="$board:red:status"
171                 ;;
172         mr-102n)
173                 status_led="$board:amber:status"
174                 ;;
175         mr200)
176                 status_led="$board:white:power"
177                 ;;
178         nw718)
179                 status_led="$board:amber:cpu"
180                 ;;
181         newifi-d1)
182                 status_led="$board:blue:status"
183                 ;;
184         omega2| \
185         omega2p)
186                 status_led="$board:amber:system"
187                 ;;
188         oy-0001|\
189         sl-r7205|\
190         zbt-we826)
191                 status_led="$board:green:wifi"
192                 ;;
193         psr-680w)
194                 status_led="$board:red:wan"
195                 ;;
196         px-4885|\
197         re6500|\
198         whr-1166d|\
199         whr-600d|\
200         widora-neo)
201                 status_led="$board:orange:wifi"
202                 ;;
203         mzk-ex300np|\
204         rt-n10-plus|\
205         tew-691gr|\
206         tew-692gr|\
207         ur-326n4g|\
208         ur-336un|\
209         wf-2881|\
210         wr512-3gn)
211                 status_led="$board:green:wps"
212                 ;;
213         rb750gr3)
214                 status_led="$board:blue:pwr"
215                 ;;
216         sap-g3200u3)
217                 status_led="$board:green:usb"
218                 ;;
219         v22rw-2x2)
220                 status_led="$board:green:security"
221                 ;;
222         vocore2)
223                 status_led="$board:fuchsia:status"
224                 ;;
225         w306r-v20|\
226         witi|\
227         zbt-wr8305rt)
228                 status_led="$board:green:sys"
229                 ;;
230         wcr-1166ds|\
231         whr-300hp2|\
232         wsr-1166|\
233         wsr-600)
234                 status_led="$board:green:power"
235                 ;;
236         wcr-150gn|\
237         wl-351)
238                 status_led="$board:amber:power"
239                 ;;
240         whr-g300n|\
241         wlr-6000|\
242         zbt-we2026)
243                 status_led="$board:red:power"
244                 ;;
245         wzr-agl300nh)
246                 status_led="$board:green:router"
247                 ;;
248         wizfi630a)
249                 status_led="$board::run"
250                 ;;
251         wrtnode2r | \
252         wrtnode2p | \
253         wrtnode)
254                 status_led="wrtnode:blue:indicator"
255                 ;;
256         zbt-cpe102)
257                 status_led="$board:green:4g-0"
258                 ;;
259         esac
260 }
261
262 set_state() {
263         get_status_led $1
264
265         case "$1" in
266         preinit)
267                 status_led_blink_preinit
268                 ;;
269         failsafe)
270                 status_led_blink_failsafe
271                 ;;
272         upgrade | \
273         preinit_regular)
274                 status_led_blink_preinit_regular
275                 ;;
276         done)
277                 status_led_on
278                 ;;
279         esac
280 }