Fix the problem with some drives not reporting back when the
are busy blanking and erasing CD-RW media. This fixes burncd's premature returns from blanking/erasing that caused trouble.
This commit is contained in:
parent
f0a19e894b
commit
e6b6652c8f
@ -226,6 +226,8 @@ atapi_queue_cmd(struct atapi_softc *atp, int8_t *ccb, caddr_t data,
|
||||
await(PRIBIO, 0);
|
||||
splx(s);
|
||||
error = request->error;
|
||||
if (error)
|
||||
atp->sense = request->sense;
|
||||
#ifdef ATAPI_DEBUG
|
||||
ata_printf(atp->controller, atp->unit, "finished %s\n",
|
||||
atapi_cmd2str(request->ccb[0]));
|
||||
|
@ -147,6 +147,7 @@ struct atapi_softc {
|
||||
int unit; /* ATA_MASTER or ATA_SLAVE */
|
||||
void *driver; /* ptr to subdriver softc */
|
||||
u_int8_t cmd; /* last cmd executed */
|
||||
struct atapi_reqsense sense; /* last cmd sense if error */
|
||||
int flags; /* drive flags */
|
||||
#define ATAPI_F_MEDIA_CHANGED 0x0001
|
||||
#define ATAPI_F_DETACHING 0x0002
|
||||
@ -166,7 +167,7 @@ struct atapi_request {
|
||||
int result; /* result of this cmd */
|
||||
int error; /* result translated to errno */
|
||||
struct atapi_reqsense sense; /* sense data if error */
|
||||
int flags;
|
||||
int flags;
|
||||
#define ATPR_F_READ 0x0001
|
||||
#define ATPR_F_DMA_USED 0x0002
|
||||
#define ATPR_F_AT_HEAD 0x0004
|
||||
|
@ -1540,22 +1540,23 @@ acd_read_track_info(struct acd_softc *cdp,
|
||||
static int
|
||||
acd_get_progress(struct acd_softc *cdp, int *finished)
|
||||
{
|
||||
int8_t ccb[16] = { ATAPI_REQUEST_SENSE, 0, 0, 0,
|
||||
sizeof(struct atapi_reqsense),
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
struct atapi_reqsense sense;
|
||||
int error;
|
||||
int8_t ccb[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
char tmp[8];
|
||||
|
||||
if ((error = atapi_test_ready(cdp->atp)) != EBUSY) {
|
||||
*finished = 100;
|
||||
return error;
|
||||
if (atapi_test_ready(cdp->atp) != EBUSY) {
|
||||
if (atapi_queue_cmd(cdp->atp, ccb, tmp, sizeof(tmp),
|
||||
ATPR_F_READ, 30, NULL, NULL) != EBUSY) {
|
||||
*finished = 100;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
error = atapi_queue_cmd(cdp->atp, ccb, (caddr_t)&sense, sizeof(sense),
|
||||
ATPR_F_READ, 10, NULL, NULL);
|
||||
|
||||
*finished = ((sense.sk_specific2|(sense.sk_specific1<<8))*100)/65535;
|
||||
return error;
|
||||
if (cdp->atp->sense.sksv)
|
||||
*finished = ((cdp->atp->sense.sk_specific2 |
|
||||
(cdp->atp->sense.sk_specific1 << 8)) * 100) / 65535;
|
||||
else
|
||||
*finished = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user