From owner-freebsd-bugs Thu Jun 12 23:30:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA14216 for bugs-outgoing; Thu, 12 Jun 1997 23:30:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA14210; Thu, 12 Jun 1997 23:30:01 -0700 (PDT) Resent-Date: Thu, 12 Jun 1997 23:30:01 -0700 (PDT) Resent-Message-Id: <199706130630.XAA14210@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, vegold01@starbase.spd.louisville.edu 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 ; 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 X-Send-Pr-Version: 3.2 Subject: i386/3856: if_ix.c improvement for autodetection of Intel EtherExpress Card Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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: