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.
This commit is contained in:
Søren Schmidt 1999-11-27 17:06:10 +00:00
parent 652b720001
commit ad6eb979ba

View File

@ -40,6 +40,7 @@
#include <sys/conf.h>
#include <sys/disk.h>
#include <sys/devicestat.h>
#include <sys/cons.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_page.h>
@ -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;
}