be5d29d97c365ca053dccd16f1580e5edbfdff5d
[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-v11|\
132 tplink,tl-wr842n-v3)
133 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
134 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
135 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
136 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
137 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
138 ;;
139 tplink,archer-c58-v1|\
140 tplink,archer-c59-v1|\
141 tplink,archer-c60-v1|\
142 tplink,archer-c60-v2)
143 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
144 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
145 ;;
146 tplink,archer-d50-v1)
147 ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x1c"
148 ucidef_set_led_switch "wan_data" "WAN Data" "tp-link:white:internet" "switch0" "0x02" "" "tx rx"
149 ucidef_set_led_switch "wan_link" "WAN Link" "tp-link:white:wan" "switch0" "0x02" "" "link"
150 ;;
151 tplink,cpe220-v3)
152 ucidef_set_led_netdev "lan0" "LAN0" "tp-link:green:lan0" "eth1"
153 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
154 ucidef_set_rssimon "wlan0" "200000" "1"
155 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100"
156 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100"
157 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
158 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
159 ;;
160 tplink,cpe210-v2|\
161 tplink,cpe210-v3)
162 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
163 ucidef_set_rssimon "wlan0" "200000" "1"
164 ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100"
165 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "30" "100"
166 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
167 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
168 ;;
169 tplink,re450-v2)
170 ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
171 ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
172 ;;
173 tplink,tl-mr3020-v1|\
174 tplink,tl-mr3040-v2)
175 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
176 ;;
177 tplink,tl-wr740n-v1|\
178 tplink,tl-wr740n-v3|\
179 tplink,tl-wr741-v1|\
180 tplink,tl-wr743nd-v1|\
181 tplink,tl-wr841-v5|\
182 tplink,tl-wr941-v4)
183 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
184 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
185 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
186 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
187 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
188 ;;
189 tplink,tl-wr740n-v4|\
190 tplink,tl-wr741nd-v4|\
191 tplink,tl-wr841-v8|\
192 tplink,tl-wr842n-v2)
193 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
194 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
195 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
196 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
197 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
198 ;;
199 ubnt,bullet-m|\
200 ubnt,bullet-m-xw|\
201 ubnt,nanostation-m|\
202 ubnt,nanostation-m-xw|\
203 ubnt,rocket-m)
204 ucidef_set_rssimon "wlan0" "200000" "1"
205 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
206 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
207 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
208 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
209 ;;
210 ubnt,nanobeam-ac|\
211 ubnt,nanostation-ac)
212 ucidef_set_rssimon "wlan0" "200000" "1"
213 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:blue:rssi0" "wlan0" "1" "100"
214 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:blue:rssi1" "wlan0" "26" "100"
215 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:blue:rssi2" "wlan0" "51" "100"
216 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:blue:rssi3" "wlan0" "76" "100"
217 ;;
218 wd,mynet-wifi-rangeextender)
219 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
220 ucidef_set_rssimon "wlan0" "200000" "1"
221 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100"
222 ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100"
223 ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100"
224 ;;
225 yuncore,a770)
226 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
227 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x10"
228 ;;
229 zbtlink,zbt-wd323)
230 ucidef_set_led_switch "lan1" "LAN1" "zbt-wd323:orange:lan1" "switch0" "0x10"
231 ucidef_set_led_switch "lan2" "LAN2" "zbt-wd323:orange:lan2" "switch0" "0x08"
232 ;;
233 esac
234
235 board_config_flush
236
237 exit 0