From ctapang@easystreet.com  Sun Jan  3 16:59:24 1999
Received: from mail4.aracnet.com (mail4.aracnet.com [205.159.88.46])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA02946;
          Sun, 3 Jan 1999 16:59:24 -0800 (PST)
          (envelope-from ctapang@easystreet.com)
Received: from apex (216-99-199-226.cust.aracnet.com [216.99.199.226])
	by mail4.aracnet.com (8.9.1/8.9.0) with SMTP id QAA04416;
	Sun, 3 Jan 1999 16:59:01 -0800
Message-Id: <004801be3785$92b11750$0d787880@apex.tapang>
Date: Sun, 3 Jan 1999 17:57:23 -0800
From: "Carlos C. Tapang" <ctapang@easystreet.com>
To: <freebsd-gnats-submit@freebsd.org>
Cc: <freebsd-current@freebsd.org>
Subject: Fix for PR #i386/8567

>Number:         9299
>Category:       i386
>Synopsis:       Fix for PR #i386/8567
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan  3 17:00:01 PST 1999
>Closed-Date:    Sun Jan 3 19:50:55 PST 1999
>Last-Modified:  Wed Oct 26 05:40:34 GMT 2005
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 A couple of months ago I submitted a fix for the Intel Pro/10+ driver. I
 just noticed that the fix has not been committed yet. I cvsupped 1.13 of
 this driver, and here is the diff between that and my version of the driver.
 This version will correctly distinguish between Pro/10 and Pro/10+. If you
 have a Pro/10, please let me know if it worked for you.
 
 Carlos C. Tapang
 http://www.genericwindows.com
 
 ps. There are 2 diffs. One for if_ex.c and another for if_exreg.h
 
 ---------------------------------------
 Index: if_ex.c
 ===================================================================
 RCS file: /usr/CVSROOT/src/sys/i386/isa/if_ex.c,v
 retrieving revision 1.13
 diff -c -r1.13 if_ex.c
 *** if_ex.c 1998/10/22 05:58:39 1.13
 --- if_ex.c 1999/01/03 15:36:57
 ***************
 *** 23,30 ****
    * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
 WAY
    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
 -  *
 -  * $Id: if_ex.c,v 1.13 1998/10/22 05:58:39 bde Exp $
    */
 
   /*
 --- 23,28 ----
 ***************
 *** 43,57 ****
 --- 41,63 ----
 
   #include <sys/param.h>
   #include <sys/systm.h>
 + #include <sys/kernel.h>
   #include <sys/conf.h>
 + #include <sys/errno.h>
   #include <sys/sockio.h>
   #include <sys/mbuf.h>
   #include <sys/socket.h>
 + #include <sys/syslog.h>
 
   #include <net/if.h>
 + #include <net/if_dl.h>
 + #include <net/if_types.h>
 
   #ifdef INET
   #include <netinet/in.h>
 + #include <netinet/in_systm.h>
 + #include <netinet/in_var.h>
 + #include <netinet/ip.h>
   #include <netinet/if_ether.h>
   #endif
 
 ***************
 *** 67,72 ****
 --- 73,79 ----
 
   #if NBPFILTER > 0
   #include <net/bpf.h>
 + #include <net/bpfdesc.h>
   #endif
 
   #include <machine/clock.h>
 ***************
 *** 93,98 ****
 --- 100,106 ----
   struct ex_softc {
      struct arpcom arpcom; /* Ethernet common data */
    u_int iobase; /* I/O base address. */
 +  u_short chip_stepping; /* either TX or FX (FX is used in Pro/10+) */
    u_short connector; /* Connector type. */
    u_short irq_no; /* IRQ number. */
    char *irq2ee; /* irq <-> internal representation conversion */
 ***************
 *** 187,192 ****
 --- 195,204 ----
    outb(iobase + CMD_REG, Reset_CMD);
    DELAY(400);
 
 +  outb(iobase + CMD_REG, Bank2_Sel);
 +  tmp = inb(iobase + EEPROM_REG);
 +  sc->chip_stepping = (tmp & i82595_Stepping) >> 5;
 +
    /*
     * Fill in several fields of the softc structure:
     * - I/O base address.
 ***************
 *** 207,215 ****
    tmp = eeprom_read(iobase, EE_IRQ_No) & IRQ_No_Mask;
 
    /* work out which set of irq <-> internal tables to use */
 !  if (sc->arpcom.ac_enaddr[0] == 0x00 &&
 !      sc->arpcom.ac_enaddr[1] == 0xA0 &&
 !      sc->arpcom.ac_enaddr[2] == 0xC9) {    /* it's a 10+ */
     sc->irq2ee = plus_irq2eemap;
     sc->ee2irq = plus_ee2irqmap;
    } else {                                  /* it's an ordinary 10 */
 --- 219,225 ----
    tmp = eeprom_read(iobase, EE_IRQ_No) & IRQ_No_Mask;
 
    /* work out which set of irq <-> internal tables to use */
 !  if (sc->chip_stepping >= FX_Stepping) { /* it's a Pro/10 Plus */
     sc->irq2ee = plus_irq2eemap;
     sc->ee2irq = plus_ee2irqmap;
    } else {                                  /* it's an ordinary 10 */
 ***************
 *** 277,288 ****
    if_attach(ifp);
    ether_ifattach(ifp);
 
 !  if (sc->arpcom.ac_enaddr[0] == 0x00 &&
 !      sc->arpcom.ac_enaddr[1] == 0xA0 &&
 !      sc->arpcom.ac_enaddr[2] == 0xC9) {
 !   printf("ex%d: Intel EtherExpress Pro/10+, address %6D, connector ",
 dev->id_unit, sc->arpcom.ac_enaddr, ":");
    } else {
 !   printf("ex%d: Intel EtherExpress Pro/10, address %6D, connector ",
 dev->id_unit, sc->arpcom.ac_enaddr, ":");
    }
    switch(sc->connector) {
     case Conn_TPE: printf("TPE\n"); break;
 --- 287,296 ----
    if_attach(ifp);
    ether_ifattach(ifp);
 
 !  if (sc->chip_stepping >= FX_Stepping) {
 !   printf("ex%d: Intel EtherExpr Pro/10+, address %6D, step %d, connector
 ", dev->id_unit, sc->arpcom.ac_enaddr, ":", sc->chip_stepping);
    } else {
 !   printf("ex%d: Intel EtherExpress Pro/10, address %6D, step %d, connector
 ", dev->id_unit, sc->arpcom.ac_enaddr, ":", sc->chip_stepping);
    }
    switch(sc->connector) {
     case Conn_TPE: printf("TPE\n"); break;
 
 
 Index: if_exreg.h
 ===================================================================
 RCS file: /usr/CVSROOT/src/sys/i386/isa/if_exreg.h,v
 retrieving revision 1.1
 diff -c -r1.1 if_exreg.h
 *** if_exreg.h 1997/01/16 12:19:21 1.1
 --- if_exreg.h 1999/01/03 02:12:43
 ***************
 *** 121,126 ****
 --- 121,128 ----
   #define I_ADDR_REG0 4
   #define EEPROM_REG 10
   #define Trnoff_Enable 0x10
 + #define i82595_Stepping 0xE0
 + #define FX_Stepping 4
 
   /* EEPROM memory positions (16-bit wide). */
 
 
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Jan 3 19:50:55 PST 1999 
State-Changed-Why:  
Meant as a followup to 8567, where I have appended the contents of 
this PR. 
>Unformatted:
