ramips: add support for Planex MZK-EX300NP
[openwrt/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 e1700|\
23 fonera20n|\
24 mzk-750dhp|\
25 mzk-dp150n|\
26 mzk-w300nh2|\
27 nbg-419n|\
28 pwh2004|\
29 wnce2001|\
30 x5|\
31 x8|\
32 xdxrn502j)
33 status_led="$board:green:power"
34 ;;
35 a5-v11|\
36 cs-qr10|\
37 d105|\
38 dcs-930l-b1|\
39 ex2700|\
40 hlk-rm04|\
41 jhr-n825r|\
42 mpr-a1|\
43 mpr-a2)
44 status_led="$board:red:power"
45 ;;
46 ai-br100|\
47 ht-tm02)
48 status_led="$board:blue:wlan"
49 ;;
50 all0239-3g|\
51 dcs-930|\
52 dir-300-b1|\
53 dir-300-b7|\
54 dir-320-b1|\
55 dir-600-b1|\
56 dir-600-b2|\
57 dir-610-a1|\
58 dir-615-d|\
59 dir-615-h1|\
60 dir-620-a1|\
61 dir-620-d1|\
62 hpm|\
63 hw550-3g|\
64 miniembwifi|\
65 mofi3500-3gn|\
66 rut5xx|\
67 v11st-fe|\
68 vocore|\
69 wmr-300|\
70 zbt-wg2626|\
71 zbt-wg3526)
72 status_led="$board:green:status"
73 ;;
74 atp-52b|\
75 ip2202)
76 status_led="$board:green:run"
77 ;;
78 awapn2403|\
79 dir-645|\
80 wrh-300cr)
81 status_led="$board:green:wps"
82 ;;
83 cf-wr800n|\
84 psg1208)
85 status_led="$board:white:wps"
86 ;;
87 cy-swr1100|\
88 w502u)
89 status_led="$board:blue:wps"
90 ;;
91 dap-1350|\
92 na930|\
93 pbr-m1|\
94 rt-n13u|\
95 rt-n14u|\
96 rt-n15|\
97 rt-n56u|\
98 wl-330n|\
99 wl-330n3g|\
100 wli-tx4-ag300n|\
101 wt3020|\
102 y1|\
103 y1s)
104 status_led="$board:blue:power"
105 ;;
106 db-wrt01|\
107 esr-9753)
108 status_led="$board:orange:power"
109 ;;
110 f5d8235-v2)
111 status_led="$board:blue:router"
112 ;;
113 f7c027)
114 status_led="$board:orange:status"
115 ;;
116 hc5*61|\
117 jhr-n805r|\
118 jhr-n926r|\
119 mlw221|\
120 mlwg2)
121 status_led="$board:blue:system"
122 ;;
123 linkits7688| \
124 linkits7688d)
125 [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
126 ;;
127 m2m)
128 status_led="$board:blue:wifi"
129 ;;
130 m3|\
131 m4)
132 status_led="$board:blue:status"
133 ;;
134 miwifi-mini|\
135 zte-q7)
136 status_led="$board:red:status"
137 ;;
138 mr-102n)
139 status_led="$board:amber:status"
140 ;;
141 nw718)
142 status_led="$board:amber:cpu"
143 ;;
144 oy-0001|\
145 sl-r7205)
146 status_led="$board:green:wifi"
147 ;;
148 psr-680w)
149 status_led="$board:red:wan"
150 ;;
151 px-4885|\
152 re6500|\
153 whr-1166d|\
154 whr-300hp2|\
155 whr-600d)
156 status_led="$board:orange:wifi"
157 ;;
158 mzk-ex300np|\
159 rt-n10-plus|\
160 tew-691gr|\
161 tew-692gr|\
162 ur-326n4g|\
163 ur-336un|\
164 wf-2881|\
165 wr512-3gn)
166 status_led="$board:green:wps"
167 ;;
168 sap-g3200u3)
169 status_led="$board:green:usb"
170 ;;
171 v22rw-2x2)
172 status_led="$board:green:security"
173 ;;
174 w306r-v20|\
175 witi|\
176 zbt-wr8305rt)
177 status_led="$board:green:sys"
178 ;;
179 wcr-150gn|\
180 wl-351)
181 status_led="$board:amber:power"
182 ;;
183 whr-g300n|\
184 wzr-agl300nh)
185 status_led="$board:green:router"
186 ;;
187 wizfi630a)
188 status_led="$board::run"
189 ;;
190 wsr-1166|\
191 wsr-600)
192 status_led="$board:orange:diag"
193 ;;
194 wrtnode2r | \
195 wrtnode2p | \
196 wrtnode)
197 status_led="wrtnode:blue:indicator"
198 ;;
199 esac
200 }
201
202 set_state() {
203 get_status_led $1
204
205 case "$1" in
206 preinit)
207 status_led_blink_preinit
208 ;;
209 failsafe)
210 status_led_blink_failsafe
211 ;;
212 upgrade | \
213 preinit_regular)
214 status_led_blink_preinit_regular
215 ;;
216 done)
217 status_led_on
218 ;;
219 esac
220 }