lantiq: set correct gphy pins for Zyxel P-2812
[openwrt/openwrt.git] / target / linux / ramips / mt76x8 / base-files / etc / board.d / 01_leds
1 #!/bin/sh
2
3 . /lib/functions/leds.sh
4 . /lib/functions/uci-defaults.sh
5
6 set_wifi_led() {
7 ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
8 }
9
10
11 board=$(board_name)
12 boardname="${board##*,}"
13
14 board_config_update
15
16 led_wlan="$(get_dt_led wlan)"
17 [ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt"
18
19 case $board in
20 alfa-network,awusfree1)
21 set_wifi_led "$boardname:blue:wlan"
22 ;;
23 asus,rt-n10p-v3|\
24 asus,rt-n11p-b1|\
25 asus,rt-n12-vp-b1|\
26 netgear,r6080|\
27 netgear,r6120)
28 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0xf"
29 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
30 ;;
31 cudy,wr1000)
32 ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
33 ucidef_set_led_switch "lan1" "lan1" "$boardname:blue:lan1" "switch0" "0x08"
34 ucidef_set_led_switch "lan2" "lan2" "$boardname:blue:lan2" "switch0" "0x04"
35 ;;
36 glinet,gl-mt300n-v2)
37 set_wifi_led "$boardname:red:wlan"
38 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
39 ;;
40 hilink,hlk-7628n|\
41 skylab,skw92a)
42 set_wifi_led "$boardname:green:wlan"
43 ;;
44 hiwifi,hc5661a|\
45 hiwifi,hc5761a)
46 ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
47 ;;
48 mediatek,linkit-smart-7688)
49 ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
50 ;;
51 rakwireless,rak633)
52 set_wifi_led "$boardname:blue:wifi"
53 ;;
54 tama,w06)
55 ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
56 ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
57 ;;
58 tplink,archer-c20-v4|\
59 tplink,archer-c20-v5)
60 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
61 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
62 ;;
63 tplink,archer-c50-v3|\
64 tplink,archer-c50-v4)
65 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
66 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
67 ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt"
68 ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:green:wlan5g" "phy1tpt"
69 ;;
70 tplink,re200-v2|\
71 tplink,re220-v2|\
72 tplink,tl-mr3020-v3|\
73 tplink,tl-wa801nd-v5)
74 ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
75 ;;
76 tplink,tl-mr3420-v5|\
77 tplink,tl-wr842n-v5)
78 ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
79 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
80 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
81 ;;
82 tplink,tl-wr840n-v4)
83 ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
84 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
85 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
86 ;;
87 tplink,tl-wr841n-v13)
88 ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
89 ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2"
90 ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4"
91 ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8"
92 ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10"
93 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
94 ;;
95 tplink,tl-wr841n-v14)
96 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
97 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
98 ;;
99 tplink,tl-wr902ac-v3)
100 ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
101 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10"
102 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
103 ;;
104 unielec,u7628-01-16m)
105 ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
106 ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
107 ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
108 ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
109 ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
110 set_wifi_led "u7628-01:green:wlan"
111 ;;
112 wavlink,wl-wn570ha1)
113 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
114 ucidef_set_rssimon "wlan0" "200000" "1"
115 ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan0" "1" "49"
116 ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan0" "50" "84"
117 ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100"
118 set_wifi_led "$boardname:green:wifi"
119 ;;
120 wavlink,wl-wn575a3)
121 ucidef_set_rssimon "wlan1" "200000" "1"
122 ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49"
123 ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84"
124 ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100"
125 ;;
126 wavlink,wl-wn577a2)
127 ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x8"
128 ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
129 ;;
130 zbtlink,zbt-we1226)
131 set_wifi_led "$boardname:green:wlan"
132 ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01"
133 ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x02"
134 ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x10"
135 ;;
136 zyxel,keenetic-extra-ii)
137 set_wifi_led "$boardname:green:wifi"
138 ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
139 ;;
140 esac
141
142 board_config_flush
143
144 exit 0