summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniklas <niklas@openbsd.org>1996-11-28 13:20:36 +0000
committerniklas <niklas@openbsd.org>1996-11-28 13:20:36 +0000
commit38aaa40ed73a624cf6571219ced404dcff1287a7 (patch)
treebf3342bbd07cc2f1aa1c4867212ff6106d20532c
parentSync to NetBSD 961107 (diff)
downloadwireguard-openbsd-38aaa40ed73a624cf6571219ced404dcff1287a7.tar.xz
wireguard-openbsd-38aaa40ed73a624cf6571219ced404dcff1287a7.zip
Make SCSI debugging more dynamic, more targets and luns can be
debugged simultaneously and which ones, as well as the verbosity, can be determined at runtime.
-rw-r--r--sys/scsi/scsi_debug.h20
-rw-r--r--sys/scsi/scsiconf.c11
2 files changed, 22 insertions, 9 deletions
diff --git a/sys/scsi/scsi_debug.h b/sys/scsi/scsi_debug.h
index 3252e364a2b..b190adedd81 100644
--- a/sys/scsi/scsi_debug.h
+++ b/sys/scsi/scsi_debug.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_debug.h,v 1.3 1996/10/31 01:09:22 niklas Exp $ */
+/* $OpenBSD: scsi_debug.h,v 1.4 1996/11/28 13:20:36 niklas Exp $ */
/* $NetBSD: scsi_debug.h,v 1.5 1994/12/28 19:43:00 mycroft Exp $ */
/*
@@ -17,11 +17,19 @@
#define SDEV_DB3 0x0040 /* internal to routine flows */
#define SDEV_DB4 0x0080 /* level 4 debugging for this dev */
-/* target and LUN we want to debug */
-#define DEBUGTARGET -1 /* -1 = disable */
-#define DEBUGLUN 0
-#define DEBUGLEVEL (SDEV_DB1|SDEV_DB2)
-
+/* targets and LUNs we want to debug */
+#ifndef SCSIDEBUG_TARGETS
+#define SCSIDEBUG_TARGETS 0
+#endif
+#ifndef SCSIDEBUG_LUNS
+#define SCSIDEBUG_LUNS 0
+#endif
+#ifndef SCSIDEBUG_LEVEL
+#define SCSIDEBUG_LEVEL (SDEV_DB1|SDEV_DB2)
+#endif
+
+extern int scsidebug_targets, scsidebug_luns, scsidebug_level;
+
/*
* This is the usual debug macro for use with the above bits
*/
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 338bfc5efc0..1a50875ccc7 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.18 1996/11/25 04:49:23 millert Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.19 1996/11/28 13:20:37 niklas Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -96,6 +96,10 @@ struct cfdriver scsibus_cd = {
NULL, "scsibus", DV_DULL
};
+int scsidebug_targets = SCSIDEBUG_TARGETS;
+int scsidebug_luns = SCSIDEBUG_LUNS;
+int scsidebug_level = SCSIDEBUG_LEVEL;
+
int scsibusprint __P((void *, const char *));
int
@@ -533,8 +537,9 @@ scsi_probedev(scsi, target, lun)
* Ask the device what it is
*/
#ifdef SCSIDEBUG
- if (target == DEBUGTARGET && lun == DEBUGLUN)
- sc_link->flags |= DEBUGLEVEL;
+ if (((1 << target) & scsidebug_targets) &&
+ ((1 << lun) & scsidebug_luns))
+ sc_link->flags |= scsidebug_level;
#endif /* SCSIDEBUG */
(void) scsi_test_unit_ready(sc_link,