ramips: add support for D-Link DWR-118-A1
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / board.d / 01_leds
index 8bf7ef3b1e517c807832717a2124d204ec786a6c..f8c4b05b9a55e6ae194553dd683d28ba51e65310 100755 (executable)
@@ -2,10 +2,6 @@
 
 . /lib/functions/uci-defaults.sh
 
-set_usb_led() {
-       ucidef_set_led_usbdev "usb" "USB" "${1}" "${2:-1-1}"
-}
-
 set_wifi_led() {
        ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
 }
@@ -17,26 +13,11 @@ boardname="${board##*,}"
 board_config_update
 
 case $board in
-11acnas|\
-all0239-3g|\
-ew1200|\
-hw550-3g|\
-mofi3500-3gn|\
-sap-g3200u3|\
-sk-wb8|\
-w2914nsv2|\
-wf-2881)
-       set_usb_led "$boardname:green:usb"
-       ;;
-3g150b|\
-3g300m)
-       set_usb_led "$boardname:blue:3g"
-       ;;
 3g-6200n)
        set_wifi_led "$boardname:amber:wlan"
-       set_usb_led "$boardname:blue:3g"
        ;;
 3g-6200nl|\
+skylab,skw92a|\
 wnce2001)
        set_wifi_led "$boardname:green:wlan"
        ;;
@@ -50,11 +31,9 @@ ai-br100)
        ;;
 air3gii)
        set_wifi_led "$boardname:green:wlan"
-       set_usb_led "$boardname:green:mobile"
        ;;
 alfa-network,ac1200rm)
        set_wifi_led "$boardname:green:wlan2g" "wlan1"
-       ucidef_set_led_default "wps" "wps" "$boardname:green:wps" "0"
        ;;
 alfa-network,awusfree1)
        set_wifi_led "$boardname:blue:wlan"
@@ -76,13 +55,12 @@ asl26555-8M|\
 asl26555-16M)
        ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
        set_wifi_led "asl26555:green:wlan"
-       set_usb_led "asl26555:green:3g"
        ;;
-bc2)
-       set_usb_led "$boardname:blue:usb"
+bdcom,wap2100-sk|\
+hiwifi,hc5861b)
+       set_wifi_led "$boardname:green:wlan2g"
        ;;
 broadway)
-       set_usb_led "$boardname:red:diskmounted"
        set_wifi_led "$boardname:red:wps_active"
        ;;
 c108)
@@ -92,13 +70,11 @@ c108)
 c20i)
        ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
        ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
-       set_usb_led "$boardname:blue:usb" "2-1"
        ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio"
        ;;
 c50)
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
        ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
-       set_usb_led "$boardname:green:usb"
        ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1
        set_wifi_led "$boardname:green:wlan5g"
        ;;
@@ -106,16 +82,8 @@ cf-wr800n)
        ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
        set_wifi_led "$boardname:white:wifi"
        ;;
-cy-swr1100)
-       ucidef_set_led_default "wps" "WPS" "$boardname:blue:wps" "0"
-       set_usb_led "$boardname:blue:usb"
-       ;;
-d105)
-       set_usb_led "$boardname:green:usb"
-       ;;
 d240)
        set_wifi_led "$boardname:blue:wifi"
-       set_usb_led "$boardname:blue:usb"
        ;;
 dcs-930l-b1)
        ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
@@ -146,24 +114,25 @@ dlink,dwr-116-a1|\
 mzk-ex300np)
        set_wifi_led "$boardname:green:wifi"
        ;;
+dlink,dwr-118-a1)
+       ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1f"
+       ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x20"
+       set_wifi_led "$boardname:green:wlan2g" "wlan1"
+       ;;
 dlink,dwr-118-a2)
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0e"
        ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
        set_wifi_led "$boardname:green:wlan2g" "wlan1"
-       set_usb_led "$boardname:green:usb"
-       ucidef_set_led_default "internet" "internet" "$boardname:green:internet" "0"
        ;;
 dlink,dwr-921-c1)
        set_wifi_led "$boardname:green:wifi"
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
-       ucidef_set_led_default "sigstrength" "Signal Strength" "$boardname:green:sigstrength" "0"
        ;;
 dir-860l-b1)
        ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
        ;;
 edimax,br-6478ac-v2)
        set_wifi_led "$boardname:blue:wlan"
