summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-20 06:43:07 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-20 06:43:07 +0000
commit8bc35427c85f9cb47dc71adb5000381458fcb44e (patch)
tree032bd9caf6661dedce1254a7412fb2a26381b09b /sys
parent086c081ce27fb3ac2c00b0c859d2260dd689752e (diff)
Calculate the residual and copy it back to the scsi_xfer, so that RW actually
works. From dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/atascsi.c3
-rw-r--r--sys/dev/pci/ahci.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index 19d9864fe8e..f30594ef693 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.18 2007/03/20 06:41:38 pascoe Exp $ */
+/* $OpenBSD: atascsi.c,v 1.19 2007/03/20 06:43:06 pascoe Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -461,6 +461,7 @@ atascsi_disk_cmd_done(struct ata_xfer *xa)
xa->state);
}
+ xs->resid = xa->resid;
ata_put_xfer(xa);
xs->flags |= ITSDONE;
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c
index d440f544de6..0252a72157e 100644
--- a/sys/dev/pci/ahci.c
+++ b/sys/dev/pci/ahci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci.c,v 1.80 2007/03/20 05:46:50 pascoe Exp $ */
+/* $OpenBSD: ahci.c,v 1.81 2007/03/20 06:43:06 pascoe Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -1267,6 +1267,8 @@ ahci_unload_prdt(struct ahci_ccb *ccb)
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, dmap);
+
+ xa->resid = xa->datalen - letoh32(ccb->ccb_cmd_hdr->prdbc);
}
}