bfe1c0c7f20d21b0f32892d6cb9c3c97954b7618
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / board.d / 01_leds
1 #!/bin/sh
2
3 . /lib/functions/uci-defaults-new.sh
4 . /lib/ramips.sh
5
6 set_usb_led() {
7 ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
8 }
9
10 set_wifi_led() {
11 ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
12 }
13
14
15 board=$(ramips_board_name)
16
17 board_config_update
18
19 case $board in
20 3g-6200n)
21 set_wifi_led "edimax:amber:wlan"
22 set_usb_led "edimax:blue:3g"
23 ;;
24 3g-6200nl)
25 set_wifi_led "edimax:green:wlan"
26 ;;
27 3g150b |\
28 3g300m)
29 set_usb_led "tenda:blue:3g"
30 ;;
31 ai-br100)
32 ucidef_set_led_netdev "wan" "wan" "aigale:blue:wan" "eth0.2"
33 set_wifi_led "aigale:blue:wlan"
34 ;;
35 a5-v11)
36 ucidef_set_led_default "power" "POWER" "a5-v11:red:power" "1"
37 ;;
38 air3gii)
39 set_wifi_led "airlive:green:wlan"
40 set_usb_led "airlive:green:mobile"
41 ;;
42 all0256n)
43 ucidef_set_rssimon "wlan0" "40000" "1"
44 ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
45 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
46 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
47 set_wifi_led "rt2800pci-phy0::radio"
48 ;;
49 ar670w|\
50 ar725w|\
51 awapn2403)
52 set_wifi_led "rt2800soc-phy0::radio"
53 ;;
54 asl26555)
55 ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1"
56 ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
57 set_wifi_led "asl26555:green:wlan"
58 set_usb_led "asl26555:green:3g"
59 ;;
60 bc2)
61 set_usb_led "bc2:blue:usb"
62 ;;
63 br6425)
64 set_wifi_led "edimax:orange:wlan"
65 ;;
66 br-6475nd)
67 set_wifi_led "edimax:amber:wlan"
68 ;;
69 broadway)
70 set_usb_led "red:diskmounted"
71 set_wifi_led "red:wps_active"
72 ;;
73 br6524n)
74 set_wifi_led "edimax:blue:wlan"
75 ;;
76 cy-swr1100)
77 ucidef_set_led_default "wps" "WPS" "samsung:blue:wps" "0"
78 set_usb_led "samsung:blue:usb"
79 ;;
80 d105)
81 ucidef_set_led_default "power" "POWER" "d105:red:power" "1"
82 set_usb_led "d105:green:usb"
83 ;;
84 dir-300-b1|\
85 dir-600-b1|\
86 dir-600-b2|\
87 dir-620-a1)
88 # ANDed with vlan switch port 4 led state
89 ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
90 set_wifi_led "rt2800pci-phy0::radio"
91 ;;
92 dir-615-d|\
93 dir-615-h1)
94 ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0"
95 set_wifi_led "rt2800pci-phy0::radio"
96 ;;
97 dir-620-d1)
98 set_wifi_led "d-link:green:wifi"
99 ;;
100 dir-810l)
101 ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
102 ;;
103 dir-610-a1 |\
104 dir-300-b7 |\
105 dir-320-b1 |\
106 esr-9753)
107 set_wifi_led "rt2800pci-phy0::radio"
108 ;;
109 f5d8235-v1)
110 set_usb_led "f5d8235-v1:blue:storage"
111 ;;
112 f5d8235-v2)
113 set_usb_led "f5d8235v2:blue:storage"
114 ;;
115 fonera20n)
116 set_usb_led "fonera20n:orange:usb"
117 set_wifi_led "fonera20n:orange:wifi"
118 ;;
119 hlk-rm04)
120 set_wifi_led "rt2800pci-phy0::radio"
121 ;;
122 ht-tm02)
123 ucidef_set_led_netdev "eth" "Ethernet" "ht-tm02:green:lan" "eth0"
124 set_wifi_led "ht-tm02:blue:wlan"
125 ;;
126 all0239-3g|\
127 hw550-3g)
128 set_usb_led "hw550-3g:green:usb"
129 ;;
130 mlw221|\
131 mlwg2)
132 set_wifi_led "kingston:blue:wifi"
133 ucidef_set_led_default "system" "system" "kingston:blue:system" "1"
134 ;;
135 mofi3500-3gn)
136 set_usb_led "mofi3500-3gn:green:usb"
137 ;;
138 mpr-a1)
139 set_wifi_led "hame:blue:system"
140 ;;
141 mpr-a2)
142 set_wifi_led "hame:blue:system"
143 ;;
144 mzk-w300nh2)
145 set_wifi_led "mzkw300nh2:amber:wlan"
146 ;;
147 na930)
148 set_usb_led "na930:blue:status"
149 ;;
150 nw718)
151 set_usb_led "nw718:amber:usb"
152 ;;
153 m2m)
154 set_wifi_led "m2m:blue:wifi"
155 ucidef_set_led_netdev "eth" "Ethernet" "m2m:green:wan" "eth0"
156 ;;
157 omni-emb-hpm)
158 ucidef_set_led_default "power" "POWER" "emb:orange:power" "1"
159 ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0"
160 set_wifi_led "emb:green:wifi"
161 ;;
162 omni-plug)
163 set_wifi_led "miniplug:green:wlan"
164 set_usb_led "miniplug:green:mobile"
165 ;;
166 px4885)
167 set_wifi_led "7links:orange:wifi"
168 set_usb_led "7links:blue:storage"
169 ;;
170 sl-r7205)
171 set_wifi_led "rt2800pci-phy0::radio"
172 ;;
173 v11st-fe)
174 set_wifi_led "rt2800pci-phy0::radio"
175 ;;
176 vocore)
177 ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
178 set_wifi_led "vocore:green:status"
179 ;;
180 w306r-v20)
181 set_wifi_led "rt2800pci-phy0::radio"
182 ;;
183 w502u)
184 set_usb_led "alfa:blue:usb"
185 set_wifi_led "rt2800pci-phy0::radio"
186 ;;
187 wcr-150gn)
188 set_usb_led "wcr150gn:amber:user"
189 ;;
190 hg255d)
191 set_wifi_led "hg255d:wlan"
192 set_usb_led "hg255d:usb"
193 ucidef_set_led_interface "lan" "hg255d:internet"
194 ;;
195 wnce2001)
196 set_wifi_led "netgear:green:wlan"
197 ;;
198 rt-n14u)
199 ucidef_set_led_default "power" "power" "asus:blue:power" "1"
200 ucidef_set_led_netdev "lan" "lan" "asus:blue:lan" eth0.1
201 ucidef_set_led_netdev "wan" "wan" "asus:blue:wan" eth0.2
202 set_wifi_led "asus:blue:air"
203 set_usb_led "asus:blue:usb"
204 ;;
205 rp-n53)
206 ucidef_set_led_netdev "eth" "Network" "asus:white:back" "eth0"
207 set_wifi_led "asus:blue:wifi"
208 ;;
209 whr-300hp2 |\
210 whr-600d |\
211 whr-1166d)
212 ucidef_set_led_default "power" "power" "buffalo:green:power" "1"
213 ucidef_set_led_default "router" "router" "buffalo:green:router" "1"
214 ;;
215 zbt-wa05)
216 ucidef_set_led_default "power" "power" "zbtlink:blue:power" "1"
217 set_wifi_led "zbtlink:blue:air"
218 set_usb_led "zbtlink:blue:usb"
219 ;;
220 wr8305rt)
221 ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
222 set_usb_led "wr8305rt:usb"
223 set_wifi_led "wr8305rt:wifi"
224 ;;
225 wt1520)
226 set_wifi_led "rt2800pci-phy0::radio"
227 ;;
228 wt3020)
229 ucidef_set_led_default "power" "power" "nexx:blue:power" "0"
230 ;;
231 xiaomi-miwifi-mini)
232 ucidef_set_led_default "power" "power" "xiaomi:red:status" "1"
233 ;;
234 y1 |\
235 y1s)
236 ucidef_set_led_default "power" "power" "lenovo:blue:power" "1"
237 set_usb_led "lenovo:blue:usb"
238 set_wifi_led "lenovo:blue:wifi"
239 ;;
240 esac
241
242 board_config_flush
243
244 exit 0