From d3243c4482eb7a852db554e8c0883150c2027df9 Mon Sep 17 00:00:00 2001 From: sos Date: Sat, 27 Nov 1999 17:06:10 +0000 Subject: [PATCH] call ata_reinit in addump trying to make sure the dump will succed, also check for errors underways, and make it possible to abort the dump by hitting a key. --- sys/dev/ata/ata-disk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index b8a083a3a582..3de82054cfe6 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -327,6 +328,7 @@ addump(dev_t dev) if (!adp) return ENXIO; + ata_reinit(adp->controller); adp->flags &= ~AD_F_DMA_ENABLED; while (count > 0) { @@ -346,6 +348,8 @@ addump(dev_t dev) while (request.bytecount > 0) { ad_transfer(&request); + if (request.flags & AR_F_ERROR) + return EIO; request.donecount += request.currentsize; DELAY(20); } @@ -361,10 +365,12 @@ addump(dev_t dev) blkno += howmany(PAGE_SIZE, secsize); count -= howmany(PAGE_SIZE, secsize); addr += PAGE_SIZE; + if (cncheckc() != -1) + return EINTR; } if (ata_wait(adp->controller, adp->unit, ATA_S_READY | ATA_S_DSC) < 0) - printf("ad_dump: timeout waiting for final ready\n"); + printf("addump: timeout waiting for final ready\n"); return 0; }