summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-05-29 16:39:21 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-05-29 16:39:21 +0000
commit014e1ffa51093227502859b39ceea0e296862886 (patch)
treec29bf1d74335da2f9f1d17ea884807f140a908f9 /target/linux/lantiq/base-files
parent09f48c381bee1e5f921ee52c35dc8cac77002ac4 (diff)
lantiq: use the generic uci-default functions for initial LED setup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31995 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq/base-files')
-rwxr-xr-xtarget/linux/lantiq/base-files/etc/uci-defaults/leds125
1 files changed, 26 insertions, 99 deletions
diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/leds b/target/linux/lantiq/base-files/etc/uci-defaults/leds
index 2a7db4c1a..64b080f33 100755
--- a/target/linux/lantiq/base-files/etc/uci-defaults/leds
+++ b/target/linux/lantiq/base-files/etc/uci-defaults/leds
@@ -4,128 +4,55 @@
# based on ar71xx
#
-COMMIT_SYSTEM=0
-
-set_led_netdev() {
- local cfg="led_$1"
- local name=$2
- local sysfs=$3
- local dev=$4
-
- uci -q get system.$cfg && return 0
-
- uci batch <<EOF
-set system.$cfg='led'
-set system.$cfg.name='$name'
-set system.$cfg.sysfs='$sysfs'
-set system.$cfg.trigger='netdev'
-set system.$cfg.dev='$dev'
-set system.$cfg.mode='link tx rx'
-EOF
- COMMIT_SYSTEM=1
-}
-
-set_led_usbdev() {
- local cfg="led_$1"
- local name=$2
- local sysfs=$3
- local dev=$4
-
- uci -q get system.$cfg && return 0
-
- uci batch <<EOF
-set system.$cfg='led'
-set system.$cfg.name='$name'
-set system.$cfg.sysfs='$sysfs'
-set system.$cfg.trigger='usbdev'
-set system.$cfg.dev='$dev'
-set system.$cfg.interval='50'
-EOF
- COMMIT_SYSTEM=1
-}
-
-set_led_wlan() {
- local cfg="led_$1"
- local name=$2
- local sysfs=$3
- local trigger=$4
-
- uci -q get system.$cfg && return 0
-
- uci batch <<EOF
-set system.$cfg='led'
-set system.$cfg.name='$name'
-set system.$cfg.sysfs='$sysfs'
-set system.$cfg.trigger='$trigger'
-EOF
- COMMIT_SYSTEM=1
-}
-
-set_led_default() {
- local cfg="led_$1"
- local name=$2
- local sysfs=$3
- local default=$4
-
- uci -q get system.$cfg && return 0
-
- uci batch <<EOF
-set system.$cfg='led'
-set system.$cfg.name='$name'
-set system.$cfg.sysfs='$sysfs'
-set system.$cfg.default='$default'
-EOF
- COMMIT_SYSTEM=1
-}
-
+. /lib/functions/uci-defaults.sh
. /lib/lantiq.sh
board=$(lantiq_board_name)
case "$board" in
ARV4520PW|ARV452CPW)
- set_led_netdev "wifi" "wifi" "soc:blue:wifi" "wlan0"
- set_led_usbdev "usb" "USB" "soc:blue:usb" "1-1"
- set_led_default "fxs1" "fxs1" "soc:blue:fxs1" "1"
- set_led_default "fxs2" "fxs2" "soc:blue:fxs2" "1"
- set_led_default "online" "online" "soc:blue:internet" "1"
+ ucidef_set_led_netdev "wifi" "wifi" "soc:blue:wifi" "wlan0"
+ ucidef_set_led_usbdev "usb" "USB" "soc:blue:usb" "1-1"
+ ucidef_set_led_default "fxs1" "fxs1" "soc:blue:fxs1" "1"
+ ucidef_set_led_default "fxs2" "fxs2" "soc:blue:fxs2" "1"
+ ucidef_set_led_default "online" "online" "soc:blue:internet" "1"
;;
ARV7525PW)
- set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
- set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
- set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
- set_led_default "dsl" "dsl" "soc:red:dsl" "1"
- set_led_default "online" "online" "soc:green:online" "1"
+ ucidef_set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
+ ucidef_set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
+ ucidef_set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
+ ucidef_set_led_default "dsl" "dsl" "soc:red:dsl" "1"
+ ucidef_set_led_default "online" "online" "soc:green:online" "1"
;;
ARV4525PW)
- set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
- set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
- set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
- set_led_default "dsl" "dsl" "soc:green:dsl" "1"
- set_led_default "online" "online" "soc:green:online" "1"
+ ucidef_set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
+ ucidef_set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
+ ucidef_set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
+ ucidef_set_led_default "dsl" "dsl" "soc:green:dsl" "1"
+ ucidef_set_led_default "online" "online" "soc:green:online" "1"
;;
GIGASX76X)
- set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
- set_led_netdev "online" "online" "soc:green:online" "pppoe-wan"
- set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
+ ucidef_set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
+ ucidef_set_led_netdev "online" "online" "soc:green:online" "pppoe-wan"
+ ucidef_set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
;;
ARV4519PW)
- set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
- set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
- set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
+ ucidef_set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
+ ucidef_set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
+ ucidef_set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
;;
ARV7518PW)
- set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
- set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
- set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
+ ucidef_set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
+ ucidef_set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
+ ucidef_set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
;;
esac
-[ "$COMMIT_SYSTEM" == "1" ] && uci commit system
+ucidef_commit_leds
exit 0