-#!/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
alfa-network,awusfree1)
- set_wifi_led "$boardname:blue:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "blue:wlan" "wlan0"
+ ;;
+asus,rt-n10p-v3|\
+asus,rt-n11p-b1|\
+asus,rt-n12-vp-b1|\
+netgear,r6020|\
+netgear,r6080|\
+netgear,r6120)
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0xf"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
cudy,wr1000)
- ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
- ucidef_set_led_switch "lan1" "lan1" "$boardname:blue:lan1" "switch0" "0x08"
- ucidef_set_led_switch "lan2" "lan2" "$boardname:blue:lan2" "switch0" "0x04"
+ ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
+ ucidef_set_led_switch "lan1" "lan1" "blue:lan1" "switch0" "0x08"
+ ucidef_set_led_switch "lan2" "lan2" "blue:lan2" "switch0" "0x04"
+ ;;
+elecom,wrc-1167fs)
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
+ ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x10"
;;
glinet,gl-mt300n-v2)
- set_wifi_led "$boardname:red:wlan"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
+ ucidef_set_led_netdev "wifi_led" "wifi" "red:wlan" "wlan0"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x1"
;;
hilink,hlk-7628n|\
skylab,skw92a)
- set_wifi_led "$boardname:green:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan" "wlan0"
+ ;;
+hilink,hlk-7688a)
+ ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt"
;;
hiwifi,hc5661a|\
hiwifi,hc5761a)
- ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
+ ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10"
;;
mediatek,linkit-smart-7688)
- ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
- ;;
-netgear,r6120)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
- ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt"
+ ucidef_set_led_wlan "wifi" "wifi" "orange:wifi" "phy0tpt"
;;
rakwireless,rak633)
- set_wifi_led "$boardname:blue:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "blue:wifi" "wlan0"
;;
tama,w06)
- ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
- ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
+ ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt"
;;
tplink,archer-c20-v4|\
-tplink,archer-c20-v5)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+tplink,archer-c20-v5|\
+tplink,tl-wr850n-v2)
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
;;
tplink,archer-c50-v3|\
tplink,archer-c50-v4)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
- ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt"
- ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:green:wlan5g" "phy1tpt"
- ;;
-tplink,tl-mr3020-v3)
- set_wifi_led "$boardname:green:wlan"
- ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan2g" "phy0tpt"
+ ucidef_set_led_wlan "wlan5g" "wlan5g" "green:wlan5g" "phy1tpt"
+ ;;
+tplink,re200-v2|\
+tplink,re200-v3|\
+tplink,re200-v4|\
+tplink,re220-v2|\
+tplink,tl-mr3020-v3|\
+tplink,tl-wa801nd-v5)
+ ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
;;
tplink,tl-mr3420-v5|\
+tplink,tl-wr840n-v4|\
tplink,tl-wr842n-v5)
- ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan" "phy0tpt"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
;;
-tplink,tl-wa801nd-v5)
- ucidef_set_led_wlan "wlan" "wlan" "$boardname:green:wlan" "phy0tpt"
- ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
+tplink,tl-mr6400-v4)
+ ucidef_set_led_switch "lan" "lan" "white:lan" "switch0" "0x0e"
+ ucidef_set_led_switch "wan" "wan" "white:wan" "switch0" "0x10"
;;
-tplink,tl-wr840n-v4)
- ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+tplink,tl-mr6400-v5)
+ ucidef_set_led_switch "lan" "lan" "white:lan" "switch0" "0x07"
+ ucidef_set_led_switch "wan" "wan" "white:wan" "switch0" "0x08"
;;
tplink,tl-wr841n-v13)
- ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
- ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2"
- ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4"
- ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8"
- ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan" "phy0tpt"
+ ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x2"
+ ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x4"
+ ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x8"
+ ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
;;
tplink,tl-wr841n-v14)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
+ ucidef_set_led_wlan "wifi_led" "wifi" "green:wlan" "phy0tpt"
;;
tplink,tl-wr902ac-v3)
- ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan" "phy0tpt"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
unielec,u7628-01-16m)
- ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
- ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
- ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
- ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
- ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
- set_wifi_led "u7628-01:green:wlan"
+ ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x2"
+ ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x4"
+ ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x8"
+ ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
+ ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan" "wlan0"
;;
wavlink,wl-wn570ha1)
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
ucidef_set_rssimon "wlan0" "200000" "1"
- ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan0" "1" "49"
- ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan0" "50" "84"
- ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100"
- set_wifi_led "$boardname:green:wifi"
+ ucidef_set_led_rssi "wifi-low" "wifi-low" "green:wifi-low" "wlan0" "1" "49"
+ ucidef_set_led_rssi "wifi-med" "wifi-med" "green:wifi-med" "wlan0" "50" "84"
+ ucidef_set_led_rssi "wifi-high" "wifi-high" "green:wifi-high" "wlan0" "85" "100"
+ ucidef_set_led_netdev "wifi_led" "wifi" "green:wifi" "wlan0"
;;
wavlink,wl-wn575a3)
ucidef_set_rssimon "wlan1" "200000" "1"
- ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49"
- ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84"
- ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100"
+ ucidef_set_led_rssi "wifi-low" "wifi-low" "green:wifi-low" "wlan1" "1" "49"
+ ucidef_set_led_rssi "wifi-med" "wifi-med" "green:wifi-med" "wlan1" "50" "84"
+ ucidef_set_led_rssi "wifi-high" "wifi-high" "green:wifi-high" "wlan1" "85" "100"
+ ;;
+wavlink,wl-wn577a2)
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
zbtlink,zbt-we1226)
- set_wifi_led "$boardname:green:wlan"
- ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01"
- ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x02"
- ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan" "wlan0"
+ ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x01"
+ ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x02"
+ ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x10"
;;
zyxel,keenetic-extra-ii)
- set_wifi_led "$boardname:green:wifi"
- ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
+ ucidef_set_led_netdev "wifi_led" "wifi" "green:wifi" "wlan0"
+ ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x01"
;;
esac