From rhh@ct.picker.com  Mon Feb  2 15:39:44 1998
Received: from whqvax.picker.com (whqvax.picker.com [144.54.1.1])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id PAA08186
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 2 Feb 1998 15:39:43 -0800 (PST)
          (envelope-from rhh@ct.picker.com)
Received: from ct.picker.com by whqvax.picker.com with SMTP;
          Mon, 2 Feb 1998 18:39:03 -0500 (EST)
Received: from stealth.ct.picker.com (eagle.ct.picker.com) by ct.picker.com (4.1/SMI-4.1)
	id AA19544; Mon, 2 Feb 98 18:38:59 EST
Received: (from rhh@localhost)
	by stealth.ct.picker.com (8.8.8/8.8.8) id SAA04342;
	Mon, 2 Feb 1998 18:40:48 GMT
	(envelope-from rhh)
Message-Id: <199802021840.SAA04342@stealth.ct.picker.com>
Date: Mon, 2 Feb 1998 18:40:48 GMT
From: rhh@ct.picker.com
Reply-To: rhh@ct.picker.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: rhh@ct.picker.com
Subject: Tertiary/Quaternary IDE Ctlrs: A few kernel mods needed
X-Send-Pr-Version: 3.2

>Number:         5627
>Category:       kern
>Synopsis:       Tertiary/Quaternary IDE Ctlrs: A few kernel mods needed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb  2 15:40:00 PST 1998
>Closed-Date:    Sat Aug 5 16:55:28 PDT 2000
>Last-Modified:  Sat Aug 05 16:56:03 PDT 2000
>Originator:     Randall Hopper
>Release:        FreeBSD 3.0-971208-SNAP i386
>Organization:
self
>Environment:

	Stock 3.0-971208-SNAP.  P55T2P4 Dual IDE MB and SB32 w/ Tertiary
	IDE port.

>Description:

        The good news is, tertiary IDE does work.  However, two kernel/config
	mods are needed to support tertiary and quaternary controllers
        out-of-the-box.

	My 1st attempt was this:

controller wdc2 at isa? port "IO_WD3" bio irq 11 flags 0xa0ffa004 vector wdintr
disk       wd4  at wdc2 drive 0

        which fails because IO_WD3 and IOWD4 aren't defined in 
        sys/i386/isa/isa.h.  (See FIX#1 below).  This resulted in an ioconf.c
        which of course wouldn't build.

        To work around this, my 2nd attempt was to replace "IO_WD3" with 
        the actual port number (0x1e8).  This got me closer, but still 
        resulted in an ioconf.c that wouldn't build.  "config" generated an
        invalid entry in isa_biotab_wdc[] below my primary and secondary 
        drives for the tertiary controller's drive:

{ -1, &wdcdriver,   (null), IRQ11, -1, C 0x00000,     0,   wdintr,   4, 0x0000,
    0,    0,       0,       0,      1,        0,   0 },

        "config" may be sprintf'ing a NULL here.  

        At any rate, once I patched this "(null)" up to be the correct 0x1e8
        I'd specified in the kernel config file, then my kernel with 
        wdc2 and wd4 did build, and allowed me to access the hard disk 
        hanging off of this tertiary IDE controller with no problems.
        
>How-To-Repeat:

	Try to build a 3.0-current kernel with these kernel config lines:

controller wdc2 at isa? port "IO_WD3" bio irq 11 flags 0xa0ffa004 vector wdintr
disk       wd4  at wdc2 drive 0

        and you'll see that ioconf.c will not build for several reasons.

>Fix:
	
	FIX#1:  Add these lines to sys/i386/isa/isa.h:

             #define IO_WD3 0x1e8
             #define IO_WD4 0x168

        FIX#2:  I don't know the details, but config needs modified not
                to generate a "(null)" in the port field of 
                ioconf.c::isa_biotab_wdc[] for this kernel config line:

                disk       wd4  at wdc2 drive 0

        Thanks.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: nbm 
State-Changed-When: Sat Aug 5 16:55:28 PDT 2000 
State-Changed-Why:  
The new ATA code handles things differently.  It also automatically 
picks up PCI controllers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=5627 
>Unformatted:
