Subject: Re: New distrib of the bouyer-ide branch
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-i386
Date: 09/21/1998 19:37:55
On Sep 20, Manuel Bouyer wrote
> Hi,
> I've uploaded a new set of patche for IDE DMA. The -current version
> is in ftp://ftp.netbsd.org:/pub/incoming/bouyer/, the 1.3.2 one
> in ftp://ftp.netbsd.org:/pub/NetBSD/arch/i386/ide-1.3.2.
> (1.3.2 users: you just need to extract the tar file and recompile,
> nothing changed in the patch file).
> 

And there was a quite annoying bug in the disk probe function, preventing
ATAPI slave from being probed when they have an ATA master.
I've updated the sources and precompiled kernel, but for those who already
have downloaded the sources, I included the patch at the end of this mail.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--

Index: wdc.c
===================================================================
RCS file: /archive/cvs/cvsroot/NetBSD/src/sys/dev/ic/wdc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- wdc.c	1998/09/20 20:42:42	1.3
+++ wdc.c	1998/09/21 02:16:54	1.4
@@ -227,8 +227,9 @@
 		return 0;
 
 	/*
-	 * Test presence of drives. First test register signatures,
-	 * then try an ATA command, in case it's an old drive.
+	 * Test presence of drives. First test register signatures looking for
+	 * ATAPI devices , then rescan and try an ATA command, in case it's an
+	 * old drive.
 	 * Fill in drive_flags accordingly
 	 */
 	for (drive = 0; drive < 2; drive++) {
@@ -249,8 +250,15 @@
 	    	    chp->channel, drive, sc, sn, cl, ch), DEBUG_PROBE);
 		if (sc == 0x01 && sn == 0x01 && cl == 0x14 && ch == 0xeb) {
 			chp->ch_drive[drive].drive_flags |= DRIVE_ATAPI;
-			continue;
 		}
+	}
+	for (drive = 0; drive < 2; drive++) {
+		if ((ret_value & (0x01 << drive)) == 0 ||
+		    (chp->ch_drive[drive].drive_flags & DRIVE_ATAPI) != 0)
+			continue;
+		bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
+		    WDSD_IBM | (drive << 4));
+		delay(1);
 		/*
 		 * Maybe it's an old device, so don't rely on ATA sig.
 		 * Test registers writability (Error register not writable,