summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2003-04-08 18:03:47 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2003-04-08 18:03:47 +0000
commit13b4b54524bdc9b77efbbb7815a5800a0831456b (patch)
tree50c47dea2e780b59ece4b29d57e4cd817696dcf7 /sys
parentee4f18335f419fcec1bbe842f2339b83417032ce (diff)
Fix diagnostic output to display data buffer actually being used.
Fix setting of data buffer length when doing auto request sense. Add a little general paranoia about setting data buffer length. Eliminate $ifdef'ed field in acb structure, leaving diagnostic code using it #ifdef'ed. Mostly suggested by and ok mickey@.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/osiop.c16
-rw-r--r--sys/dev/ic/osiopvar.h4
2 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c
index 437dcc69607..833a9d5ab7d 100644
--- a/sys/dev/ic/osiop.c
+++ b/sys/dev/ic/osiop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osiop.c,v 1.4 2003/04/06 20:24:31 krw Exp $ */
+/* $OpenBSD: osiop.c,v 1.5 2003/04/08 18:03:46 krw Exp $ */
/* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */
/*
@@ -423,10 +423,14 @@ osiop_scsicmd(xs)
acb->xsflags = xs->flags;
bcopy(xs->cmd, &acb->ds->scsi_cmd, xs->cmdlen);
acb->ds->cmd.count = xs->cmdlen;
- acb->datalen = xs->datalen;
+ acb->datalen = 0;
+#ifdef OSIOP_DEBUG
+ acb->data = xs->data;
+#endif
/* Setup DMA map for data buffer */
if (acb->xsflags & (SCSI_DATA_IN | SCSI_DATA_OUT)) {
+ acb->datalen = xs->datalen;
err = bus_dmamap_load(sc->sc_dmat, acb->datadma,
xs->data, acb->datalen, NULL,
BUS_DMA_NOWAIT | BUS_DMA_STREAMING |
@@ -734,6 +738,10 @@ FREE:
/* Setup DMA map for data buffer */
acb->xsflags &= SCSI_POLL | SCSI_NOSLEEP;
acb->xsflags |= SCSI_DATA_IN;
+ acb->datalen = sizeof xs->sense;
+#ifdef OSIOP_DEBUG
+ acb->data = &xs->sense;
+#endif
err = bus_dmamap_load(sc->sc_dmat, acb->datadma,
&xs->sense, sizeof(xs->sense), NULL,
BUS_DMA_NOWAIT | BUS_DMA_STREAMING | BUS_DMA_READ);
@@ -1987,8 +1995,8 @@ osiop_dump_acb(acb)
for (i = acb->ds->cmd.count; i > 0; i--)
printf(" %02x", *b++);
printf("\n");
- printf(" xs: %p data %p:%04x ", acb->xs, acb->xs->data,
- acb->xs->datalen);
+ printf(" xs: %p data %p:%04x ", acb->xs, acb->data,
+ acb->datalen);
printf("cur %lx:%lx\n", acb->curaddr, acb->curlen);
}
diff --git a/sys/dev/ic/osiopvar.h b/sys/dev/ic/osiopvar.h
index fba4abd4c1e..e78fefa98fa 100644
--- a/sys/dev/ic/osiopvar.h
+++ b/sys/dev/ic/osiopvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: osiopvar.h,v 1.2 2003/04/06 20:24:31 krw Exp $ */
+/* $OpenBSD: osiopvar.h,v 1.3 2003/04/08 18:03:46 krw Exp $ */
/* $NetBSD: osiopvar.h,v 1.3 2002/05/14 02:58:35 matt Exp $ */
/*
@@ -153,9 +153,7 @@ struct osiop_acb {
int xsflags; /* copy of xs->flags */
int datalen;
-#ifdef OSIOP_DEBUG
void *data; /* transfer data buffer ptr */
-#endif
bus_addr_t curaddr; /* current transfer data buffer */
bus_size_t curlen; /* current transfer data length */