summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-cd.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-03-23 20:55:28 +0000
committersos <sos@FreeBSD.org>2001-03-23 20:55:28 +0000
commite6b6652c8fcc96ba1f2211b0f1185567fbd8c9b6 (patch)
tree027021dbd9bda757bd8be069665beb4463b019d2 /sys/dev/ata/atapi-cd.c
parentf0a19e894be36f1afd46a4537644bd23bd06bd75 (diff)
downloadFreeBSD-src-e6b6652c8fcc96ba1f2211b0f1185567fbd8c9b6.zip
FreeBSD-src-e6b6652c8fcc96ba1f2211b0f1185567fbd8c9b6.tar.gz
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.
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
-rw-r--r--sys/dev/ata/atapi-cd.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 6b10fc9..6b6bab3 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -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
OpenPOWER on IntegriCloud