From 259fc1e77892ef8b7fb41c5bc118b55e31e0554b Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Wed, 14 Jun 2017 20:17:16 +0200 Subject: [PATCH] lantiq: show xdsl line init status on shared dsl/internet led On boards which don't have a distinct internet and dsl led, use the shared LED to indicate the xdsl line state and any traffic that is send/received via the netdev. This traffic doesn't necessarily need to be internet traffic. Rename the shared LED of existing configs to "dsl", to match the new defaults. The configuration of the to be renamed LED is identical with the new defaults. Signed-off-by: Mathias Kresin --- .../lantiq/base-files/etc/board.d/01_leds | 16 +++++------ .../etc/uci-defaults/01_led_migration | 27 +++++++++++++++++++ target/linux/lantiq/dts/ARV452CQW.dts | 2 +- target/linux/lantiq/dts/ARV7510PW22.dts | 2 +- target/linux/lantiq/dts/ARV7519RW22.dts | 2 +- target/linux/lantiq/dts/ARV752DPW.dts | 2 +- target/linux/lantiq/dts/ARV752DPW22.dts | 2 +- target/linux/lantiq/dts/ASL56026.dts | 2 +- target/linux/lantiq/dts/BTHOMEHUBV2B.dts | 2 +- target/linux/lantiq/dts/BTHOMEHUBV3A.dts | 2 +- target/linux/lantiq/dts/BTHOMEHUBV5A.dts | 2 +- target/linux/lantiq/dts/FRITZ7360SL.dts | 2 +- target/linux/lantiq/dts/VG3503J.dts | 2 +- 13 files changed, 46 insertions(+), 19 deletions(-) diff --git a/target/linux/lantiq/base-files/etc/board.d/01_leds b/target/linux/lantiq/base-files/etc/board.d/01_leds index b6461f9e9a..634f479789 100755 --- a/target/linux/lantiq/base-files/etc/board.d/01_leds +++ b/target/linux/lantiq/base-files/etc/board.d/01_leds @@ -18,18 +18,18 @@ led_usb="$(lantiq_get_dt_led usb)" led_usb2="$(lantiq_get_dt_led usb2)" [ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1" -led_internet="$(lantiq_get_dt_led internet)" -[ -n "$led_internet" ] && { +led_dsl="$(lantiq_get_dt_led dsl)" +[ -n "$led_dsl" ] && { interface="nas0" lantiq_is_vdsl_system && interface="ptm0" - led_dsl="$(lantiq_get_dt_led dsl)" - [ -n "$led_dsl" ] && { - interface="pppoe-wan" + led_internet="$(lantiq_get_dt_led internet)" + if [ -n "$led_internet" ]; then ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0" - } - - ucidef_set_led_netdev "internet" "internet" "$led_internet" "$interface" + ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan" + else + ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "$interface" + fi } board=$(board_name) diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration index 130694a62b..6ff4355853 100644 --- a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration +++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration @@ -35,6 +35,20 @@ do_led_update_sysfs() done; } +do_internet_led_rename() +{ + config_load system + + [ -n $(config_get led_internet name) ] || return + [ -z $(config_get led_dsl name) ] || return + + uci rename system.led_internet=led_dsl + uci set system.led_dsl.name=dsl + + LED_OPTIONS_CHANGED=1 + logger -t led-migration "internet led renamed to dsl" +} + migrate_leds() { config_load system @@ -42,6 +56,19 @@ migrate_leds() } case "$(board_name)" in +ARV452CQW|\ +ARV7510PW22|\ +ARV7519RW22|\ +ARV752DPW|\ +ARV752DPW22|\ +ASL56026|\ +BTHOMEHUBV2B|\ +BTHOMEHUBV3A|\ +BTHOMEHUBV5A|\ +FRTZ7360SL|\ +VG3503J) + do_internet_led_rename + ;; DGN3500*) migrate_leds "dgn3500:blue:wireless=dgn3500:green:wireless" ;; diff --git a/target/linux/lantiq/dts/ARV452CQW.dts b/target/linux/lantiq/dts/ARV452CQW.dts index 6bc0796f9e..e43bab3dd1 100644 --- a/target/linux/lantiq/dts/ARV452CQW.dts +++ b/target/linux/lantiq/dts/ARV452CQW.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_blue; - led-internet = &dsl_blue; + led-dsl = &dsl_blue; led-usb = &usb; led-wifi = &wifi; }; diff --git a/target/linux/lantiq/dts/ARV7510PW22.dts b/target/linux/lantiq/dts/ARV7510PW22.dts index 53ff3b7e94..6bad4e3e71 100644 --- a/target/linux/lantiq/dts/ARV7510PW22.dts +++ b/target/linux/lantiq/dts/ARV7510PW22.dts @@ -16,7 +16,7 @@ led-failsafe = &power; led-running = &power; - led-internet = &internet; + led-dsl = &internet; led-usb = &umts; led-wifi = &wlan; }; diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts b/target/linux/lantiq/dts/ARV7519RW22.dts index 14be6f2ca7..36017b5d51 100644 --- a/target/linux/lantiq/dts/ARV7519RW22.dts +++ b/target/linux/lantiq/dts/ARV7519RW22.dts @@ -16,7 +16,7 @@ led-failsafe = &power_green; led-running = &power_green; - led-internet = &internet_green; + led-dsl = &internet_green; }; memory@0 { diff --git a/target/linux/lantiq/dts/ARV752DPW.dts b/target/linux/lantiq/dts/ARV752DPW.dts index b68a17cd1b..5069d0d748 100644 --- a/target/linux/lantiq/dts/ARV752DPW.dts +++ b/target/linux/lantiq/dts/ARV752DPW.dts @@ -16,7 +16,7 @@ led-failsafe = &power_blue; led-running = &power_red; - led-internet = &internet_red; + led-dsl = &internet_red; led-usb = &umts; led-wifi = &wifi; }; diff --git a/target/linux/lantiq/dts/ARV752DPW22.dts b/target/linux/lantiq/dts/ARV752DPW22.dts index 225dfaaaac..d5a6d3184a 100644 --- a/target/linux/lantiq/dts/ARV752DPW22.dts +++ b/target/linux/lantiq/dts/ARV752DPW22.dts @@ -16,7 +16,7 @@ led-failsafe = &power_blue; led-running = &power_red; - led-internet = &internet_red; + led-dsl = &internet_red; led-usb = &umts; led-wifi = &wifi; }; diff --git a/target/linux/lantiq/dts/ASL56026.dts b/target/linux/lantiq/dts/ASL56026.dts index 735e6bc2bf..e2990e4519 100644 --- a/target/linux/lantiq/dts/ASL56026.dts +++ b/target/linux/lantiq/dts/ASL56026.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_green; - led-internet = &dsl; + led-dsl = &dsl; }; memory@0 { diff --git a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts index 751368bc74..87b4dfbd4a 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_blue; - led-internet = &broadband_blue; + led-dsl = &broadband_blue; led-wifi = &wireless_blue; }; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts index a909632022..ca9020bf73 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_blue; - led-internet = &broadband_blue; + led-dsl = &broadband_blue; led-wifi = &wireless_blue; }; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts index 59b6cee9b8..a33690cef6 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_blue; - led-internet = &broadband_blue; + led-dsl = &broadband_blue; led-wifi = &wireless_blue; }; diff --git a/target/linux/lantiq/dts/FRITZ7360SL.dts b/target/linux/lantiq/dts/FRITZ7360SL.dts index 31a9527b79..496fe2e96d 100644 --- a/target/linux/lantiq/dts/FRITZ7360SL.dts +++ b/target/linux/lantiq/dts/FRITZ7360SL.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_green; - led-internet = &info_green; + led-dsl = &info_green; led-wifi = &wifi; }; diff --git a/target/linux/lantiq/dts/VG3503J.dts b/target/linux/lantiq/dts/VG3503J.dts index d2a6136d4f..99fe486dc6 100644 --- a/target/linux/lantiq/dts/VG3503J.dts +++ b/target/linux/lantiq/dts/VG3503J.dts @@ -16,7 +16,7 @@ led-failsafe = &power_red; led-running = &power_green; - led-internet = &dsl; + led-dsl = &dsl; }; memory@0 { -- 2.25.1