[LEDE-DEV] [PATCH ver. A] ramips: unify etc/board.d/01_leds configuration
p.wassi at gmx.at
p.wassi at gmx.at
Sat Jul 23 07:38:47 PDT 2016
From: P.Wassi <p.wassi at gmx.at>
Remove local set_*_led functions and replace with ucidef_set_led_*
Signed-off-by: P.Wassi <p.wassi at gmx.at>
---
linux/ramips/base-files/etc/board.d/01_leds | 152 +++++++---------
1 file changed, 72 insertions(+), 80 deletions(-)
diff -rupN a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -3,14 +3,6 @@
. /lib/functions/uci-defaults.sh
. /lib/ramips.sh
-set_usb_led() {
- ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
-}
-
-set_wifi_led() {
- ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
-}
-
board=$(ramips_board_name)
@@ -19,16 +11,16 @@ board_config_update
case $board in
3g150b|\
3g300m)
- set_usb_led "$board:blue:3g"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:3g" "1-1"
;;
3g-6200n)
- set_wifi_led "$board:amber:wlan"
- set_usb_led "$board:blue:3g"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:amber:wlan" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:3g" "1-1"
;;
3g-6200nl|\
br-6475nd|\
mzk-w300nh2)
- set_wifi_led "$board:amber:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:amber:wlan" "wlan0"
;;
a5-v11|\
cs-qr10)
@@ -36,11 +28,11 @@ cs-qr10)
;;
ai-br100)
ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2"
- set_wifi_led "$board:blue:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wlan" "wlan0"
;;
air3gii)
- set_wifi_led "$board:green:wlan"
- set_usb_led "$board:green:mobile"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wlan" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:mobile" "1-1"
;;
all0239-3g|\
hw550-3g|\
@@ -48,54 +40,54 @@ mofi3500-3gn|\
sap-g3200u3|\
sk-wb8|\
wf-2881)
- set_usb_led "$board:green:usb"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
;;
all0256n)
ucidef_set_rssimon "wlan0" "40000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:rssilow" "wlan0" "1" "40" "0" "6"
ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:green:rssimed" "wlan0" "30" "80" "-29" "5"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssihigh" "wlan0" "70" "100" "-69" "8"
- set_wifi_led "rt2800pci-phy0::radio"
+ ucidef_set_led_netdev "wifi_led" "wifi" "rt2800pci-phy0::radio" "wlan0"
;;
ar670w|\
ar725w|\
awapn2403)
- set_wifi_led "rt2800soc-phy0::radio"
+ ucidef_set_led_netdev "wifi_led" "wifi" "rt2800soc-phy0::radio" "wlan0"
;;
asl26555)
ucidef_set_led_default "power" "POWER" "$board:green:power" "1"
ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
- set_wifi_led "$board:green:wlan"
- set_usb_led "$board:green:3g"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wlan" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:3g" "1-1"
;;
bc2)
- set_usb_led "$board:blue:usb"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
;;
br-6425)
- set_wifi_led "$board:orange:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:orange:wlan" "wlan0"
;;
broadway)
- set_usb_led "$board:red:diskmounted"
- set_wifi_led "$board:red:wps_active"
+ ucidef_set_led_usbdev "usb" "USB" "$board:red:diskmounted" "1-1"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:red:wps_active" "wlan0"
;;
c50)
ucidef_set_led_default "power" "power" "tp-link:blue:power" "0"
ucidef_set_led_netdev "lan" "lan" "tp-link:blue:lan" "eth0.2"
- set_usb_led "tp-link:blue:usb"
+ ucidef_set_led_usbdev "usb" "USB" "tp-link:blue:usb" "1-1"
ucidef_set_led_wlan "wlan2g" "wlan2g" "tp-link:blue:wlan2g" "phy1radio"
ucidef_set_led_wlan "wlan5g" "wlan5g" "tp-link:blue:wlan5g" "phy0radio"
;;
cf-wr800n)
ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1
- set_wifi_led "$board:white:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:white:wifi" "wlan0"
;;
cy-swr1100)
ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
- set_usb_led "$board:blue:usb"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
;;
d105)
ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
- set_usb_led "$board:green:usb"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
;;
db-wrt01)
ucidef_set_led_default "power" "power" "$board:orange:power" "1"
@@ -113,7 +105,7 @@ dir-600-b1|\
dir-600-b2|\
dir-620-a1)
ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1"
- set_wifi_led "rt2800pci-phy0::radio"
+ ucidef_set_led_netdev "wifi_led" "wifi" "rt2800pci-phy0::radio" "wlan0"
;;
dir-300-b7|\
dir-320-b1|\
@@ -124,16 +116,16 @@ sl-r7205|\
v11st-fe|\
w306r-v20|\
wt1520)
- set_wifi_led "rt2800pci-phy0::radio"
+ ucidef_set_led_netdev "wifi_led" "wifi" "rt2800pci-phy0::radio" "wlan0"
;;
dir-615-d|\
dir-615-h1)
ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0"
- set_wifi_led "rt2800pci-phy0::radio"
+ ucidef_set_led_netdev "wifi_led" "wifi" "rt2800pci-phy0::radio" "wlan0"
;;
dir-620-d1|\
mzk-ex300np)
- set_wifi_led "$board:green:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wifi" "wlan0"
;;
dir-810l|\
mzk-750dhp|\
@@ -145,60 +137,60 @@ dir-860l-b1)
;;
ex2700)
ucidef_set_led_default "power_r" "POWER (red)" "$board:red:power" "0"
- set_wifi_led "$board:green:router"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:router" "wlan0"
;;
f5d8235-v1|\
f5d8235-v2)
- set_usb_led "$board:blue:storage"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:storage" "1-1"
;;
fonera20n)
- set_usb_led "$board:orange:usb"
- set_wifi_led "$board:orange:wifi"
+ ucidef_set_led_usbdev "usb" "USB" "$board:orange:usb" "1-1"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:orange:wifi" "wlan0"
;;
gl-mt300a|\
gl-mt300n|\
gl-mt750)
- set_wifi_led "$board:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:wlan" "wlan0"
;;
hc5661)
ucidef_set_led_default "system" "system" "$board:blue:system" "1"
ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
- set_wifi_led "$board:blue:wlan2g"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wlan2g" "wlan0"
;;
hc5761)
ucidef_set_led_default "system" "system" "$board:blue:system" "1"
ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
- set_wifi_led "$board:blue:wlan2g"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wlan2g" "wlan0"
ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
;;
hc5861)
ucidef_set_led_default "system" "system" "$board:blue:system" "1"
ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
- set_wifi_led "$board:blue:wlan2g"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wlan2g" "wlan0"
ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0"
;;
hg255d)
- set_wifi_led "$board:green:wlan"
- set_usb_led "$board:green:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wlan" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2"
;;
hpm)
ucidef_set_led_default "power" "POWER" "$board:orange:power" "1"
ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0"
- set_wifi_led "$board:green:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wifi" "wlan0"
;;
ht-tm02)
ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
- set_wifi_led "$board:blue:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wlan" "wlan0"
;;
m2m)
- set_wifi_led "$board:blue:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wifi" "wlan0"
ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0"
;;
miniembplug)
- set_wifi_led "$board:red:wlan"
- set_usb_led "$board:green:mobile"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:red:wlan" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:mobile" "1-1"
;;
miwifi-mini|\
miwifi-nano)
@@ -211,30 +203,30 @@ miwifi-nano)
;;
mlw221|\
mlwg2)
- set_wifi_led "$board:blue:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wifi" "wlan0"
ucidef_set_led_default "system" "system" "$board:blue:system" "1"
;;
mpr-a1|\
mpr-a2)
- set_wifi_led "$board:blue:system"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:system" "wlan0"
;;
mr-102n)
- set_wifi_led "$board:green:wlan"
- set_usb_led "$board:green:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wlan" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
;;
mzk-ex750np)
ucidef_set_led_default "power" "power" "$board:red:power" "1"
- set_wifi_led "$board:red:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:red:wifi" "wlan0"
;;
na930)
- set_usb_led "$board:blue:status"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:status" "1-1"
;;
nw718)
- set_usb_led "$board:amber:usb"
+ ucidef_set_led_usbdev "usb" "USB" "$board:amber:usb" "1-1"
;;
oy-0001)
ucidef_set_led_default "power" "power" "$board:green:power" "1"
- set_wifi_led "$board:green:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wifi" "wlan0"
;;
pbr-m1)
ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
@@ -242,11 +234,11 @@ pbr-m1)
ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1"
;;
psg1208)
- set_wifi_led "$board:white:wlan2g"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:white:wlan2g" "wlan0"
;;
px-4885)
- set_wifi_led "$board:orange:wifi"
- set_usb_led "$board:blue:storage"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:orange:wifi" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:storage" "1-1"
;;
re6500)
ucidef_set_led_default "power" "power" "$board:white:power" "1"
@@ -254,29 +246,29 @@ re6500)
;;
rp-n53)
ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
- set_wifi_led "$board:blue:wifi"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wifi" "wlan0"
;;
rt-n14u)
ucidef_set_led_default "power" "power" "$board:blue:power" "1"
ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1
ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2
- set_wifi_led "$board:blue:air"
- set_usb_led "$board:blue:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:air" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
;;
tiny-ac)
- set_wifi_led "$board:orange:wifi"
- set_usb_led "$board:green:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:orange:wifi" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
;;
vocore)
ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0"
- set_wifi_led "$board:green:status"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:status" "wlan0"
;;
w502u)
- set_usb_led "$board:blue:usb"
- set_wifi_led "rt2800pci-phy0::radio"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
+ ucidef_set_led_netdev "wifi_led" "wifi" "rt2800pci-phy0::radio" "wlan0"
;;
wcr-150gn)
- set_usb_led "$board:amber:user"
+ ucidef_set_led_usbdev "usb" "USB" "$board:amber:user" "1-1"
;;
whr-1166d|\
whr-300hp2|\
@@ -285,10 +277,10 @@ whr-600d)
ucidef_set_led_default "router" "router" "$board:green:router" "1"
;;
wnce2001)
- set_wifi_led "$board:green:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wlan" "wlan0"
;;
wrh-300cr)
- set_wifi_led "$board:green:wlan"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wlan" "wlan0"
ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0"
;;
wndr3700v5)
@@ -300,8 +292,8 @@ wt3020)
y1|\
y1s)
ucidef_set_led_default "power" "power" "$board:blue:power" "1"
- set_usb_led "$board:blue:usb"
- set_wifi_led "$board:blue:wifi"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:wifi" "wlan0"
;;
zbt-ape522ii)
ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1"
@@ -310,26 +302,26 @@ zbt-ape522ii)
;;
zbt-wa05)
ucidef_set_led_default "power" "power" "$board:blue:power" "1"
- set_wifi_led "$board:blue:air"
- set_usb_led "$board:blue:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:air" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
;;
zbt-we826)
ucidef_set_led_default "power" "power" "$board:green:power" "1"
- set_wifi_led "$board:green:wifi"
- set_usb_led "$board:green:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wifi" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
;;
zbt-wr8305rt)
ucidef_set_led_default "power" "power" "$board:green:sys" "1"
- set_usb_led "$board:green:usb"
- set_wifi_led "$board:green:wifi"
+ ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:green:wifi" "wlan0"
;;
zte-q7)
- set_wifi_led "$board:blue:status"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:status" "wlan0"
;;
youku-yk1)
ucidef_set_led_default "power" "power" "$board:blue:power" "1"
- set_wifi_led "$board:blue:air"
- set_usb_led "$board:blue:usb"
+ ucidef_set_led_netdev "wifi_led" "wifi" "$board:blue:air" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
;;
esac
More information about the Lede-dev
mailing list