c5cd446809347b9d1f6181d5c8c503b4933d62ae
[openwrt/openwrt.git] / target / linux / ramips / mt7621 / 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 d-team,newifi-d2)
21 ucidef_set_led_netdev "internet" "internet" "$boardname:amber:internet" "wan"
22 ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
23 ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
24 ;;
25 d-team,pbr-m1|\
26 gehua,ghl-r-001)
27 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
28 ;;
29 dlink,dir-1960-a1|\
30 dlink,dir-2660-a1)
31 ucidef_set_led_netdev "wan" "wan" "$boardname:white:net" "wan"
32 ;;
33 dlink,dir-860l-b1|\
34 dlink,dir-867-a1|\
35 dlink,dir-878-a1|\
36 dlink,dir-882-a1)
37 ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan"
38 ;;
39 gnubee,gb-pc1|\
40 gnubee,gb-pc2)
41 ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1"
42 ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2"
43 ;;
44 linksys,ea7300-v1|\
45 linksys,ea7500-v2)
46 ucidef_set_led_netdev "lan1" "lan1 link" "$boardname:green:lan1" "lan1" "link"
47 ucidef_set_led_netdev "lan2" "lan2 link" "$boardname:green:lan2" "lan2" "link"
48 ucidef_set_led_netdev "lan3" "lan3 link" "$boardname:green:lan3" "lan3" "link"
49 ucidef_set_led_netdev "lan4" "lan4 link" "$boardname:green:lan4" "lan4" "link"
50 ucidef_set_led_netdev "wan" "wan link" "$boardname:green:wan" "wan" "link"
51 ;;
52 mikrotik,routerboard-760igs)
53 ucidef_set_led_netdev "sfp" "SFP" "$boardname:blue:sfp" "sfp"
54 ;;
55 mikrotik,routerboard-m11g)
56 ucidef_set_rssimon "wlan0" "200000" "1"
57 ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
58 ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
59 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi2" "wlan0" "40" "100"
60 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
61 ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
62 ;;
63 mtc,wr1201)
64 ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "br-lan"
65 ;;
66 netgear,r6220|\
67 netgear,r6260|\
68 netgear,r6350|\
69 netgear,r6850|\
70 netgear,wac124|\
71 netgear,wndr3700-v5)
72 ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" "wan"
73 ;;
74 netgear,r6700-v2|\
75 netgear,r6800)
76 ucidef_set_led_netdev "wan" "WAN" "$boardname:white:wan" "wan"
77 ucidef_set_led_netdev "lan1" "LAN1" "$boardname:white:lan1" "lan1"
78 ucidef_set_led_netdev "lan2" "LAN2" "$boardname:white:lan2" "lan2"
79 ucidef_set_led_netdev "lan3" "LAN3" "$boardname:white:lan3" "lan3"
80 ucidef_set_led_netdev "lan4" "LAN4" "$boardname:white:lan4" "lan4"
81 ;;
82 tplink,re350-v1)
83 ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
84 ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
85 ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
86 ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
87 ;;
88 tplink,re500-v1|\
89 tplink,re650-v1)
90 ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
91 ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
92 ;;
93 xzwifi,creativebox-v1)
94 ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
95 ;;
96 xiaomi,mi-router-ac2100)
97 ucidef_set_led_netdev "wan-blue" "WAN (blue)" "$boardname:blue:wan" "wan"
98 ;;
99 xiaomi,redmi-router-ac2100)
100 ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "wan"
101 ;;
102 youhua,wr1200js)
103 ucidef_set_led_netdev "internet" "INTERNET" "$boardname:green:wan" "wan"
104 ;;
105 esac
106
107 board_config_flush
108
109 exit 0