aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2018-09-22 00:38:40 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-09-29 17:23:11 +0200
commit641dc50164d30d4962499e1974fafde9b337faaf (patch)
treefe3527eecd51f1733f5054add1b68601a020fe03 /package/base-files/files/lib/functions
parentc417aee9f146f26cd12642138bc0cedf5950a59a (diff)
downloadupstream-641dc50164d30d4962499e1974fafde9b337faaf.tar.gz
upstream-641dc50164d30d4962499e1974fafde9b337faaf.tar.bz2
upstream-641dc50164d30d4962499e1974fafde9b337faaf.zip
base-files: make it possible to specify switch led mode
The swconfig switch led driver has the ability to switch between a "link, rx and/or tx" mode. However, this feature was not implemented in uci, the led init script and config_generate. This patch adds a seventh parameter to the ucidef_set_led_switch() function. The accepted values for this parameter are: link, rx and tx. Any permutations of these three values are supported, as long as they are properly encased with quotes. If the parameter is not specified it will default to "all" (link rx tx). Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'package/base-files/files/lib/functions')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 7fa328ac20..315df7b708 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -442,11 +442,13 @@ ucidef_set_led_switch() {
local trigger_name="$4"
local port_mask="$5"
local speed_mask="$6"
+ local mode="$7"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger "$trigger_name"
json_add_string type switch
+ json_add_string mode "$mode"
json_add_string port_mask "$port_mask"
json_add_string speed_mask "$speed_mask"
json_select ..