summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-04-07 15:58:27 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-04-07 15:58:27 +0000
commitc4fde1b8b63c728a5451dce48df7430868c86aa1 (patch)
treec7eab95cc1e8e61d0a0df6a4218fd31db8f78c82 /sys
parente6fe05a65b2411797fdbbcc6dc38fed30ff3fe9a (diff)
Always assume write commands had zero residual; the chip only counts
received bytes.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/sili.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c
index 6179bfb249f..1fcd3d33151 100644
--- a/sys/dev/ic/sili.c
+++ b/sys/dev/ic/sili.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sili.c,v 1.25 2007/04/07 15:44:22 pascoe Exp $ */
+/* $OpenBSD: sili.c,v 1.26 2007/04/07 15:58:26 pascoe Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -878,7 +878,11 @@ sili_unload(struct sili_ccb *ccb)
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, dmap);
- xa->resid = xa->datalen - sili_pread(sp, SILI_PREG_RX_COUNT(xa->tag));
+ if (xa->flags & ATA_F_READ)
+ xa->resid = xa->datalen - sili_pread(sp,
+ SILI_PREG_RX_COUNT(xa->tag));
+ else
+ xa->resid = 0;
}
int