openwrtv4/target/linux/apm821xx/base-files/etc/board.d/01_leds
Christian Lamparter b5638bb64e apm821xx: redo WAN green and yellow LEDs
Because the WAN port is handled by the internal AR8327N switch, the
device should use swconfig_leds trigger to handle the link activity
of the WAN LED. This has the added bonus that the WAN LED will now
go dark if there's no ethernet cable connected to the WAN port.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2016-11-08 11:17:10 +01:00

38 lines
1 KiB
Bash
Executable file

#!/bin/sh
. /lib/functions/uci-defaults.sh
. /lib/apm821xx.sh
board_config_update
board=$(apm821xx_board_name)
case "$board" in
mr24)
ucidef_set_led_netdev "wan" "WAN" "mr24:green:wan" "eth0"
ucidef_set_led_wlan "wlan1" "WLAN1" "mr24:green:wifi1" "phy0assoc"
ucidef_set_led_wlan "wlan2" "WLAN2" "mr24:green:wifi2" "phy0assoc"
ucidef_set_led_wlan "wlan3" "WLAN3" "mr24:green:wifi3" "phy0assoc"
ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt"
;;
mbl)
ucidef_set_led_ide "sata" "SATA" "mbl:blue:power"
;;
wndr4700)
ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd"
ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20"
ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx"
ucidef_set_led_usbport "usb3" "USB3" "wndr4700:blue:usb" "usb2-port1" "usb2-port2" "usb3-port1" "usb3-port2"
ucidef_set_led_wlan "wlan2g" "WLAN2G" "wndr4700:blue:wlan" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "wndr4700:blue:wlan" "phy1tpt"
;;
*)
;;
esac
board_config_flush
exit 0