PATCH for changing of DVD speed via ioctl() call
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · cHitman
This patch implements changing of DVD speed via
ioctl()call, likeCDROM_SELECT_SPEEDdo. InCDROM_SELECT_SPEEDits implementation isn't so good (diffirent values of 1x in KB/s, troubles with return value ofcdrom_select_speed()and other). I definedCDROM_SELECT_DVDSPEEDioctl () call with value0x5324. But some dvdroms (like Plexter) do not support this feature.. :(
Introducing another device-specific IOCTL because the other device-specific request turned out to be wrong is likely to be wrong, too.
Review
Quoted 6 lines
req.sense = sense;
(quoted diff) +1
-1- if (speed == 0) + if (speed <= 0) speed = 0xffff; /* set to max */ else speed *= 177; /* Nx to kbytes/s */
The parameter value should IMHO be a pointer to a struct {
unsigned long long maxspeed; // (with 0 being the magic max. value?) int facility; /* 0=general speed, 2=general read, 4=read data,
6=read audio, 8=read raw ... whatever is supported n+1 = s/read/write/ */
}
That will work for any device and speed you can expect in the near future.
Review
Quoted 10 lines
(quoted diff) +10
-0+static int cdrom_select_dvd_speed(ide_drive_t *drive, int speed, + struct request_sense *sense) +{ + struct request req; + struct request_sense cap_sense; + unsigned char pd[28]; + unsigned long cap, spf; + + if (!CDROM_CONFIG_FLAGS(drive)->dvd) + return -ENOSYS;
EINVAL?
Signature · 2 lines
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF verbreiteten Lügen zu sabotieren.
Quoted 6 lines · Bodo Eggert
The parameter value should IMHO be a pointer to a struct {
unsigned long long maxspeed; // (with 0 being the magic max. value?) int facility; /* 0=general speed, 2=general read, 4=read data,
6=read audio, 8=read raw ... whatever is supported n+1 = s/read/write/ */
}
Passing pointers inside ioctl's is horrible IMO and if we can avoid it we should. It's just asking for problems.
Quoted 11 lines · Chris Wedgwood
Quoted 6 lines · Bodo Eggert
The parameter value should IMHO be a pointer to a struct {
unsigned long long maxspeed; // (with 0 being the magic max. value?) int facility; /* 0=general speed, 2=general read, 4=read data,
6=read audio, 8=read raw ... whatever is supported n+1 = s/read/write/ */
}Passing pointers inside ioctl's is horrible IMO and if we can avoid it we should. It's just asking for problems.
It's used in all ioctls not requiring a read-only int or a void. See man ioctl_list (2).
Signature · 2 lines
Top 100 things you don't want the sysadmin to say: 26. What happens to a Hard Disk when you drop it?