diff options
author | Nate Lawson <njl@FreeBSD.org> | 2002-11-23 22:51:50 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2002-11-23 22:51:50 +0000 |
commit | c3bf92aa58711a79372f74b05f1873f9cd6ff74f (patch) | |
tree | f3a485a6ee3f04ec0062b9083e6399178b3ea30e /sys/dev | |
parent | a35e039f692046ecede5da2f8fc237eb8b199d11 (diff) | |
download | src-c3bf92aa58711a79372f74b05f1873f9cd6ff74f.tar.gz src-c3bf92aa58711a79372f74b05f1873f9cd6ff74f.zip |
Allow acd(4) and cd(4) to support old behavior for CDRIOC*SPEED ioctls.
If the value from the user is less than 177, assume it is a multiple of
a single speed CDROM and convert to KB/sec.
No complaints from: sos
Reviewed by: ken
Approved by: re
MFC after: 1 day
Notes
Notes:
svn path=/head/; revision=107193
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index d3bcd60dbced..667bdd203286 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -1021,11 +1021,24 @@ acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) break; case CDRIOCREADSPEED: - error = acd_set_speed(cdp, *(int *)addr, CDR_MAX_SPEED); + { + int speed = *(int *)addr; + + /* Preserve old behavior: units in multiples of CDROM speed */ + if (speed < 177) + speed *= 177; + error = acd_set_speed(cdp, speed, CDR_MAX_SPEED); + } break; case CDRIOCWRITESPEED: - error = acd_set_speed(cdp, CDR_MAX_SPEED, *(int *)addr); + { + int speed = *(int *)addr; + + if (speed < 177) + speed *= 177; + error = acd_set_speed(cdp, CDR_MAX_SPEED, speed); + } break; case CDRIOCGETBLOCKSIZE: |