[LEDE-DEV] [PATCH ver. B] ramips: unify etc/board.d/01_leds configuration

John Crispin john at phrozen.org
Sat Jul 23 13:07:00 PDT 2016


Hi,

why is this change needed >

	John

On 23/07/2016 16:42, p.wassi at gmx.at wrote:
> From: P.Wassi <p.wassi at gmx.at>
> 
> Enhance local set_*_led functions to allow more parameters
> Signed-off-by: P.Wassi <p.wassi at gmx.at>
> ---
> linux/ramips/base-files/etc/board.d/01_leds |  148 ++++++++--------
> 1 file changed, 74 insertions(+), 74 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
> @@ -4,11 +4,11 @@
>  . /lib/ramips.sh
>  
>  set_usb_led() {
> -	ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
> +	ucidef_set_led_usbdev "usb" "USB" "$1" "$2"
>  }
>  
>  set_wifi_led() {
> -	ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
> +	ucidef_set_led_netdev "wifi_led" "wifi" "$1" "$2"
>  }
>  
>  
> @@ -19,16 +19,16 @@ board_config_update
>  case $board in
>  3g150b|\
>  3g300m)
> -	set_usb_led "$board:blue:3g"
> +	set_usb_led "$board:blue:3g" "1-1"
>  	;;
>  3g-6200n)
> -	set_wifi_led "$board:amber:wlan"
> -	set_usb_led "$board:blue:3g"
> +	set_wifi_led "$board:amber:wlan" "wlan0"
> +	set_usb_led "$board:blue:3g" "1-1"
>  	;;
>  3g-6200nl|\
>  br-6475nd|\
>  mzk-w300nh2)
> -	set_wifi_led "$board:amber:wlan"
> +	set_wifi_led "$board:amber:wlan" "wlan0"
>  	;;
>  a5-v11|\
>  cs-qr10)
> @@ -36,11 +36,11 @@ cs-qr10)
>  	;;
>  ai-br100)
>  	ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2"
> -	set_wifi_led "$board:blue:wlan"
> +	set_wifi_led "$board:blue:wlan" "wlan0"
>  	;;
>  air3gii)
> -	set_wifi_led "$board:green:wlan"
> -	set_usb_led "$board:green:mobile"
> +	set_wifi_led "$board:green:wlan" "wlan0"
> +	set_usb_led "$board:green:mobile" "1-1"
>  	;;
>  all0239-3g|\
>  hw550-3g|\
> @@ -48,54 +48,54 @@ mofi3500-3gn|\
>  sap-g3200u3|\
>  sk-wb8|\
>  wf-2881)
> -	set_usb_led "$board:green:usb"
> +	set_usb_led "$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"
> +	set_wifi_led "rt2800pci-phy0::radio" "wlan0"
>  	;;
>  ar670w|\
>  ar725w|\
>  awapn2403)
> -	set_wifi_led "rt2800soc-phy0::radio"
> +	set_wifi_led "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"
> +	set_wifi_led "$board:green:wlan" "wlan0"
> +	set_usb_led "$board:green:3g" "1-1"
>  	;;
>  bc2)
> -	set_usb_led "$board:blue:usb"
> +	set_usb_led "$board:blue:usb" "1-1"
>  	;;
>  br-6425)
> -	set_wifi_led "$board:orange:wlan"
> +	set_wifi_led "$board:orange:wlan" "wlan0"
>  	;;
>  broadway)
> -	set_usb_led "$board:red:diskmounted"
> -	set_wifi_led "$board:red:wps_active"
> +	set_usb_led "$board:red:diskmounted" "1-1"
> +	set_wifi_led "$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"
> +	set_usb_led "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"
> +	set_wifi_led "$board:white:wifi" "wlan0"
>  	;;
>  cy-swr1100)
>  	ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
> -	set_usb_led "$board:blue:usb"
> +	set_usb_led "$board:blue:usb" "1-1"
>  	;;
>  d105)
>  	ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
> -	set_usb_led "$board:green:usb"
> +	set_usb_led "$board:green:usb" "1-1"
>  	;;
>  db-wrt01)
>  	ucidef_set_led_default "power" "power" "$board:orange:power" "1"
> @@ -113,7 +113,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"
> +	set_wifi_led "rt2800pci-phy0::radio" "wlan0"
>  	;;
>  dir-300-b7|\
>  dir-320-b1|\
> @@ -124,16 +124,16 @@ sl-r7205|\
>  v11st-fe|\
>  w306r-v20|\
>  wt1520)
> -	set_wifi_led "rt2800pci-phy0::radio"
> +	set_wifi_led "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"
> +	set_wifi_led "rt2800pci-phy0::radio" "wlan0"
>  	;;
>  dir-620-d1|\
>  mzk-ex300np)
> -	set_wifi_led "$board:green:wifi"
> +	set_wifi_led "$board:green:wifi" "wlan0"
>  	;;
>  dir-810l|\
>  mzk-750dhp|\
> @@ -145,60 +145,60 @@ dir-860l-b1)
>  	;;
>  ex2700)
>  	ucidef_set_led_default "power_r" "POWER (red)" "$board:red:power" "0"
> -	set_wifi_led "$board:green:router"
> +	set_wifi_led "$board:green:router" "wlan0"
>  	;;
>  f5d8235-v1|\
>  f5d8235-v2)
> -	set_usb_led "$board:blue:storage"
> +	set_usb_led "$board:blue:storage" "1-1"
>  	;;
>  fonera20n)
> -	set_usb_led "$board:orange:usb"
> -	set_wifi_led "$board:orange:wifi"
> +	set_usb_led "$board:orange:usb" "1-1"
> +	set_wifi_led "$board:orange:wifi" "wlan0"
>  	;;
>  gl-mt300a|\
>  gl-mt300n|\
>  gl-mt750)
> -	set_wifi_led "$board:wlan"
> +	set_wifi_led "$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"
> +	set_wifi_led "$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"
> +	set_wifi_led "$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"
> +	set_wifi_led "$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"
> +	set_wifi_led "$board:green:wlan" "wlan0"
> +	set_usb_led "$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"
> +	set_wifi_led "$board:green:wifi" "wlan0"
>  	;;
>  ht-tm02)
>  	ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0"
> -	set_wifi_led "$board:blue:wlan"
> +	set_wifi_led "$board:blue:wlan" "wlan0"
>  	;;
>  m2m)
> -	set_wifi_led "$board:blue:wifi"
> +	set_wifi_led "$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"
> +	set_wifi_led "$board:red:wlan" "wlan0"
> +	set_usb_led "$board:green:mobile" "1-1"
>  	;;
>  miwifi-mini|\
>  miwifi-nano)
> @@ -211,30 +211,30 @@ miwifi-nano)
>  	;;
>  mlw221|\
>  mlwg2)
> -	set_wifi_led "$board:blue:wifi"
> +	set_wifi_led "$board:blue:wifi" "wlan0"
>  	ucidef_set_led_default "system" "system" "$board:blue:system" "1"
>  	;;
>  mpr-a1|\
>  mpr-a2)
> -	set_wifi_led "$board:blue:system"
> +	set_wifi_led "$board:blue:system" "wlan0"
>  	;;
>  mr-102n)
> -	set_wifi_led "$board:green:wlan"
> -	set_usb_led "$board:green:usb"
> +	set_wifi_led "$board:green:wlan" "wlan0"
> +	set_usb_led "$board:green:usb" "1-1"
>  	;;
>  mzk-ex750np)
>  	ucidef_set_led_default "power" "power" "$board:red:power" "1"
> -	set_wifi_led "$board:red:wifi"
> +	set_wifi_led "$board:red:wifi" "wlan0"
>  	;;
>  na930)
> -	set_usb_led "$board:blue:status"
> +	set_usb_led "$board:blue:status" "1-1"
>  	;;
>  nw718)
> -	set_usb_led "$board:amber:usb"
> +	set_usb_led "$board:amber:usb" "1-1"
>  	;;
>  oy-0001)
>  	ucidef_set_led_default "power" "power" "$board:green:power" "1"
> -	set_wifi_led "$board:green:wifi"
> +	set_wifi_led "$board:green:wifi" "wlan0"
>  	;;
>  pbr-m1)
>  	ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2"
> @@ -242,11 +242,11 @@ pbr-m1)
>  	ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1"
>  	;;
>  psg1208)
> -	set_wifi_led "$board:white:wlan2g"
> +	set_wifi_led "$board:white:wlan2g" "wlan0"
>  	;;
>  px-4885)
> -	set_wifi_led "$board:orange:wifi"
> -	set_usb_led "$board:blue:storage"
> +	set_wifi_led "$board:orange:wifi" "wlan0"
> +	set_usb_led "$board:blue:storage" "1-1"
>  	;;
>  re6500)
>  	ucidef_set_led_default "power" "power" "$board:white:power" "1"
> @@ -254,29 +254,29 @@ re6500)
>  	;;
>  rp-n53)
>  	ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0"
> -	set_wifi_led "$board:blue:wifi"
> +	set_wifi_led "$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"
> +	set_wifi_led "$board:blue:air" "wlan0"
> +	set_usb_led "$board:blue:usb" "1-1"
>  	;;
>  tiny-ac)
> -	set_wifi_led "$board:orange:wifi"
> -	set_usb_led "$board:green:usb"
> +	set_wifi_led "$board:orange:wifi" "wlan0"
> +	set_usb_led "$board:green:usb" "1-1"
>  	;;
>  vocore)
>  	ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0"
> -	set_wifi_led "$board:green:status"
> +	set_wifi_led "$board:green:status" "wlan0"
>  	;;
>  w502u)
> -	set_usb_led "$board:blue:usb"
> -	set_wifi_led "rt2800pci-phy0::radio"
> +	set_usb_led "$board:blue:usb" "1-1"
> +	set_wifi_led "rt2800pci-phy0::radio" "wlan0"
>  	;;
>  wcr-150gn)
> -	set_usb_led "$board:amber:user"
> +	set_usb_led "$board:amber:user" "1-1"
>  	;;
>  whr-1166d|\
>  whr-300hp2|\
> @@ -285,10 +285,10 @@ whr-600d)
>  	ucidef_set_led_default "router" "router" "$board:green:router" "1"
>  	;;
>  wnce2001)
> -	set_wifi_led "$board:green:wlan"
> +	set_wifi_led "$board:green:wlan" "wlan0"
>  	;;
>  wrh-300cr)
> -	set_wifi_led "$board:green:wlan"
> +	set_wifi_led "$board:green:wlan" "wlan0"
>  	ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0"
>  	;;
>  wndr3700v5)
> @@ -300,8 +300,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"
> +	set_usb_led "$board:blue:usb" "1-1"
> +	set_wifi_led "$board:blue:wifi" "wlan0"
>  	;;
>  zbt-ape522ii)
>  	ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1"
> @@ -310,26 +310,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"
> +	set_wifi_led "$board:blue:air" "wlan0"
> +	set_usb_led "$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"
> +	set_wifi_led "$board:green:wifi" "wlan0"
> +	set_usb_led "$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"
> +	set_usb_led "$board:green:usb" "1-1"
> +	set_wifi_led "$board:green:wifi" "wlan0"
>  	;;
>  zte-q7)
> -	set_wifi_led "$board:blue:status"
> +	set_wifi_led "$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"
> +	set_wifi_led "$board:blue:air" "wlan0"
> +	set_usb_led "$board:blue:usb" "1-1"
>  	;;
>  esac
>  
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 



More information about the Lede-dev mailing list