pre8 and ATAPI ZIP - ide-probe.c

Edmund GRIMLEY EVANS (edmundo@rano.demon.co.uk)
Thu, 21 Jan 1999 14:42:12 GMT


There's a bit of code in ide-probe.c (2.1.132 or 2.2.0-pre8) that looks
like this:

switch (type) {
case ide_floppy:
if (!strstr(id->model, "CD-ROM")) {
if (!strstr(id->model, "oppy") && !strstr(id->model, "poyp") && !strstr(id->model, "ZIP"))
printk("cdrom or floppy?, assuming ");
if (drive->media != ide_cdrom) {
printk ("FLOPPY");
break;
}
}
type = ide_cdrom; /* Early cdrom models used zero */
case ide_cdrom:

I think the logic might be wrong here; it doesn't seem to make sense.
If the string "CD-ROM" is absent and the string "oppy" is present, then
it sets the type to ide_cdrom, and it doesn't even print a warning, if
the media is equal to ide_cdrom. Why does it look for the string "oppy"
if it doesn't use the information except for suppressing the warning?
It would make more sense to strengthen the warning to say something
like like "this device says it's an `oppy' but I'm setting it to CD-ROM
anyway" ...

So maybe this code should be changed to read something like this:

switch (type) {
case ide_floppy:
if (!strstr(id->model, "CD-ROM")) {
if (!strstr(id->model, "oppy") && !strstr(id->model, "poyp") && !strstr(id->model, "ZIP")) {
printk("cdrom or floppy?, assuming ");
if (drive->media == ide_cdrom)
goto cdrom;
}
printk ("FLOPPY");
break;
}
cdrom:
type = ide_cdrom; /* Early cdrom models used zero */
case ide_cdrom:

Since this code didn't change between 2.1.132 and 2.2.0-pre8 it can't
be directly responsible for my LS-120 stopping working between those
two kernels. I'm not even sure this code is being visited, but, if it
is, presumably the difference is that drive->media is being set to
ide_cdrom with 2.2.0-pre8. Why? And in which source file?

(Please copy any replies to me as I don't read the list.)

Edmund

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/