#
# Copyright (C) 2011-2015 OpenWrt.org
#

. /lib/functions/leds.sh
. /lib/functions/uci-defaults.sh

board_config_update

led_wifi="$(get_dt_led wifi)"
[ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt"

led_dsl="$(get_dt_led dsl)"
[ -n "$led_dsl" ] && {
	led_internet="$(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" "pppoe-wan"
	else
		ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0"
	fi
}

board=$(board_name)

case "$board" in
arcadyan,vg3503j)
	ucidef_set_led_netdev "lan1" "LAN1" "mdio-bus:13:amber:lan" "lan1" "rx tx"
	ucidef_set_led_netdev "lan1" "LAN1" "mdio-bus:13:green:lan" "lan1" "link"
	ucidef_set_led_netdev "lan2" "LAN2" "mdio-bus:11:amber:lan" "lan2" "rx tx"
	ucidef_set_led_netdev "lan2" "LAN2" "mdio-bus:11:green:lan" "lan2" "link"
	;;
netgear,dm200)
	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
	;;
esac

board_config_flush

exit 0
