diff options
author | sos <sos@FreeBSD.org> | 2003-08-24 19:50:22 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2003-08-24 19:50:22 +0000 |
commit | be85bddf34d9f84ab712588f0965302ef13450c3 (patch) | |
tree | 1dd9bbf836f0fa4c7b5df8013615b35ea3f9fb9e /sys/dev | |
parent | 510e1d2c28481107399a9c89fcefa42042c2b9cd (diff) | |
download | FreeBSD-src-be85bddf34d9f84ab712588f0965302ef13450c3.zip FreeBSD-src-be85bddf34d9f84ab712588f0965302ef13450c3.tar.gz |
Fix ad_dump top actually produce a dump.
Reported by: Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 23368d6..ebf326d 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -337,11 +337,12 @@ addump(void *arg, void *virtual, vm_offset_t physical, return ENXIO; bzero(&request, sizeof(struct ata_request)); + request.device = adp->device; request.data = virtual; request.bytecount = length; request.transfersize = min(length, adp->max_iosize); - request.flags |= ATA_R_WRITE; + request.flags = ATA_R_WRITE; if (adp->max_iosize > DEV_BSIZE) request.u.ata.command = ATA_WRITE_MUL; else @@ -349,10 +350,15 @@ addump(void *arg, void *virtual, vm_offset_t physical, request.u.ata.lba = offset / DEV_BSIZE; request.u.ata.count = request.bytecount / DEV_BSIZE; + if (adp->device->channel->hw.transaction(&request) == ATA_OP_FINISHED) + return EIO; while (request.bytecount > request.donecount) { - if (adp->device->channel->hw.transaction(&request) == ATA_OP_FINISHED) - return EIO; DELAY(20); + adp->device->channel->running = &request; + adp->device->channel->hw.interrupt(adp->device->channel); + adp->device->channel->running = NULL; + if (request.status & ATA_S_ERROR) + return EIO; } return 0; } |