8029cf7b5e1c4a8ce3b0813c3fd1134048a8e0cf
[openwrt/openwrt.git] / target / linux / ath79 / generic / base-files / etc / board.d / 01_leds
1 #!/bin/sh
2
3 . /lib/functions/uci-defaults.sh
4
5 board_config_update
6
7 board=$(board_name)
8 boardname="${board##*,}"
9
10 case "$board" in
11 8dev,carambola2)
12 ucidef_set_led_netdev "lan" "LAN" "$boardname:orange:eth0" "eth0"
13 ucidef_set_led_switch "wan" "WAN" "$boardname:orange:eth1" "switch0" "0x04"
14 ;;
15 alfa-network,ap121f|\
16 avm,fritz450e)
17 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
18 ;;
19 avm,fritz1750e)
20 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
21 ucidef_set_rssimon "wlan1" "200000" "1"
22 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan1" "1" "100"
23 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan1" "20" "100"
24 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:green:rssi2" "wlan1" "40" "100"
25 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi3" "wlan1" "60" "100"
26 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi4" "wlan1" "80" "100"
27 ;;
28 avm,fritz300e)
29 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
30 ucidef_set_rssimon "wlan0" "200000" "1"
31 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
32 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
33 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:green:rssi2" "wlan0" "40" "100"
34 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
35 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
36 ;;
37 avm,fritz4020)
38 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
39 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x1E"
40 ;;
41 comfast,cf-e110n-v2)
42 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
43 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x02"
44 ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
45 ucidef_set_rssimon "wlan0" "200000" "1"
46 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
47 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
48 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
49 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
50 ;;
51 comfast,cf-e120a-v3)
52 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
53 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x04"
54 ucidef_set_rssimon "wlan0" "200000" "1"
55 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
56 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
57 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
58 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
59 ;;
60 comfast,cf-e130n-v2)
61 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
62 ucidef_set_rssimon "wlan0" "200000" "1"
63 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
64 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
65 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
66 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
67 ;;
68 comfast,cf-e313ac)
69 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02"
70 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
71 ucidef_set_rssimon "wlan0" "200000" "1"
72 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
73 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
74 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
75 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
76 ;;
77 comfast,cf-e314n-v2)
78 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
79 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
80 ucidef_set_rssimon "wlan0" "200000" "1"
81 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
82 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
83 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
84 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
85 ;;
86 comfast,cf-e5)
87 ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x02"
88 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1"
89 ucidef_set_rssimon "wlan0" "200000" "1"
90 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:blue:rssi0" "wlan0" "1" "100"
91 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:blue:rssi1" "wlan0" "33" "100"
92 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:blue:rssi2" "wlan0" "66" "100"
93 ;;
94 comfast,cf-e560ac)
95 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1"
96 ucidef_set_led_switch "lan1" "LAN1" "$boardname:blue:lan1" "switch0" "0x02"
97 ucidef_set_led_switch "lan2" "LAN2" "$boardname:blue:lan2" "switch0" "0x04"
98 ucidef_set_led_switch "lan3" "LAN3" "$boardname:blue:lan3" "switch0" "0x08"
99 ucidef_set_led_switch "lan4" "LAN4" "$boardname:blue:lan4" "switch0" "0x10"
100 ;;
101 comfast,cf-ew72)
102 ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x02"
103 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1"
104 ;;
105 comfast,cf-wr752ac-v1|\
106 engenius,ecb1750|\
107 enterasys,ws-ap3705i)
108 ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0"
109 ;;
110 devolo,magic-2-wifi)
111 ucidef_set_led_netdev "plcw" "dLAN" "devolo:white:dlan" "eth0.1" "rx"
112 ;;
113 dlink,dir-859-a1)
114 ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20"
115 ;;
116 engenius,ews511ap)
117 ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth1"
118 ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth0"
119 ;;
120 etactica,eg200)
121 ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
122 ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
123 ;;
124 glinet,6408|\
125 glinet,6416)
126 ucidef_set_led_netdev "lan" "LAN" "gl-inet:green:lan" "eth0"
127 ;;
128 glinet,gl-ar300m-lite)
129 ucidef_set_led_netdev "lan" "LAN" "gl-ar300m-lite:green:lan" "eth0"
130 ;;
131 glinet,gl-ar300m16)
132 ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0"
133 ;;
134 glinet,gl-x750)
135 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
136 ;;
137 netgear,wnr2200-8m|\
138 netgear,wnr2200-16m)
139 ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0"
140 ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04"
141 ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04"
142 ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04"
143 ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04"
144 ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02"
145 ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02"
146 ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02"
147 ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02"
148 ;;
149 pcs,cap324)
150 ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
151 ;;
152 pcs,cr3000)
153 ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
154 ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
155 ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
156 ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
157 ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
158 ;;
159 qihoo,c301)
160 ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
161 ;;
162 tplink,archer-a7-v5|\
163 tplink,archer-c7-v4|\
164 tplink,archer-c7-v5)
165 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
166 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
167 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
168 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
169 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x20"
170 ;;
171 tplink,archer-c2-v3|\
172 tplink,tl-wr1043nd-v4|\
173 tplink,tl-wr1043n-v5)
174 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20"
175 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
176 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
177 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
178 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
179 ;;
180 tplink,archer-c6-v2|\
181 tplink,archer-c6-v2-us)
182 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x3C"
183 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
184 ;;
185 tplink,archer-c25-v1|\
186 tplink,tl-wr842n-v3)
187 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
188 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
189 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
190 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
191 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
192 ;;
193 tplink,archer-c58-v1|\
194 tplink,archer-c59-v1|\
195 tplink,archer-c59-v2|\
196 tplink,archer-c60-v1|\
197 tplink,archer-c60-v2|\
198 tplink,archer-c60-v3)
199 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
200 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
201 ;;
202 tplink,archer-d50-v1)
203 ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x1c"
204 ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx"
205 ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
206 ;;
207 tplink,archer-d7-v1|\
208 tplink,archer-d7b-v1)
209 ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x3c"
210 ;;
211 tplink,cpe210-v1|\
212 tplink,cpe220-v2|\
213 tplink,cpe220-v3|\
214 tplink,cpe510-v1|\
215 tplink,wbs210-v1|\
216 tplink,wbs210-v2|\
217 tplink,wbs510-v1|\
218 tplink,wbs510-v2)
219 ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1"
220 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
221 ucidef_set_rssimon "wlan0" "200000" "1"
222 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100"
223 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100"
224 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
225 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
226 ;;
227 tplink,cpe210-v2|\
228 tplink,cpe210-v3)
229 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
230 ucidef_set_rssimon "wlan0" "200000" "1"
231 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100"
232 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100"
233 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
234 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
235 ;;
236 tplink,cpe510-v2|\
237 tplink,cpe510-v3)
238 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
239 ucidef_set_rssimon "wlan0" "200000" "1"
240 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
241 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
242 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
243 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
244 ;;
245 tplink,cpe610-v1|\
246 tplink,tl-wr902ac-v1)
247 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
248 ucidef_set_led_netdev "internet" "Internet" "tp-link:green:internet" "eth0"
249 ;;
250 tplink,re355-v1|\
251 tplink,re450-v1|\
252 tplink,re450-v2|\
253 tplink,re450-v3)
254 ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
255 ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
256 ;;
257 tplink,tl-mr6400-v1)
258 ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x0e"
259 ucidef_set_led_netdev "wan" "WAN" "tp-link:white:wan" "eth1"
260 ucidef_set_led_netdev "4g" "4G" "tp-link:white:4g" "usb0"
261 ;;
262 tplink,tl-wr842n-v2)
263 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
264 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
265 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
266 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
267 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
268 ;;
269 trendnet,tew-823dru)
270 ucidef_set_led_netdev "wan" "WAN" "trendnet:green:planet" "eth0"
271 ;;
272 ubnt,bullet-m-ar7240|\
273 ubnt,bullet-m-ar7241|\
274 ubnt,bullet-m-xw|\
275 ubnt,nanobridge-m|\
276 ubnt,nanostation-loco-m|\
277 ubnt,nanostation-loco-m-xw|\
278 ubnt,nanostation-m|\
279 ubnt,nanostation-m-xw|\
280 ubnt,picostation-m|\
281 ubnt,rocket-m)
282 ucidef_set_rssimon "wlan0" "200000" "1"
283 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
284 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
285 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
286 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
287 ;;
288 ubnt,nanobeam-ac|\
289 ubnt,nanostation-ac|\
290 ubnt,powerbeam-5ac-gen2)
291 ucidef_set_rssimon "wlan0" "200000" "1"
292 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:blue:rssi0" "wlan0" "1" "100"
293 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:blue:rssi1" "wlan0" "26" "100"
294 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:blue:rssi2" "wlan0" "51" "100"
295 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:blue:rssi3" "wlan0" "76" "100"
296 ;;
297 wd,mynet-wifi-rangeextender)
298 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
299 ucidef_set_rssimon "wlan0" "200000" "1"
300 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100"
301 ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100"
302 ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100"
303 ;;
304 yuncore,a770)
305 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
306 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x10"
307 ;;
308 zbtlink,zbt-wd323)
309 ucidef_set_led_switch "lan1" "LAN1" "zbt-wd323:orange:lan1" "switch0" "0x10"
310 ucidef_set_led_switch "lan2" "LAN2" "zbt-wd323:orange:lan2" "switch0" "0x08"
311 ;;
312 esac
313
314 board_config_flush
315
316 exit 0