-       set_usb_led "$boardname:blue:usb"
        ;;
 ex2700|\
 wn3000rpv3)
@@ -174,15 +143,9 @@ ex3700)
        ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
        ;;
 f5d8235-v1)
-       ucidef_set_led_default "lan" "lan" "$boardname:blue:wired" "0"
-       set_usb_led "$boardname:blue:storage"
        set_wifi_led "$boardname:blue:wireless"
        ;;
-f5d8235-v2)
-       set_usb_led "$boardname:blue:storage"
-       ;;
 fonera20n)
-       set_usb_led "$boardname:orange:usb"
        set_wifi_led "$boardname:orange:wifi"
        ;;
 gnubee,gb-pc1|\
@@ -197,6 +160,7 @@ gl-mt750)
        ;;
 gl-mt300n-v2)
        set_wifi_led "$boardname:red:wlan"
+       ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
        ;;
 hc5661|\
 hc5661a)
@@ -215,12 +179,8 @@ hc5861)
        ;;
 hg255d)
        set_wifi_led "$boardname:green:wlan"
-       set_usb_led "$boardname:green:usb"
        ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2"
        ;;
-hiwifi,hc5861b)
-       set_wifi_led "$boardname:green:wlan2g"
-       ;;
 hpm)
        ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
        set_wifi_led "$boardname:green:wifi"
@@ -235,15 +195,17 @@ kimax,u35wf)
        ;;
 kn|\
 nbg-419n2)
-       set_usb_led "$boardname:green:usb"
        set_wifi_led "rt2800pci-phy0::radio"
        ;;
 kn_rc|\
 kn_rf|\
 kng_rc)
-       set_usb_led "$boardname:green:usb"
        set_wifi_led "$boardname:green:wifi"
        ;;
+lava,lr-25g001)
+       ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "wlan1"
+       ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "wlan0"
+       ;;
 linkits7688)
        ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
        ;;
@@ -261,7 +223,6 @@ mikrotik,rbm11g)
        ;;
 miniembplug)
        set_wifi_led "$boardname:red:wlan"
-       set_usb_led "$boardname:green:mobile"
        ;;
 mir3g)
        ucidef_set_led_switch "wan-amber"  "WAN (amber)"  "$boardname:amber:wan"  "switch0" "0x02" "0x08"
@@ -272,44 +233,32 @@ mlw221|\
 mlwg2)
        set_wifi_led "$boardname:blue:wifi"
        ;;
-mpr-a1|\
-mpr-a2)
-       set_wifi_led "$boardname:blue:system"
-       ;;
 mr-102n)
        set_wifi_led "$boardname:green:wlan"
-       set_usb_led "$boardname:green:usb"
        ;;
 mr200)
        ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
        ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
        set_wifi_led "$boardname:white:wlan"
        ;;
+mtc,wr1201)
+       ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f"
+       ;;
 mzk-ex750np)
        set_wifi_led "$boardname:red:wifi"
        ;;
-na930)
-       set_usb_led "$boardname:blue:status"
-       ;;
 netgear,r6120)
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
        ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt"
        ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "phy1tpt"
        ;;
-nw718)
-       set_usb_led "$boardname:amber:usb"
-       ;;
 oy-0001)
        set_wifi_led "$boardname:green:wifi"
        ;;
-pbr-d1)
-       set_usb_led "$boardname:orange:usb"
-       ;;
 pbr-m1)
        ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
        ;;
 d-team,newifi-d2)
-       set_usb_led "$boardname:blue:usb"
        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"
@@ -320,12 +269,10 @@ psg1208)
 px-4885-4M|\
 px-4885-8M)
        set_wifi_led "px-4885:orange:wifi"
-       set_usb_led "px-4885:blue:storage"
        ;;
 r6220)
        ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2
        set_wifi_led "$boardname:green:wifi"
-       set_usb_led "$boardname:green:usb"
        ;;
 re350-v1)
        ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
@@ -339,7 +286,6 @@ rp-n53)
        ;;
 rt-ac51u)
        set_wifi_led "$boardname:blue:wifi"
-       set_usb_led "$boardname:blue:usb" "1-1"
        ;;
 rt-n12p)
        ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0.1
@@ -350,19 +296,16 @@ rt-n14u)
        ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1
        ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2
        set_wifi_led "$boardname:blue:air"
-       set_usb_led "$boardname:blue:usb"
        ;;
 tama,w06)
        ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
        ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
        ;;
 tew-714tru)
