- /* get status */
-
- if (i == 0) {
-#ifdef DEBUG
- printf ("Mitsumi drive NOT detected\n");
-#endif
- return 0;
- }
-
-/*
- * The following code uses the 0xDC command, it returns a M from the
- * second byte and a number in the third. Does anyone know what the
- * number is for? Better yet, how about someone thats REAL good in
- * i80x86 asm looking at the Dos driver... Most of this info came
- * from a friend of mine spending a whole weekend.....
- */
-
- DELAY (2000);
- outb(port+MCD_DATA,MCD_CMDCONTINFO);
- for (i = 0; i < 100000; i++) {
- if ((inb(port+MCD_FLAGS) & 0xF) == STATUS_AVAIL)
- break;
- }
- if (i > 100000) {
-#ifdef DEBUG
- printf ("Mitsumi drive error\n");
-#endif
- return 0;
+ status = inb(port+MCD_DATA);
+ if (status != MCDCDABSENT && status != MCDCDPRESENT &&
+ status != MCDSOPEN && status != MCDSCLOSED)
+ return 0; /* Not actually a Mitsumi drive here */
+ /* Get version information */
+ outb(port+MCD_DATA, MCD_CMDCONTINFO);
+ for (j = 0; j < 3; j++) {
+ if (!twiddle_thumbs(port, unit, 3000, "getting version info")) {
+ return 0;
+ }
+ stbytes[j] = (inb(port+MCD_DATA) & 0xFF);