From bbd71b0baa98a511d73c15fbbb68f63124a9960f Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 8 Jan 2018 17:29:21 +0000 Subject: [PATCH] Guard the debug printf function behind BWFM_DEBUG as well. Also only print the firmware's dmesg(8) if we're running with a higher debug mode. Prompted by Michael W. Bombardieri --- sys/dev/pci/if_bwfm_pci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index 62da92c20a7..c22098c9a73 100644 --- a/sys/dev/pci/if_bwfm_pci.c +++ b/sys/dev/pci/if_bwfm_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_pci.c,v 1.8 2018/01/08 00:46:15 patrick Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.9 2018/01/08 17:29:21 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -255,7 +255,10 @@ void bwfm_pci_flowring_delete(struct bwfm_pci_softc *, int); void bwfm_pci_stop(struct bwfm_softc *); int bwfm_pci_txdata(struct bwfm_softc *, struct mbuf *); + +#ifdef BWFM_DEBUG void bwfm_pci_debug_console(struct bwfm_pci_softc *); +#endif int bwfm_pci_msgbuf_query_dcmd(struct bwfm_softc *, int, int, char *, size_t *); @@ -1666,6 +1669,7 @@ bwfm_pci_txdata(struct bwfm_softc *bwfm, struct mbuf *m) return 0; } +#ifdef BWFM_DEBUG void bwfm_pci_debug_console(struct bwfm_pci_softc *sc) { @@ -1673,7 +1677,7 @@ bwfm_pci_debug_console(struct bwfm_pci_softc *sc) sc->sc_console_base_addr + BWFM_CONSOLE_WRITEIDX); if (newidx != sc->sc_console_readidx) - printf("BWFM CONSOLE: "); + DPRINTFN(3, ("BWFM CONSOLE: ")); while (newidx != sc->sc_console_readidx) { uint8_t ch = bus_space_read_1(sc->sc_tcm_iot, sc->sc_tcm_ioh, sc->sc_console_buf_addr + sc->sc_console_readidx); @@ -1682,9 +1686,10 @@ bwfm_pci_debug_console(struct bwfm_pci_softc *sc) sc->sc_console_readidx = 0; if (ch == '\r') continue; - printf("%c", ch); + DPRINTFN(3, ("%c", ch)); } } +#endif int bwfm_pci_intr(void *v) -- 2.20.1