From a077d710c2f5440af9dfa06e50044422447386f8 Mon Sep 17 00:00:00 2001 From: dlg Date: Tue, 29 Aug 2023 23:28:38 +0000 Subject: [PATCH] fix handling of unknown error rate in mbim signal state info from gerhard@: > According to MBIM spec, table 10-58 (MBIM_SIGNAL_STATE_INFO) a value > of 99 means the error rate is "Unknown or undetectable". the code was using -99 before, but properly reports unknown/null now. --- sys/dev/usb/if_umb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/if_umb.c b/sys/dev/usb/if_umb.c index fb8df89ea62..3df4ad88e97 100644 --- a/sys/dev/usb/if_umb.c +++ b/sys/dev/usb/if_umb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_umb.c,v 1.53 2023/08/29 23:26:40 dlg Exp $ */ +/* $OpenBSD: if_umb.c,v 1.54 2023/08/29 23:28:38 dlg Exp $ */ /* * Copyright (c) 2016 genua mbH @@ -1710,7 +1710,7 @@ umb_decode_signal_state(struct umb_softc *sc, void *data, int len) } sc->sc_info.rssi = rssi; sc->sc_info.ber = letoh32(ss->err_rate); - if (sc->sc_info.ber == -99) + if (sc->sc_info.ber == 99) sc->sc_info.ber = UMB_VALUE_UNKNOWN; #if NKSTAT > 0 -- 2.20.1