diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-11-28 13:20:38 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-11-28 13:20:38 +0000 |
commit | 1f147e6ea07ae37a64709a94b8cb857f795fdf0a (patch) | |
tree | 4f5058b9e77d723fb6337c4b94b2a7056c72c2ec /sys/scsi | |
parent | 7de436700562d3b13efcd70e4596195f85809d3c (diff) |
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.
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/scsi_debug.h | 20 | ||||
-rw-r--r-- | sys/scsi/scsiconf.c | 11 |
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, |