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 <dev@kresin.me>
This commit is contained in:
Mathias Kresin 2017-06-14 20:17:16 +02:00
parent 03776d813c
commit 259fc1e778
13 changed files with 46 additions and 19 deletions

View file

@ -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)

View 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"
;;

View 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;
};

View file

@ -16,7 +16,7 @@
led-failsafe = &power;
led-running = &power;
led-internet = &internet;
led-dsl = &internet;
led-usb = &umts;
led-wifi = &wlan;
};

View file

@ -16,7 +16,7 @@
led-failsafe = &power_green;
led-running = &power_green;
led-internet = &internet_green;
led-dsl = &internet_green;
};
memory@0 {

View 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;
};

View 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;
};

View file

@ -16,7 +16,7 @@
led-failsafe = &power_red;
led-running = &power_green;
led-internet = &dsl;
led-dsl = &dsl;
};
memory@0 {

View 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;
};

View 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;
};

View 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;
};

View file

@ -16,7 +16,7 @@
led-failsafe = &power_red;
led-running = &power_green;
led-internet = &info_green;
led-dsl = &info_green;
led-wifi = &wifi;
};

View file

@ -16,7 +16,7 @@
led-failsafe = &power_red;
led-running = &power_green;
led-internet = &dsl;
led-dsl = &dsl;
};
memory@0 {