ath79: Add support for Ubiquiti Nanostation M (XW)
[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 avm,fritz300e)
12 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
13 ucidef_set_rssimon "wlan0" "200000" "1"
14 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
15 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
16 ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:green:rssi2" "wlan0" "40" "100"
17 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
18 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
19 ;;
20 avm,fritz4020)
21 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
22 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x1E"
23 ;;
24 buffalo,whr-g301n)
25 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
26 ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02"
27 ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04"
28 ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08"
29 ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10"
30 ;;
31 comfast,cf-e110n-v2)
32 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
33 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x02"
34 ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
35 ucidef_set_rssimon "wlan0" "200000" "1"
36 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
37 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
38 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
39 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
40 ;;
41 comfast,cf-e120a-v3)
42 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
43 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x04"
44 ucidef_set_rssimon "wlan0" "200000" "1"
45 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100"
46 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100"
47 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100"
48 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100"
49 ;;
50 dlink,dir-859-a1)
51 ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20"
52 ;;
53 engenius,ews511ap)
54 ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth0"
55 ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth1"
56 ;;
57 etactica,eg200)
58 ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
59 ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
60 ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore"
61 ;;
62 glinet,gl-ar150)
63 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
64 ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02"
65 ;;
66 glinet,gl-x750)
67 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
68 ;;
69 netgear,wnr612-v2|\
70 on,n150r)
71 ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
72 ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f"
73 ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f"
74 ;;
75 pcs,cap324)
76 ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
77 ;;
78 pcs,cr3000)
79 ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
80 ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
81 ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
82 ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
83 ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
84 ;;
85 tplink,archer-a7-v5|\
86 tplink,archer-c7-v4|\
87 tplink,archer-c7-v5)
88 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
89 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
90 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
91 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
92 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x20"
93 ;;
94 tplink,archer-c2-v3|\
95 tplink,tl-wr1043nd-v4)
96 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20"
97 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
98 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
99 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
100 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
101 ;;
102 tplink,archer-c58-v1|\
103 tplink,archer-c59-v1)
104 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
105 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
106 ;;
107 tplink,archer-c6-v2)
108 ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x3C"
109 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x02"
110 ;;
111 tplink,re450-v2)
112 ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
113 ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
114 ;;
115 tplink,tl-mr3020-v1|\
116 tplink,tl-mr3040-v2)
117 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
118 ;;
119 tplink,tl-wr740n-v1|\
120 tplink,tl-wr740n-v3|\
121 tplink,tl-wr741-v1|\
122 tplink,tl-wr743nd-v1|\
123 tplink,tl-wr841-v5|\
124 tplink,tl-wr941-v4)
125 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
126 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
127 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
128 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
129 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
130 ;;
131 tplink,tl-wr740n-v4|\
132 tplink,tl-wr741nd-v4|\
133 tplink,tl-wr841-v8|\
134 tplink,tl-wr842n-v2)
135 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
136 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
137 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
138 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
139 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
140 ;;
141 tplink,tl-wr841-v9|\
142 tplink,tl-wr841-v11)
143 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
144 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
145 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
146 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
147 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
148 ;;
149 ubnt,bullet-m|\
150 ubnt,bullet-m-xw|\
151 ubnt,nano-m|\
152 ubnt,nanostation-m-xw|\
153 ubnt,rocket-m)
154 ucidef_set_rssimon "wlan0" "200000" "1"
155 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
156 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
157 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
158 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
159 ;;
160 ubnt,nanostation-ac)
161 ucidef_set_rssimon "wlan0" "200000" "1"
162 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:blue:rssi0" "wlan0" "1" "100"
163 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:blue:rssi1" "wlan0" "26" "100"
164 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:blue:rssi2" "wlan0" "51" "100"
165 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:blue:rssi3" "wlan0" "76" "100"
166 ;;
167 wd,mynet-wifi-rangeextender)
168 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
169 ucidef_set_rssimon "wlan0" "200000" "1"
170 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100"
171 ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100"
172 ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100"
173 ;;
174 esac
175
176 board_config_flush
177
178 exit 0