From aafa7ea069b654fe63a2d5ba54b645d6e65fec7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 26 Jul 2002 19:13:05 +0000 Subject: [PATCH] Fix the max transfer size for ATAPI devices. The spec says to transfer at most 65534 bytes, thats 126 times DEV_BSIZE not 252 :( Pointed out by: Ian Dowse --- sys/dev/ata/atapi-cd.c | 2 +- sys/dev/ata/atapi-fd.c | 2 +- sys/dev/ata/atapi-tape.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 1a3634d3ea3a..d0e8c3910ef6 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -282,7 +282,7 @@ acd_make_dev(struct acd_softc *cdp) make_dev_alias(dev, "acd%da", cdp->lun); make_dev_alias(dev, "acd%dc", cdp->lun); dev->si_drv1 = cdp; - dev->si_iosize_max = 252 * DEV_BSIZE; + dev->si_iosize_max = 126 * DEV_BSIZE; dev->si_bsize_phys = 2048; /* XXX SOS */ cdp->dev = dev; cdp->device->flags |= ATA_D_MEDIA_CHANGED; diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 751a875657c6..e0a4c249e07c 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -112,7 +112,7 @@ afdattach(struct ata_device *atadev) !strncmp(atadev->param->model, "IOMEGA Clik!", 12)) fdp->dev->si_iosize_max = 64 * DEV_BSIZE; else - fdp->dev->si_iosize_max = 252 * DEV_BSIZE; + fdp->dev->si_iosize_max = 126 * DEV_BSIZE; afd_describe(fdp); atadev->flags |= ATA_D_MEDIA_CHANGED; diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 51a338624025..b8b6455cafc8 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 = 252 * DEV_BSIZE; + dev->si_iosize_max = 126 * 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 = 252 * DEV_BSIZE; + dev->si_iosize_max = 126 * DEV_BSIZE; stp->dev2 = dev; stp->device->flags |= ATA_D_MEDIA_CHANGED; ast_describe(stp);