aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-05-17 10:53:18 +0200
committerPetr Štetiar <ynezz@true.cz>2019-05-20 21:19:48 +0200
commitaac8b52184e727d8ba7a13917a9a3c8b82ec4aa2 (patch)
treeae7bb4a8f8578265660fbb8dab4f73b75b80ec97 /package/base-files/files/lib
parent2c26dc7b411e0b3d98bba2751b52878f5c89db5b (diff)
downloadupstream-aac8b52184e727d8ba7a13917a9a3c8b82ec4aa2.tar.gz
upstream-aac8b52184e727d8ba7a13917a9a3c8b82ec4aa2.tar.bz2
upstream-aac8b52184e727d8ba7a13917a9a3c8b82ec4aa2.zip
base-files: add support for the new ar8xxx MIB counters settings
Commit "generic: ar8216: add mib_poll_interval switch attribute" has added mib_poll_interval global config option and commit "generic: ar8216: group MIB counters and use two basic ones only by default" has added mib_type config option. So this patch adds ucidef_set_ar8xxx_switch_mib helper function which would allow configuration of the above mentioned new switch config options. Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'package/base-files/files/lib')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh13
1 files changed, 13 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 315df7b708..1d57de5a70 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -182,6 +182,19 @@ _ucidef_finish_switch_roles() {
done
}
+ucidef_set_ar8xxx_switch_mib() {
+ local name="$1"
+ local type="$2"
+ local interval="$3"
+
+ json_select_object switch
+ json_select_object "$name"
+ json_add_int ar8xxx_mib_type $type
+ json_add_int ar8xxx_mib_poll_interval $interval
+ json_select ..
+ json_select ..
+}
+
ucidef_add_switch() {
local name="$1"; shift
local port num role device index need_tag prev_role