lantiq: show xdsl line init status on shared dsl/internet led
authorMathias Kresin <dev@kresin.me>
Wed, 14 Jun 2017 18:17:16 +0000 (20:17 +0200)
committerMathias Kresin <dev@kresin.me>
Sat, 17 Jun 2017 13:38:18 +0000 (15:38 +0200)
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 <dev@kresin.me>
13 files changed:
target/linux/lantiq/base-files/etc/board.d/01_leds
target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration
target/linux/lantiq/dts/ARV452CQW.dts
target/linux/lantiq/dts/ARV7510PW22.dts
target/linux/lantiq/dts/ARV7519RW22.dts
target/linux/lantiq/dts/ARV752DPW.dts
target/linux/lantiq/dts/ARV752DPW22.dts
target/linux/lantiq/dts/ASL56026.dts
target/linux/lantiq/dts/BTHOMEHUBV2B.dts
target/linux/lantiq/dts/BTHOMEHUBV3A.dts
target/linux/lantiq/dts/BTHOMEHUBV5A.dts
target/linux/lantiq/dts/FRITZ7360SL.dts
target/linux/lantiq/dts/VG3503J.dts

index b6461f9e9a24ab3a9b74e72c5a5b2d00a2664339..634f4797894ba96e9d74be36eedff559816fa0d7 100755 (executable)
@@ -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)
index 130694a62b2c60a5a320abcd5477a024b5ba9937..6ff4355853e2a7037630428f9554076e1bfd12cf 100644 (file)
@@ -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"
        ;;
index 6bc0796f9e76f3794f3ccedd0bbef0705a769195..e43bab3dd1ab31f8bb53d69ab40ee577f2da8dc9 100644 (file)
@@ -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;
        };
index 53ff3b7e945b52a1035ac17fa73caa3cdd53452a..6bad4e3e71cd6ba17e60079277e176d7ad77fe68 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power;
                led-running = &power;
 
-               led-internet = &internet;
+               led-dsl = &internet;
                led-usb = &umts;
                led-wifi = &wlan;
        };
index 14be6f2ca713c68a1d2737b0b3baec5c1bf1091b..36017b5d517fc41bc25f86bf90d172cb39b7e169 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_green;
                led-running = &power_green;
 
-               led-internet = &internet_green;
+               led-dsl = &internet_green;
        };
 
        memory@0 {
index b68a17cd1b187f69356acf2a04911ffdfc5a15c5..5069d0d748c16fa92bd9b4c8d84a4ce53cef01cd 100644 (file)
@@ -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;
        };
index 225dfaaaacc3223d581356b452e97fb4581acb71..d5a6d3184a70ea1d6f60dd18658e0d0cc73aa3f9 100644 (file)
@@ -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;
        };
index 735e6bc2bfa316df7012110402bd229b7d356daa..e2990e4519a1f2dd34d315c20967ce73d7273d25 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_red;
                led-running = &power_green;
 
-               led-internet = &dsl;
+               led-dsl = &dsl;
        };
 
        memory@0 {
index 751368bc74e3a2ca0d802be96d5a122799e236fa..87b4dfbd4af8861891aa5283825ced54c05a2162 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_red;
                led-running = &power_blue;
 
-               led-internet = &broadband_blue;
+               led-dsl = &broadband_blue;
                led-wifi = &wireless_blue;
        };
 
index a9096320228fd729aded93f788f11a79eb1c97ec..ca9020bf7331be872b85d6d7a84be1d740496956 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_red;
                led-running = &power_blue;
 
-               led-internet = &broadband_blue;
+               led-dsl = &broadband_blue;
                led-wifi = &wireless_blue;
        };
 
index 59b6cee9b80874a7656e1def1034d0a3f355cf39..a33690cef6a2d8490312e70b409e03d4ee1cc550 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_red;
                led-running = &power_blue;
 
-               led-internet = &broadband_blue;
+               led-dsl = &broadband_blue;
                led-wifi = &wireless_blue;
        };
 
index 31a9527b796b7c4c39bdd93aad066655c2382a33..496fe2e96d4ab1dd52beee2199d50897b33842df 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_red;
                led-running = &power_green;
 
-               led-internet = &info_green;
+               led-dsl = &info_green;
                led-wifi = &wifi;
        };
 
index d2a6136d4fdf7c3925f2c4cca26cb84b3826283f..99fe486dc66124bb727012617d7aa445119d090c 100644 (file)
@@ -16,7 +16,7 @@
                led-failsafe = &power_red;
                led-running = &power_green;
 
-               led-internet = &dsl;
+               led-dsl = &dsl;
        };
 
        memory@0 {