From edg@moose  Thu Jun 12 23:21:31 1997
Received: from moose (user-37kbmtg.dialup.mindspring.com [207.69.219.176])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA13681
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Jun 1997 23:18:11 -0700 (PDT)
Received: (from edg@localhost) by moose (8.8.5/8.7.3) id CAA00646; Fri, 13 Jun 1997 02:05:33 GMT
Message-Id: <199706130205.CAA00646@moose>
Date: Fri, 13 Jun 1997 02:05:33 GMT
From: vegold01@starbase.spd.louisville.edu
Reply-To: vegold01@starbase.spd.louisville.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: if_ix.c improvement for autodetection of Intel EtherExpress Card
X-Send-Pr-Version: 3.2

>Number:         3856
>Category:       i386
>Synopsis:       Improvement to autodetection logic
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 12 23:30:01 PDT 1997
>Closed-Date:    Sun May 24 22:57:45 PDT 1998
>Last-Modified:  Sun May 24 22:59:07 PDT 1998
>Originator:     V Edward Gold, Jr.
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
Lockheed Martin Information Systems
>Environment:

     Basic FreeBSD system with Intel EtherExpress Card(s).

>Description:

     The Intel EtherExpress card requires a DOS configuration program be run
to properly configure the card.  I have a proposed improvement to the if_ix.c
device driver that will enable it to locate the card without this DOS program
having been run.  This can also help the driver find a card that was 
misconfigured.

     The proposed improvement will first search the address specified in the
kernel parameters, then it will hunt through the entire possible space of 
addresses in an attempt to find the card.  If the card is in the system, this
should find it.  Using this hunting logic, its possible to support multiple 
cards without having to run the DOS utility.

>How-To-Repeat:

      Place card in system and configure it to I/O address other than what the
kernel expects.  Driver will fail to find the card.

>Fix:
	

144,152d143
<  * Definitions for autodetect logic   12/15/96
<  */
< 
< #define START_ADDRESS_SPACE     ( 0x200 )
< #define END_ADDRESS_SPACE       ( 0x37f )
< #define ADDRESS_STEP_SIZE       ( 0x10 )
< 
< 
< /*
322,365c313,322
< 
<         /* This is the normal detection of the specified address */
<         idstate = inb(dvp->id_iobase + autoid) & 0x03;
<         for (i=0, boardid=0; i < 4; i++) {
<                 tempid = inb(dvp->id_iobase + autoid);
<                 boardid |= ((tempid & 0xF0) >> 4) << ((tempid & 0x03) << 2);
<                 if ((tempid & 0x03) != (++idstate & 0x03)) {
<                         /* out of sequence, destroy boardid and bail out */
<                         boardid = 0;
<                         break;
<                 }
<         }
<         if( boardid == BOARDID )
<            found = -1;
<         else 
<            found = 0;
< 
<         /*
<          * Lets check every possible address so maybe we can find it
<          */
< 
<         j = START_ADDRESS_SPACE;
<         while( !found & ( j <= END_ADDRESS_SPACE ) )
<         {
<                 dvp->id_iobase = j;
<                 idstate = inb( dvp->id_iobase + autoid ) & 0x03;
<                 boardid = 0;
<                 for ( i = 0 ; i < 4 ; ++i )
<                 {
<                    tempid = inb( dvp->id_iobase + autoid );
<                    boardid |= ((tempid & 0xF0) >> 4) << ((tempid & 0x03) << 2);
<                    if ((tempid & 0x03) != (++idstate & 0x03))
<                    {
<                       /* out of sequence, destroy boardid and bail */
<                       boardid = 0;
<                       break;
<                    }
<                 }
<                 if( boardid == BOARDID )
<                    found = -1;
<                 else
<                    j += ADDRESS_STEP_SIZE;
<         }
< 
---
> 	idstate = inb(dvp->id_iobase + autoid) & 0x03;
> 	for (i=0, boardid=0; i < 4; i++) {
> 		tempid = inb(dvp->id_iobase + autoid);
> 		boardid |= ((tempid & 0xF0) >> 4) << ((tempid & 0x03) << 2);
> 		if ((tempid & 0x03) != (++idstate & 0x03)) {
> 			/* out of sequence, destroy boardid and bail out */
> 			boardid = 0;
> 			break;
> 		}
> 	}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed  
State-Changed-By: cwt 
State-Changed-When: Sun May 24 22:57:45 PDT 1998 
State-Changed-Why:  
ix driver obsoleted by merge with ex 
>Unformatted:
