This second patch fixes the DSL sync light so that it's not tied to
PPPoE, which is intended to be the "Internet" light. It also adds the
kernel config option already used by the LED control in uci-defaults.
Lastly, it provides a boot LED sequence suitable for devices with both
red and green LEDs for power.

Signed-off-by: Daniel Gimpelevich <[email protected]>
Index: target/linux/lantiq/xway/config-default
===================================================================
--- target/linux/lantiq/xway/config-default     (revision 36698)
+++ target/linux/lantiq/xway/config-default     (working copy)
@@ -6,6 +6,7 @@
 CONFIG_INPUT_POLLDEV=y
 # CONFIG_ISDN is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_USBDEV=y
 CONFIG_M25PXX_USE_FAST_READ=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
Index: target/linux/lantiq/base-files/etc/uci-defaults/01_leds
===================================================================
--- target/linux/lantiq/base-files/etc/uci-defaults/01_leds     (revision 36698)
+++ target/linux/lantiq/base-files/etc/uci-defaults/01_leds     (working copy)
@@ -9,7 +9,7 @@
 
 [ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" 
"phy0tpt"
 [ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1"
-[ -e "/sys/class/leds/dsl" ] &&        ucidef_set_led_netdev "dsl" "dsl" "dsl" 
"pppoe-wan"
+[ -e "/sys/class/leds/internet" ] &&   ucidef_set_led_netdev "internet" 
"internet" "internet" "pppoe-wan"
 
 for a in `ls /sys/class/leds/`; do
        grep -q "\[none\]" /sys/class/leds/$a/trigger
Index: target/linux/lantiq/base-files/etc/diag.sh
===================================================================
--- target/linux/lantiq/base-files/etc/diag.sh  (revision 36698)
+++ target/linux/lantiq/base-files/etc/diag.sh  (working copy)
@@ -6,6 +6,27 @@
 status_led="power"
 
 set_state() {
+       [ -d /sys/class/leds/power2/ ] && {
+
+               case "$1" in
+               preinit)
+                       led_set_attr "power2" "trigger" "heartbeat"
+                       ;;
+               init)
+                       status_led_on
+                       ;;
+               failsafe)
+                       led_off "power2"
+                       status_led_set_timer 100 100
+                       ;;
+               done)
+                       status_led_on
+                       led_off "power2"
+                       ;;
+               esac
+               return
+       }
+
        case "$1" in
        preinit)
                status_led_set_heartbeat



_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to