Module Name:    src
Committed By:   khorben
Date:           Thu Mar 19 07:49:29 UTC 2020

Modified Files:
        src/sys/dev/usb: if_umb.c

Log Message:
When there is no network around the state timeout fires over and over again.
Change the printf into a log and only under IFF_DEBUG to reduce dmesg spam.
Loudly requested by beck@ OK deraadt@

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/if_umb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.14 src/sys/dev/usb/if_umb.c:1.15
--- src/sys/dev/usb/if_umb.c:1.14	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:49:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.14 2020/03/14 02:35:33 christos Exp $ */
+/*	$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.14 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -948,9 +948,12 @@ Static void
 umb_statechg_timeout(void *arg)
 {
 	struct umb_softc *sc = arg;
+	struct ifnet *ifp = GET_IFP(sc);
 
 	if (sc->sc_info.regstate != MBIM_REGSTATE_ROAMING || sc->sc_roaming)
-		printf("%s: state change timeout\n",DEVNAM(sc));
+		if (ifp->if_flags & IFF_DEBUG)
+			log(LOG_DEBUG, "%s: state change timeout\n",
+			    DEVNAM(sc));
 	usb_add_task(sc->sc_udev, &sc->sc_umb_task, USB_TASKQ_DRIVER);
 }
 

Reply via email to