diff options
| author | Søren Schmidt <sos@FreeBSD.org> | 2001-08-21 11:35:47 +0000 |
|---|---|---|
| committer | Søren Schmidt <sos@FreeBSD.org> | 2001-08-21 11:35:47 +0000 |
| commit | 468fe0fdf1c46bc98d1800bd7fb9e8a054eefa7a (patch) | |
| tree | 0ea5b67cdaaf8444abee34c257d2015a352c1a6d /sys/dev/ata/atapi-cd.c | |
| parent | 051449d576625dad72281c7d394448725108f6e1 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
| -rw-r--r-- | sys/dev/ata/atapi-cd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 89abf6984c8a1..3db545a1efd6d 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -1142,11 +1142,12 @@ acd_start(struct atapi_softc *atp) /* if transfer goes beyond range adjust it to be within limits */ if (lba + count > lastlba) { /* if we are entirely beyond EOM return EOF */ - if ((count = lastlba - lba) <= 0) { + if (lastlba <= lba) { bp->bio_resid = bp->bio_bcount; biodone(bp); return; } + count = lastlba - lba; } switch (blocksize) { case 2048: @@ -1380,9 +1381,13 @@ acd_select_slot(struct acd_softc *cdp) static int acd_open_disk(struct acd_softc *cdp) { - int8_t ccb[16] = { ATAPI_SEND_OPC_INFO, 0x01, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 }; + int8_t ccb[16]; + bzero(ccb, sizeof(ccb)); + ccb[0] = ATAPI_REZERO; + atapi_queue_cmd(cdp->atp, ccb, NULL, 0, ATPR_F_QUIET, 60, NULL, NULL); + ccb[0] = ATAPI_SEND_OPC_INFO; + ccb[1] = 0x01; atapi_queue_cmd(cdp->atp, ccb, NULL, 0, ATPR_F_QUIET, 30, NULL, NULL); return 0; } |
