78d48daf73b11680fa60c2263522ca3c2f8bfe9c
[openwrt/openwrt.git] / target / linux / ath79 / 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 avm,fritz300e)
16 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
17 ucidef_set_rssimon "wlan0" "200000" "1"
18 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
19 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
20 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:green:rssi2" "wlan0" "40" "100"
21 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
22 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
23 ;;
24 avm,fritz4020)
25 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
26 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x1E"
27 ;;
28 buffalo,whr-g301n)
29 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
30 ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02"
31 ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04"
32 ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08"
33 ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10"
34 ;;
35 comfast,cf-e110n-v2)
36 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
37 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x02"
38 ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
39 ucidef_set_rssimon "wlan0" "200000" "1"
40 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
41 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
42 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
43 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
44 ;;
45 comfast,cf-e120a-v3)
46 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
47 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x04"
48 ucidef_set_rssimon "wlan0" "200000" "1"
49 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
50 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
51 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
52 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
53 ;;
54 comfast,cf-e5)
55 ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x02"
56 ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1"
57 ucidef_set_rssimon "wlan0" "200000" "1"
58 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:blue:rssi0" "wlan0" "1" "100"
59 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:blue:rssi1" "wlan0" "33" "100"
60 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:blue:rssi2" "wlan0" "66" "100"
61 ;;
62 dlink,dir-859-a1)
63 ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20"
64 ;;
65 engenius,ecb1750)
66 ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0"
67 ;;
68 engenius,ews511ap)
69 ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth1"
70 ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth0"
71 ;;
72 etactica,eg200)
73 ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
74 ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
75 ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore"
76 ;;
77 glinet,gl-ar150)
78 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
79 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02"
80 ;;
81 glinet,gl-ar300m-nand|\
82 glinet,gl-ar300m-nor)
83 ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0"
84 ;;
85 glinet,gl-ar300m-lite)
86 ucidef_set_led_netdev "lan" "LAN" "gl-ar300m-lite:green:lan" "eth0"
87 ;;
88 glinet,gl-x750)
89 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
90 ;;
91 netgear,wnr612-v2|\
92 on,n150r)
93 ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
94 ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f"
95 ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f"
96 ;;
97 pcs,cap324)
98 ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
99 ;;
100 pcs,cr3000)
101 ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
102 ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
103 ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
104 ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
105 ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
106 ;;
107 tplink,archer-a7-v5|\
108 tplink,archer-c7-v4|\
109 tplink,archer-c7-v5)
110 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
111 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
112 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
113 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
114 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x20"
115 ;;
116 tplink,archer-c2-v3|\
117 tplink,tl-wr1043nd-v4|\
118 tplink,tl-wr1043n-v5)
119 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20"
120 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
121 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
122 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
123 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
124 ;;
125 tplink,archer-c6-v2)
126 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x3C"
127 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
128 ;;
129 tplink,archer-c25-v1|\
130 tplink,tl-wr841-v9|\
131 tplink,tl-wr841-v10|\
132 tplink,tl-wr841-v11|\
133 tplink,tl-wr842n-v3)
134 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
135 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
136 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
137 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
138 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
139 ;;
140 tplink,archer-c58-v1|\
141 tplink,archer-c59-v1|\
142 tplink,archer-c60-v1|\
143 tplink,archer-c60-v2)
144 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
145 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
146 ;;
147 tplink,archer-d50-v1)
148 ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x1c"
149 ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx"
150 ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
151 ;;
152 tplink,cpe220-v3)
153 ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1"
154 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
155 ucidef_set_rssimon "wlan0" "200000" "1"
156 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100"
157 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100"
158 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
159 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
160 ;;
161 tplink,cpe210-v2|\
162 tplink,cpe210-v3)
163 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
164 ucidef_set_rssimon "wlan0" "200000" "1"
165 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100"
166 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100"
167 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
168 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
169 ;;
170 tplink,re450-v2)
171 ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
172 ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
173 ;;
174 tplink,tl-mr3020-v1|\
175 tplink,tl-mr3040-v2)
176 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
177 ;;
178 tplink,tl-wr740n-v1|\
179 tplink,tl-wr740n-v3|\
180 tplink,tl-wr741-v1|\
181 tplink,tl-wr743nd-v1|\
182 tplink,tl-wr841-v5|\
183 tplink,tl-wr941-v4)
184 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
185 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
186 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
187 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
188 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
189 ;;
190 tplink,tl-wr740n-v4|\
191 tplink,tl-wr741nd-v4|\
192 tplink,tl-wr841-v8|\
193 tplink,tl-wr842n-v2)
194 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
195 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
196 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
197 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
198 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
199 ;;
200 ubnt,bullet-m|\
201 ubnt,bullet-m-xw|\
202 ubnt,nanostation-m|\
203 ubnt,nanostation-m-xw|\
204 ubnt,rocket-m)
205 ucidef_set_rssimon "wlan0" "200000" "1"
206 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
207 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
208 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
209 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
210 ;;
211 ubnt,nanobeam-ac|\
212 ubnt,nanostation-ac)
213 ucidef_set_rssimon "wlan0" "200000" "1"
214 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:blue:rssi0" "wlan0" "1" "100"
215 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:blue:rssi1" "wlan0" "26" "100"
216 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:blue:rssi2" "wlan0" "51" "100"
217 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:blue:rssi3" "wlan0" "76" "100"
218 ;;
219 wd,mynet-wifi-rangeextender)
220 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
221 ucidef_set_rssimon "wlan0" "200000" "1"
222 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100"
223 ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100"
224 ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100"
225 ;;
226 yuncore,a770)
227 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
228 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x10"
229 ;;
230 zbtlink,zbt-wd323)
231 ucidef_set_led_switch "lan1" "LAN1" "zbt-wd323:orange:lan1" "switch0" "0x10"
232 ucidef_set_led_switch "lan2" "LAN2" "zbt-wd323:orange:lan2" "switch0" "0x08"
233 ;;
234 esac
235
236 board_config_flush
237
238 exit 0