Bug 35512

Summary: ATA/ATAPI CD driver: impossible to set cd speed to magic value for "maximum speed"
Product: Base System Reporter: Philipp Mergenthaler <philipp.mergenthaler>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description Philipp Mergenthaler 2002-03-03 10:40:01 UTC
When calling acd_set_speed(), the speed is multiplied with 177, i.e.
converted from "multiples of single speed" to "data rate in kB/sec".

However, since 177 isn't a divisor of 65535, it is impossible to set
the speed to this value, which means "maximum speed". (At least with
my drive - LITEON DVD-ROM LTD122/IK01 - it is necessary to specify
exactly this value.  A value like e.g. 65490 (=177*370) won't change
the drive's current speed.)

Fix: I would suggest that the driver should set the drive's speed to the
value given with ioctl(), i.e. that the speed conversion should be
left to the userland.


Here's the patch to cdcontrol.  It passes the speed as entered by the
user directly to the driver.  I.e with the current driver the speed is
in "multiples of single speed" and with the above patch it is in kB/s
(or -1 for "maximum speed supported by the drive").


How-To-Repeat: 
Below is a patch to cdcontrol which adds the command "speed" so you
can test this easily.
Comment 1 Maxim Konovalov 2002-05-08 08:42:36 UTC
[...]

> Here's the patch to cdcontrol.  It passes the speed as entered by the
> user directly to the driver.  I.e with the current driver the speed is
> in "multiples of single speed" and with the above patch it is in kB/s
> (or -1 for "maximum speed supported by the drive").

A slightly modified patch were committed to -current, rev. 1.38
src/usr.sbin/cdcontrol/cdcontrol.c. Thanks!

[...]

--
Maxim Konovalov, MAcomnet, Internet Dept., system engineer
phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru
Comment 2 iedowse freebsd_committer freebsd_triage 2002-12-08 17:33:52 UTC
State Changed
From-To: open->closed


This has now been fixed in both -CURRENT and -STABLE.