diff options
author | Roland Barenbrug <roland@treslong.com> | 2022-08-10 20:46:02 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2022-10-30 23:14:45 +0100 |
commit | 5787e0c9fe0ae218f745ea5dcf30e20cc028842e (patch) | |
tree | 1bbd3079a5fa703dd0fa739e90a48177e09919a5 /package | |
parent | e6769d11f38f17fb4427f6022f61c4c2e1ee9d67 (diff) | |
download | upstream-5787e0c9fe0ae218f745ea5dcf30e20cc028842e.tar.gz upstream-5787e0c9fe0ae218f745ea5dcf30e20cc028842e.tar.bz2 upstream-5787e0c9fe0ae218f745ea5dcf30e20cc028842e.zip |
ltq-vdsl-vr9-app: skip invalid line status values
DSL_G997_LineStatusData_t defines special invalid values, skip these
metrics.
Signed-off-by: Roland Barenbrug <roland@treslong.com>
[split patch]
Signed-off-by: Andre Heider <a.heider@gmail.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c b/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c index 61ac7708ba..a45cb8ea0f 100644 --- a/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c +++ b/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c @@ -153,8 +153,9 @@ static inline void m_str(const char *id, const char *value) { blobmsg_add_string(&b, id, value); } -static inline void m_db(const char *id, int value) { - m_double(id, (double)value / 10); +static inline void m_db(const char *id, int value, int invalid) { + if (value != invalid) + m_double(id, (double)value / 10); } static inline void m_array(const char *id, const uint8_t *value, uint8_t len) { @@ -595,11 +596,12 @@ static void g997_channel_status(int fd, DSL_AccessDir_t direction) { static void g997_line_status(int fd, DSL_AccessDir_t direction) { IOCTL_DIR_DELT(DSL_G997_LineStatus_t, DSL_FIO_G997_LINE_STATUS_GET, direction, DSL_DELT_DATA_SHOWTIME); - m_db("latn", out.data.LATN); - m_db("satn", out.data.SATN); - m_db("snr", out.data.SNR); - m_db("actps", out.data.ACTPS); - m_db("actatp", out.data.ACTATP); + // invalid value indicators taken from drv_dsl_cpe_api_g997.h + m_db("latn", out.data.LATN, 1271); + m_db("satn", out.data.SATN, 1271); + m_db("snr", out.data.SNR, -641); + m_db("actps", out.data.ACTPS, -901); + m_db("actatp", out.data.ACTATP, -512); m_u32("attndr", out.data.ATTNDR); } |