summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-tape.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2000-03-05 16:52:26 +0000
committersos <sos@FreeBSD.org>2000-03-05 16:52:26 +0000
commit2610d76c24fda4e4028b633dc4df3471e82e5d65 (patch)
treee98d9c247873e4565dda59e44e728854c8f78759 /sys/dev/ata/atapi-tape.c
parent3e2fdbb2dd8aef2ecdcb4a5026733773122121aa (diff)
downloadFreeBSD-src-2610d76c24fda4e4028b633dc4df3471e82e5d65.zip
FreeBSD-src-2610d76c24fda4e4028b633dc4df3471e82e5d65.tar.gz
Fix the CD driver so that the last blocks can be read even if
a blocksize != 2k is used. Update the timeout code to try fallback to PIO if problems arise in DMA mode.
Diffstat (limited to 'sys/dev/ata/atapi-tape.c')
-rw-r--r--sys/dev/ata/atapi-tape.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c
index 9d41648..29c159f 100644
--- a/sys/dev/ata/atapi-tape.c
+++ b/sys/dev/ata/atapi-tape.c
@@ -489,8 +489,8 @@ ast_start(struct ast_softc *stp)
devstat_start_transaction(&stp->stats);
- atapi_queue_cmd(stp->atp, ccb, bp->b_data, bp->b_bcount,
- (bp->b_flags & B_READ) ? A_READ : 0, 60, ast_done, stp, bp);
+ atapi_queue_cmd(stp->atp, ccb, bp->b_data, blkcount * stp->blksize,
+ bp->b_flags&B_READ ? ATPR_F_READ : 0, 60, ast_done, stp,bp);
}
static int32_t
@@ -506,7 +506,7 @@ ast_done(struct atapi_request *request)
else {
if (!(bp->b_flags & B_READ))
stp->flags |= F_DATA_WRITTEN;
- bp->b_resid = request->bytecount;
+ bp->b_resid = bp->b_bcount - request->donecount;
ast_total += (bp->b_bcount - bp->b_resid);
}
devstat_end_transaction_buf(&stp->stats, bp);
@@ -523,7 +523,7 @@ ast_mode_sense(struct ast_softc *stp, u_int8_t page,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int32_t error;
- error = atapi_queue_cmd(stp->atp, ccb, pagebuf, pagesize, A_READ, 10,
+ error = atapi_queue_cmd(stp->atp, ccb, pagebuf, pagesize, ATPR_F_READ, 10,
NULL, NULL, NULL);
#ifdef AST_DEBUG
atapi_dump("ast: mode sense ", pagebuf, pagesize);
@@ -577,7 +577,7 @@ ast_read_position(struct ast_softc *stp, int32_t hard,
int32_t error;
error = atapi_queue_cmd(stp->atp, ccb, position,
- sizeof(struct ast_readposition), A_READ, 10,
+ sizeof(struct ast_readposition), ATPR_F_READ, 10,
NULL, NULL, NULL);
position->tape = ntohl(position->tape);
position->host = ntohl(position->host);
OpenPOWER on IntegriCloud