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