From nobody@www.freebsd.org  Fri Jun  7 09:42:33 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 3E4BB37B401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  7 Jun 2002 09:42:33 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g57GgWhG032984
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 7 Jun 2002 09:42:32 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g57GgWb4032983;
	Fri, 7 Jun 2002 09:42:32 -0700 (PDT)
Message-Id: <200206071642.g57GgWb4032983@www.freebsd.org>
Date: Fri, 7 Jun 2002 09:42:32 -0700 (PDT)
From: David Mansell <davidm@nsell.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: New Netgear GA302-T has different PCI ID to what the bge(4) driver expects
X-Send-Pr-Version: www-1.0

>Number:         38988
>Category:       kern
>Synopsis:       New Netgear GA302-T has different PCI ID to what the bge(4) driver expects
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jdp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 07 09:50:01 PDT 2002
>Closed-Date:    Thu Jul 25 20:51:43 PDT 2002
>Last-Modified:  Thu Jul 25 20:51:43 PDT 2002
>Originator:     David Mansell
>Release:        4.6-RC3
>Organization:
N/A
>Environment:
FreeBSD ice.storm 4.6-RC3 FreeBSD 4.6-RC3 #0: Mon Jun  3 23:47:06 BST 2002     davidm@ice.storm:/usr/obj/usr/src/sys/ICE  i386

>Description:
I recently bought a Netgear GA302-T Gigabit Ethernet card.  FreeBSD refused to recognise it and investigation revealed that the PCI ID of my card differs from what the driver expects.  I manually changed the PCI ID in the driver and the card now appears to work.

pciconf -lv gives:

bge0@pci0:15:0: class=0x020000 card=0x302a1385 chip=0x03ea173b rev=0x15 hdr=0x00
    class    = network
    subclass = ethernet

And from the (unmodified) /usr/src/sys/dev/bge/if_bgereg.h file:

/*
 * Altima PCI vendor/device ID.
 */
#define ALTIMA_VENDORID                 0x173b
#define ALTIMA_DEVICE_AC1000            0x03e8

I guess it's a slightly different chip; just hacking ALTIMA_DEVICE_AC1000 to 0x03ea made the driver start working but a proper fix might be more work.
>How-To-Repeat:
I imagine the problem applies to any new GA302-T cards.
>Fix:
Update the driver to correctly deal with cards with the "new" ID :)
>Release-Note:
>Audit-Trail:

From: Brad Chapman <chapmanb@arches.uga.edu>
To: freebsd-gnats-submit@FreeBSD.org, davidm@nsell.org
Cc:  
Subject: Re: kern/38988: New Netgear GA302-T has different PCI ID to what the bge(4) driver expects
Date: Sun, 21 Jul 2002 19:28:07 -0400

 --bg08WKrSYDhXBjb5
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hello;
 I would just like to confirm the bug report in kern/38988; I set 
 up FreeBSD 4.6 on a new machine with a Netgear GA302-T card, and 
 the bge driver did not recognize it. Attached are two patches, to 
 /usr/src/sys/dev/bge/if_bge.c and if_bgereg.h, which fix the problem 
 and should be back-compatible to cards with different device ids. 
 Hope this helps!
 
 Brad
 
 --bg08WKrSYDhXBjb5
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="if_bgereg.h.diff"
 
 *** if_bgereg.h.orig	Sun Jun 30 13:43:44 2002
 --- if_bgereg.h	Sun Jul 21 19:16:49 2002
 ***************
 *** 1813,1818 ****
 --- 1813,1824 ----
   #define ALTIMA_DEVICE_AC1000		0x03e8
   
   /*
 +  * Netgear vendor/device ID.
 +  */
 + #define NETGEAR_VENDORID		0x173b
 + #define NETGEAR_DEVICE_GA302T	 	0x03ea			
 + 
 + /*
    * Offset of MAC address inside EEPROM.
    */
   #define BGE_EE_MAC_OFFSET		0x7C
 
 --bg08WKrSYDhXBjb5
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="if_bge.c.diff"
 
 *** if_bge.c.orig	Wed Apr 24 00:22:13 2002
 --- if_bge.c	Thu Jul 18 16:26:11 2002
 ***************
 *** 143,148 ****
 --- 143,150 ----
   		"SysKonnect Gigabit Ethernet" },
   	{ ALTIMA_VENDORID, ALTIMA_DEVICE_AC1000,
   		"Altima AC1000 Gigabit Ethernet" },
 + 	{ NETGEAR_VENDORID, NETGEAR_DEVICE_GA302T,
 + 		"Netgear GA302T Gigabit Ethernet" },
   	{ 0, 0, NULL }
   };
   
 
 --bg08WKrSYDhXBjb5--
Responsible-Changed-From-To: freebsd-bugs->jdp 
Responsible-Changed-By: jdp 
Responsible-Changed-When: Wed Jul 24 18:12:37 PDT 2002 
Responsible-Changed-Why:  
I have been working on this driver, so I'll take care of this fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38988 

From: John Polstra <jdp@polstra.com>
To: freebsd-gnats-submit@freebsd.org
Cc: chapmanb@arches.uga.edu
Subject: Re: kern/38988: New Netgear GA302-T has different PCI ID to what the bge(4) driver expects
Date: Wed, 24 Jul 2002 18:27:44 -0700 (PDT)

 In article <200207212330.g6LNU4bg065900@freefall.freebsd.org>,
 Brad Chapman  <chapmanb@arches.uga.edu> wrote:
 >  I would just like to confirm the bug report in kern/38988; I set 
 >  up FreeBSD 4.6 on a new machine with a Netgear GA302-T card, and 
 >  the bge driver did not recognize it. Attached are two patches, to 
 >  /usr/src/sys/dev/bge/if_bge.c and if_bgereg.h, which fix the problem 
 >  and should be back-compatible to cards with different device ids. 
 
 Thanks for the patch.  I'll put it or something similar into the
 driver.  My only concern about your patch is the naming of the defines
 and the identification strings for the new PCI IDs.  The original PCI
 ID in the driver was also from a GA302-T.  Netgear must have switched
 to a newer revision of the Altima chip, or else changed the PCI ID
 some other way.  I'd like to use a naming convention that will reflect
 that.
 
 On your card, what does the lettering on the Altima chip (the biggest
 chip) say?  Mine says:
 
     AC1000KPB
     TN0117 P23
     56238 N
 
 Also, on the non-component side of the card, look for the board
 revision.  Mine says:
 
     GA302T Rev-A1
 
 Hopefully one or more of your numbers will be different, and we can
 use those to form the symbol names for the PCI IDs.
 
 John
State-Changed-From-To: open->closed 
State-Changed-By: jdp 
State-Changed-When: Thu Jul 25 20:47:32 PDT 2002 
State-Changed-Why:  
I have committed Brad's fix to -current and will merge it to -stable 
in 2 days.  From web searches it appears that the chip used in the 
current GA302-T boards is the Altima AC9100.  I changed the symbolic 
names and ID string in the patch accordingly. 

The revisions with the fix are: 

1.18      src/sys/dev/bge/if_bge.c 
1.6       src/sys/dev/bge/if_bgereg.h 

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