summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2008-06-13 04:27:09 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2008-06-13 04:27:09 +0000
commit69347af79ede54346cfae7b8abfe8bf6409ec110 (patch)
tree2cc7532eddd234d24ae5133c2751cb5e94769597 /sys/scsi/scsi_base.c
parent749817b1d5a135d2f0d1642726f23b9be56241c9 (diff)
Merge show_scsi_xs() and show_scsi_cmd() and move invocation so the
debug output shows the xs/command before it's issued rather than displaying it on command completion. Some commands don't come back and it would be nice to see their details. While here nuke invocations of scsi_show* in umass. If you want SCSI debug output use SCSI debug options. Only affects SCSI debug output. ok marco@
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index e95064c63d9..849fad9463f 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.124 2007/11/25 22:28:53 dlg Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.125 2008/06/13 04:27:08 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -214,6 +214,11 @@ scsi_make_xs(struct scsi_link *sc_link, struct scsi_generic *scsi_cmd,
xs->cmd->bytes[0] |= ((sc_link->lun << SCSI_CMD_LUN_SHIFT) &
SCSI_CMD_LUN_MASK);
+#ifdef SCSIDEBUG
+ if ((sc_link->flags & SDEV_DB1) != 0)
+ show_scsi_xs(xs);
+#endif /* SCSIDEBUG */
+
return (xs);
}
@@ -687,10 +692,6 @@ scsi_done(struct scsi_xfer *xs)
splassert(IPL_BIO);
SC_DEBUG(sc_link, SDEV_DB2, ("scsi_done\n"));
-#ifdef SCSIDEBUG
- if ((sc_link->flags & SDEV_DB1) != 0)
- show_scsi_cmd(xs);
-#endif /* SCSIDEBUG */
/*
* If it's a user level request, bypass all usual completion processing,
@@ -1916,7 +1917,13 @@ scsi_decode_sense(struct scsi_sense_data *sense, int flag)
void
show_scsi_xs(struct scsi_xfer *xs)
{
+ u_char *b = (u_char *) xs->cmd;
+ int i = 0;
+
+ sc_print_addr(xs->sc_link);
+
printf("xs(%p): ", xs);
+
printf("flg(0x%x)", xs->flags);
printf("sc_link(%p)", xs->sc_link);
printf("retr(0x%x)", xs->retries);
@@ -1927,17 +1934,8 @@ show_scsi_xs(struct scsi_xfer *xs)
printf("len(0x%x)", xs->datalen);
printf("res(0x%x)", xs->resid);
printf("err(0x%x)", xs->error);
- printf("bp(%p)", xs->bp);
- show_scsi_cmd(xs);
-}
+ printf("bp(%p)\n", xs->bp);
-void
-show_scsi_cmd(struct scsi_xfer *xs)
-{
- u_char *b = (u_char *) xs->cmd;
- int i = 0;
-
- sc_print_addr(xs->sc_link);
printf("command: ");
if ((xs->flags & SCSI_RESET) == 0) {