ath79: add support for GL-iNet GL-X750
[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 etactica,eg200)
32 ucidef_set_led_netdev "lan" "LAN" "$boardname:red:eth0" "eth0"
33 ucidef_set_led_oneshot "modbus" "Modbus" "$boardname:red:modbus" "100" "33"
34 ucidef_set_led_default "etactica" "etactica" "$boardname:red:etactica" "ignore"
35 ;;
36 glinet,x750)
37 ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
38 ;;
39 netgear,wnr612-v2|\
40 on,n150r)
41 ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
42 ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f"
43 ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f"
44 ;;
45 pcs,cap324)
46 ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0"
47 ;;
48 pcs,cr3000)
49 ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
50 ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
51 ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
52 ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
53 ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
54 ;;
55 tplink,re450-v2)
56 ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
57 ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
58 ;;
59 tplink,tl-mr3020-v1|\
60 tplink,tl-mr3040-v2)
61 ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
62 ;;
63 tplink,tl-wr1043nd-v4)
64 ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20"
65 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
66 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
67 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
68 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
69 ;;
70 tplink,tl-wr740n-v1|\
71 tplink,tl-wr740n-v3|\
72 tplink,tl-wr741-v1|\
73 tplink,tl-wr743nd-v1|\
74 tplink,tl-wr841-v5|\
75 tplink,tl-wr941-v4)
76 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
77 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
78 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
79 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
80 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
81 ;;
82 tplink,tl-wr740nd-v4|\
83 tplink,tl-wr741nd-v4|\
84 tplink,tl-wr842n-v2)
85 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
86 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
87 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
88 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
89 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
90 ;;
91 tplink,tl-wr841-v9|\
92 tplink,tl-wr841-v11)
93 ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
94 ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
95 ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
96 ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
97 ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
98 ;;
99 ubnt,bullet-m|\
100 ubnt,bullet-m-xw|\
101 ubnt,nano-m|\
102 ubnt,rocket-m)
103 ucidef_set_rssimon "wlan0" "200000" "1"
104 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
105 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
106 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
107 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
108 ;;
109 ubnt,nanostation-ac)
110 ucidef_set_rssimon "wlan0" "200000" "1"
111 ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:blue:rssi0" "wlan0" "1" "100"
112 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:blue:rssi1" "wlan0" "26" "100"
113 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:blue:rssi2" "wlan0" "51" "100"
114 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:blue:rssi3" "wlan0" "76" "100"
115 ;;
116 wd,mynet-wifi-rangeextender)
117 ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
118 ucidef_set_rssimon "wlan0" "200000" "1"
119 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100"
120 ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100"
121 ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100"
122 ;;
123 esac
124
125 board_config_flush
126
127 exit 0