summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-04-27 14:48:10 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-04-27 14:48:10 +0000
commit48dd8164fb3f63b6090acc7d747e953f6ba90deb (patch)
tree87de2789300320afe0425bed6bedfcd773792921
parent48447e8aeb505229ae7b3d42e2fecc56e6658a17 (diff)
add NX_DEBUG macros
-rw-r--r--sys/dev/pci/if_nx.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/pci/if_nx.c b/sys/dev/pci/if_nx.c
index ec104a7ea9e..2147fbeca86 100644
--- a/sys/dev/pci/if_nx.c
+++ b/sys/dev/pci/if_nx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nx.c,v 1.6 2007/04/26 18:24:33 reyk Exp $ */
+/* $OpenBSD: if_nx.c,v 1.7 2007/04/27 14:48:09 reyk Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -62,6 +62,22 @@
#include <dev/pci/if_nxreg.h>
+#ifdef NX_DEBUG
+int nx_debug = 0;
+#define DPRINTF(_arg...) do { \
+ if (nx_debug) \
+ printf(_arg); \
+} while (0)
+#define DPRINTREG(_reg) do { \
+ if (nx_debug) \
+ printf("%s: %08x: %08x\n", \
+ #_reg, _reg, nxb_read(sc, _reg)); \
+} while (0)
+#else
+#define DPRINTREG(_reg)
+#define DPRINTF(arg...)
+#endif
+
struct nx_softc;
struct nxb_port {