diff options
author | sos <sos@FreeBSD.org> | 2002-07-28 23:59:00 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-07-28 23:59:00 +0000 |
commit | 830c1b765cfe95293f0ee1c4b08633bf4670faa4 (patch) | |
tree | 295fd6cbe8a9982696c4e751b794124bd27a8289 /sys/dev/ata | |
parent | d0cb048dcb1dcde0bc759dd359240420a76f7609 (diff) | |
download | FreeBSD-src-830c1b765cfe95293f0ee1c4b08633bf4670faa4.zip FreeBSD-src-830c1b765cfe95293f0ee1c4b08633bf4670faa4.tar.gz |
OK, dont rely on the upper layers handling iosize_max correctly,
instead rely on ATAPI devices ability to do the work instead.
MFC material.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/atapi-all.c | 7 | ||||
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 2 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 9 | ||||
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 4 |
4 files changed, 10 insertions, 12 deletions
diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index 27a1a3a..36e3199 100644 --- a/sys/dev/ata/atapi-all.c +++ b/sys/dev/ata/atapi-all.c @@ -274,7 +274,9 @@ atapi_transfer(struct atapi_request *request) /* if DMA enabled setup DMA hardware */ request->flags &= ~ATPR_F_DMA_USED; if ((atadev->mode >= ATA_DMA) && - (request->ccb[0] == ATAPI_READ || request->ccb[0] == ATAPI_READ_BIG || + (request->ccb[0] == ATAPI_READ || + request->ccb[0] == ATAPI_READ_BIG || + request->ccb[0] == ATAPI_READ_CD || ((request->ccb[0] == ATAPI_WRITE || request->ccb[0] == ATAPI_WRITE_BIG) && !(atadev->channel->flags & ATA_ATAPI_DMA_RO))) && @@ -283,7 +285,8 @@ atapi_transfer(struct atapi_request *request) } /* start ATAPI operation */ - if (ata_command(atadev, ATA_C_PACKET_CMD, (request->bytecount << 8), 0, + if (ata_command(atadev, ATA_C_PACKET_CMD, + min(request->bytecount, 65534) << 8, 0, (request->flags & ATPR_F_DMA_USED) ? ATA_F_DMA : 0, ATA_IMMEDIATE)) ata_prtdev(atadev, "failure to send ATAPI packet command\n"); diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index be5bd17..333305d 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -292,7 +292,7 @@ acd_make_dev(struct acd_softc *cdp) static void acd_set_ioparm(struct acd_softc *cdp) { - cdp->dev->si_iosize_max = (65534 / cdp->block_size) * cdp->block_size; + cdp->dev->si_iosize_max = ((256*DEV_BSIZE)/cdp->block_size)*cdp->block_size; cdp->dev->si_bsize_phys = cdp->block_size; } diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 4360847..a8a53ab 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -107,12 +107,7 @@ afdattach(struct ata_device *atadev) dev = disk_create(fdp->lun, &fdp->disk, 0, &afd_cdevsw, &afddisk_cdevsw); dev->si_drv1 = fdp; fdp->dev = dev; - - if (!strncmp(atadev->param->model, "IOMEGA ZIP", 10) || - !strncmp(atadev->param->model, "IOMEGA Clik!", 12)) - fdp->dev->si_iosize_max = 64 * DEV_BSIZE; - else - fdp->dev->si_iosize_max = 127 * DEV_BSIZE; + fdp->dev->si_iosize_max = 256 * DEV_BSIZE; afd_describe(fdp); atadev->flags |= ATA_D_MEDIA_CHANGED; @@ -328,7 +323,7 @@ afd_start(struct ata_device *atadev) } lba = bp->bio_pblkno; - count = min(bp->bio_bcount, fdp->dev->si_iosize_max) / fdp->cap.sector_size; + count = bp->bio_bcount / fdp->cap.sector_size; data_ptr = bp->bio_data; bp->bio_resid = bp->bio_bcount; diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 6801035..2ff5661 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -132,12 +132,12 @@ astattach(struct ata_device *atadev) dev = make_dev(&ast_cdevsw, dkmakeminor(stp->lun, 0, 0), UID_ROOT, GID_OPERATOR, 0640, "ast%d", stp->lun); dev->si_drv1 = stp; - dev->si_iosize_max = 127 * DEV_BSIZE; + dev->si_iosize_max = 256 * DEV_BSIZE; stp->dev1 = dev; dev = make_dev(&ast_cdevsw, dkmakeminor(stp->lun, 0, 1), UID_ROOT, GID_OPERATOR, 0640, "nast%d", stp->lun); dev->si_drv1 = stp; - dev->si_iosize_max = 127 * DEV_BSIZE; + dev->si_iosize_max = 256 * DEV_BSIZE; stp->dev2 = dev; stp->device->flags |= ATA_D_MEDIA_CHANGED; ast_describe(stp); |