Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/next68k/dev made debugging printfs switchable at ru...



details:   https://anonhg.NetBSD.org/src/rev/549137e440b1
branches:  trunk
changeset: 475881:549137e440b1
user:      dbj <dbj%NetBSD.org@localhost>
date:      Sun Aug 29 05:51:45 1999 +0000

description:
made debugging printfs switchable at run time via the "xe_debug" variable.

diffstat:

 sys/arch/next68k/dev/mb8795.c |  37 ++++++++++++++-----------------------
 1 files changed, 14 insertions(+), 23 deletions(-)

diffs (90 lines):

diff -r 1c63374bf5ab -r 549137e440b1 sys/arch/next68k/dev/mb8795.c
--- a/sys/arch/next68k/dev/mb8795.c     Sun Aug 29 04:21:55 1999 +0000
+++ b/sys/arch/next68k/dev/mb8795.c     Sun Aug 29 05:51:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mb8795.c,v 1.16 1999/08/28 09:19:05 dbj Exp $  */
+/*     $NetBSD: mb8795.c,v 1.17 1999/08/29 05:51:45 dbj Exp $  */
 /*
  * Copyright (c) 1998 Darrin B. Jewell
  * All rights reserved.
@@ -94,12 +94,13 @@
 #include "mb8795reg.h"
 #include "mb8795var.h"
 
-#if 0
+#if 1
 #define XE_DEBUG
 #endif
 
 #ifdef XE_DEBUG
-#define DPRINTF(x) printf x;
+int xe_debug = 0;
+#define DPRINTF(x) if (xe_debug) printf x;
 #else
 #define DPRINTF(x)
 #endif
@@ -278,8 +279,8 @@
        bus_space_write_1(sc->sc_bst,sc->sc_bsh, XE_RXSTAT, XE_RXSTAT_CLEAR);
 
 #if 0
-       DPRINTF(("%s: rx interrupt, rxstat = %b\n",
-                       sc->sc_dev.dv_xname, rxstat, XE_RXSTAT_BITS));
+       printf("%s: rx interrupt, rxstat = %b\n",
+                       sc->sc_dev.dv_xname, rxstat, XE_RXSTAT_BITS);
 #endif
 
        if (rxstat & XE_RXSTAT_RESET) {
@@ -380,17 +381,13 @@
        DPRINTF(("%s: rx interrupt, rxstat = %b\n",
                        sc->sc_dev.dv_xname, rxstat, XE_RXSTAT_BITS));
 
-#if 0 && defined(XE_DEBUG)
-       {
-               DPRINTF(("rxstat = 0x%b\n",
-                               bus_space_read_1(sc->sc_bst,sc->sc_bsh, XE_RXSTAT), XE_RXSTAT_BITS));
-               DPRINTF(("rxmask = 0x%b\n",
-                               bus_space_read_1(sc->sc_bst,sc->sc_bsh, XE_RXMASK), XE_RXMASK_BITS));
-               DPRINTF(("rxmode = 0x%b\n",
-                               bus_space_read_1(sc->sc_bst,sc->sc_bsh, XE_RXMODE), XE_RXMODE_BITS));
-       }
-#endif
-       
+       DPRINTF(("rxstat = 0x%b\n",
+                       bus_space_read_1(sc->sc_bst,sc->sc_bsh, XE_RXSTAT), XE_RXSTAT_BITS));
+       DPRINTF(("rxmask = 0x%b\n",
+                       bus_space_read_1(sc->sc_bst,sc->sc_bsh, XE_RXMASK), XE_RXMASK_BITS));
+       DPRINTF(("rxmode = 0x%b\n",
+                       bus_space_read_1(sc->sc_bst,sc->sc_bsh, XE_RXMODE), XE_RXMODE_BITS));
+
        return;
 }
 
@@ -402,7 +399,6 @@
      struct mb8795_softc *sc;
        
 {
-       int reset = 0;
        u_char txstat;
        u_char txmask;
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
@@ -433,11 +429,6 @@
                ifp->if_collisions += 16;
        }
 
-       if (reset) {
-               mb8795_reset(sc);
-               return;
-       }
-
 #if 0
        if (txstat & XE_TXSTAT_READY) {
 
@@ -1031,7 +1022,7 @@
        }
 #if (defined(DIAGNOSTIC))
        else {
-               printf("%s: out of receive DMA buffers\n",sc->sc_dev.dv_xname);
+               panic("%s: out of receive DMA buffers\n",sc->sc_dev.dv_xname);
        }
 #endif
 



Home | Main Index | Thread Index | Old Index