Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jun 1997 02:05:33 GMT
From:      vegold01@starbase.spd.louisville.edu
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   i386/3856: if_ix.c improvement for autodetection of Intel EtherExpress Card
Message-ID:  <199706130205.CAA00646@moose>
Resent-Message-ID: <199706130630.XAA14210@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         3856
>Category:       i386
>Synopsis:       Improvement to autodetection logic
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 12 23:30:01 PDT 1997
>Last-Modified:
>Originator:     V Edward Gold, Jr.
>Organization:
Lockheed Martin Information Systems
>Release:        FreeBSD 2.2.1-RELEASE i386
>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;
> 		}
> 	}
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706130205.CAA00646>