-       set_usb_led "$boardname:red:usb"
        set_wifi_led "$boardname:green:wifi"
        ;;
 tiny-ac)
        set_wifi_led "$boardname:orange:wifi"
-       set_usb_led "$boardname:green:usb"
        ;;
 tl-wr840n-v4)
        ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
@@ -380,13 +323,11 @@ tl-wr841n-v13)
 tplink,c2-v1)
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch1" "0x1e"
        ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch1" "0x01"
-       set_usb_led "$boardname:green:usb" "2-1"
        set_wifi_led "$boardname:green:wlan"
        ;;
 tplink,c20-v1)
        ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
        ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
-       set_usb_led "$boardname:blue:usb"
        ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0"
        ;;
 tplink,c20-v4)
@@ -404,15 +345,17 @@ 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-mr3020-v3)
+       set_wifi_led "$boardname:green:wlan"
+       ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
+       ;;
 tplink,tl-mr3420-v5|\
 tplink,tl-wr842n-v5)
-       set_usb_led "$boardname:green:usb"
        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-wr902ac-v3)
-       set_usb_led "$boardname:green:usb"
        ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10"
        ;;
@@ -426,31 +369,26 @@ u7628-01-128M-16M)
        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_usb_led "u7628-01:green:usb"
        set_wifi_led "u7628-01:green:wlan"
        ;;
 vocore-8M|\
 vocore-16M)
        ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
-       set_wifi_led "vocore:green:status"
-       ;;
-vocore2)
-       set_wifi_led "$boardname:fuchsia:status"
-       ;;
-vocore2lite)
-       set_wifi_led "$boardname:green:status"
        ;;
 w502u)
-       set_usb_led "$boardname:blue:usb"
        set_wifi_led "rt2800pci-phy0::radio"
        ;;
-wcr-150gn)
-       set_usb_led "$boardname:amber:user"
+wavlink,wl-wn570ha1)
+       ucidef_set_led_switch "wan" "wan" "$boardname: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"
        ;;
 we1026-5g-16m)
        ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
        set_wifi_led "we1026-5g:green:wifi"
-       set_usb_led "we1026-5g:green:usb" "1-1.1"
        ;;
 wl-wn575a3)
        ucidef_set_rssimon "wlan1" "200000" "1"
@@ -463,33 +401,25 @@ wrh-300cr)
        ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
        ;;
 y1)
-       set_usb_led "$boardname:blue:usb"
        ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1"
        ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0"
        ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03"
        ;;
 y1s)
-       set_usb_led "$boardname:blue:usb"
        ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1"
        ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0"
        ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
        ;;
 youhua,wr1200js)
        ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01"
-       ucidef_set_led_usbdev "usb" "USB" "$boardname:blue:usb" "1-2"
-       ucidef_set_led_default "wps" "wps" "$boardname:blue:wps" "0"
        ;;
 zbt-ape522ii)
        ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1"
        ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx"
        ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx"
        ;;
-zbt-cpe102)
-       ucidef_set_led_default "power" "power" "$boardname:green:4g-0" "0"
-       ;;
 zbt-wa05)
        set_wifi_led "$boardname:blue:air"
-       set_usb_led "$boardname:blue:usb"
        ;;
 zbt-we2026)
        set_wifi_led "$boardname:green:wlan"
@@ -497,7 +427,6 @@ zbt-we2026)
 zbt-we826-16M|\
 zbt-we826-32M)
        set_wifi_led "zbt-we826:green:wifi"
-       set_usb_led "zbt-we826:green:usb"
        ;;
 zbtlink,zbt-we1226)
        set_wifi_led "$boardname:green:wlan"
@@ -506,23 +435,17 @@ zbtlink,zbt-we1226)
        ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x10"
        ;;
 zbt-wr8305rt)
-       set_usb_led "$boardname:green:usb"
        set_wifi_led "$boardname:green:wifi"
        ;;
 zorlik,zl5900v2)
        ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0
        ;;
-zte-q7)
-       set_wifi_led "$boardname:blue:status"
-       ;;
 zyxel,keenetic-extra-ii)
        set_wifi_led "$boardname:green:wifi"
-       set_usb_led "$boardname:green:usb"
        ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
        ;;
 youku-yk1)
        set_wifi_led "$boardname:blue:air"
-       set_usb_led "$boardname:blue:usb"
        ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
        ;;
 esac