01_leds 3.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

. /lib/functions/leds.sh
. /lib/functions/uci-defaults.sh

set_wifi_led() {
	ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
}


board=$(board_name)
boardname="${board##*,}"

board_config_update

led_wlan="$(get_dt_led wlan)"
[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt"

case $board in
d-team,newifi-d2)
	ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
	ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
	ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
	;;
d-team,pbr-m1|\
gehua,ghl-r-001)
	ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
	;;
dlink,dir-860l-b1)
	ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
	;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
	ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
	ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
	;;
mikrotik,rbm11g)
	ucidef_set_rssimon "wlan0" "200000" "1"
	ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
	ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
	ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi2" "wlan0" "40" "100"
	ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
	ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
	;;
mtc,wr1201)
	ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f"
	;;
netgear,r6220|\
netgear,r6260|\
netgear,r6350|\
netgear,r6850|\
netgear,wndr3700-v5)
	ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
	;;
55
netgear,r6700-v2|\
56
57
58
59
60
61
62
netgear,r6800)
	ucidef_set_led_switch "wan" "WAN" "$boardname:white:wan" "switch0" "0x10"
	ucidef_set_led_switch "lan1" "LAN1" "$boardname:white:lan1" "switch0" "0x08"
	ucidef_set_led_switch "lan2" "LAN2" "$boardname:white:lan2" "switch0" "0x04"
	ucidef_set_led_switch "lan3" "LAN3" "$boardname:white:lan3" "switch0" "0x02"
	ucidef_set_led_switch "lan4" "LAN4" "$boardname:white:lan4" "switch0" "0x01"
	;;
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
tplink,re350-v1|\
tplink,re650-v1)
	ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
	ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
	ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx"
	ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01"
	;;
xiaomi,mir3g)
	ucidef_set_led_switch "wan-amber"  "WAN (amber)"  "$boardname:amber:wan"  "switch0" "0x02" "0x08"
	ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
	ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
	;;
xiaomi,mir3p)
	ucidef_set_led_switch "wan-amber"  "WAN (amber)"  "$boardname:amber:wan"  "switch0" "0x10" "0x08"
	ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08"
	ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
	ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08"
	;;
xzwifi,creativebox-v1)
	ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
	;;
youhua,wr1200js)
	ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01"
	;;
esac

board_config_flush

exit 0