From nobody@FreeBSD.org  Tue Feb 12 21:38:48 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3AF8116A419
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Feb 2008 21:38:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 294C313C44B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Feb 2008 21:38:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1CLaWMc050503
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Feb 2008 21:36:32 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m1CLaWpv050502;
	Tue, 12 Feb 2008 21:36:32 GMT
	(envelope-from nobody)
Message-Id: <200802122136.m1CLaWpv050502@www.freebsd.org>
Date: Tue, 12 Feb 2008 21:36:32 GMT
From: Sean Bruno <sbruno@miralink.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Update dev id's for bge
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120569
>Category:       kern
>Synopsis:       [bge] [patch] Update dev id's for bge
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 12 21:40:02 UTC 2008
>Closed-Date:    Fri Jun 06 20:24:14 UTC 2008
>Last-Modified:  Fri Jun 06 20:24:14 UTC 2008
>Originator:     Sean Bruno
>Release:        RELENG_6
>Organization:
Miralink Inc
>Environment:
FreeBSD desdemona.office.miralink.com 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007     root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
>Description:
The IBM x3250 M comes with 2 Broadcom NIC's.  They appear to be completely
different chip sets!  Once of which is not supported by FreeBSD and one
that is.

The proposed patch adds support for the NIC's that does not work:

bge0@pci2:0:0:  class=0x020000 card=0x03781014 chip=0x165a14e4 rev=0x00 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'NetXtreme BCM5722 Gigabit Ethernet PCIe'
    class      = network
    subclass   = ethernet
    cap 01[48] = powerspec 3  supports D0 D3  current D0
    cap 03[50] = VPD
    cap 09[58] = vendor (length 120)
    cap 05[e8] = MSI supports 1 message, 64 bit 
    cap 10[d0] = PCI-Express 1 endpoint
bge1@pci3:1:0:  class=0x020000 card=0x026f1014 chip=0x16c714e4 rev=0x10 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'BCM5703A3 NetXtreme Gigabit Ethernet'
    class      = network
    subclass   = ethernet
    cap 07[40] = PCI-X 64-bit supports 133MHz, 2048 burst read, 1 split transaction
    cap 01[48] = powerspec 2  supports D0 D3  current D0
    cap 03[50] = VPD
    cap 05[58] = MSI supports 8 messages, 64 bit 

>How-To-Repeat:
Not applicable
>Fix:
Apply attached unified diff.

Patch attached with submission follows:

Index: /trunk/src/ankeny/src/FreeBSD_RELENG6/sys/dev/bge/if_bgereg.h
===================================================================
--- /trunk/src/ankeny/src/FreeBSD_RELENG6/sys/dev/bge/if_bgereg.h (revision 3333)
+++ /trunk/src/ankeny/src/FreeBSD_RELENG6/sys/dev/bge/if_bgereg.h (revision 5097)
@@ -278,4 +278,5 @@
 #define	BGE_CHIPID_BCM5755_A1		0xa0010000
 #define	BGE_CHIPID_BCM5755_A2		0xa0020000
+#define	BGE_CHIPID_BCM5722_A2		0xa2000000
 #define	BGE_CHIPID_BCM5754_A0		0xb0000000
 #define	BGE_CHIPID_BCM5754_A1		0xb0010000
@@ -2010,4 +2011,5 @@
 #define	BCOM_DEVICEID_BCM5720		0x1658
 #define	BCOM_DEVICEID_BCM5721		0x1659
+#define	BCOM_DEVICEID_BCM5722		0x165A
 #define	BCOM_DEVICEID_BCM5750		0x1676
 #define	BCOM_DEVICEID_BCM5750M		0x167C
Index: /trunk/src/ankeny/src/FreeBSD_RELENG6/sys/dev/bge/if_bge.c
===================================================================
--- /trunk/src/ankeny/src/FreeBSD_RELENG6/sys/dev/bge/if_bge.c (revision 3457)
+++ /trunk/src/ankeny/src/FreeBSD_RELENG6/sys/dev/bge/if_bge.c (revision 5097)
@@ -163,4 +163,5 @@
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5720 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5721 },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5722 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5750 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5750M },
@@ -241,4 +242,5 @@
 	{ BGE_CHIPID_BCM5705_A2,	"BCM5705 A2" },
 	{ BGE_CHIPID_BCM5705_A3,	"BCM5705 A3" },
+	{ BGE_CHIPID_BCM5722_A2,	"BCM5722 A2" },
 	{ BGE_CHIPID_BCM5750_A0,	"BCM5750 A0" },
 	{ BGE_CHIPID_BCM5750_A1,	"BCM5750 A1" },



>Release-Note:
>Audit-Trail:

From: Sean Bruno <sbruno@miralink.com>
To: bug-followup@FreeBSD.org, sbruno@miralink.com
Cc:  
Subject: Re: kern/120569: [bge] [patch] Update dev id's for bge
Date: Tue, 12 Feb 2008 14:18:55 -0800

 This is a multi-part message in MIME format.
 --------------030009000500040406010701
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I forgot to include this change for mii_physubr.c
 
 Apparently this adapter reports ife->ifm_data as == MII_NMEDIA
 
 Not sure if that is a bug or how it should be, but this is required 
 along with the previous patch.
 
 Sean
 
 --------------030009000500040406010701
 Content-Type: text/x-patch;
  name="mii.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="mii.diff"
 
 Index: /branches/miralink.FreeBSD.6/src/sys/dev/mii/mii_physubr.c
 ===================================================================
 --- /branches/miralink.FreeBSD.6/src/sys/dev/mii/mii_physubr.c (revision 3333)
 +++ /branches/miralink.FreeBSD.6/src/sys/dev/mii/mii_physubr.c (revision 5102)
 @@ -121,11 +121,11 @@
  
  	/*
  	 * Table index is stored in the media entry.
  	 */
  
 -	KASSERT(ife->ifm_data >=0 && ife->ifm_data < MII_NMEDIA,
 +	KASSERT(ife->ifm_data >=0 && ife->ifm_data <= MII_NMEDIA,
  	    ("invalid ife->ifm_data (0x%x) in mii_phy_setmedia",
  	    ife->ifm_data));
  
  	anar = mii_media_table[ife->ifm_data].mm_anar;
  	bmcr = mii_media_table[ife->ifm_data].mm_bmcr;
 
 
 --------------030009000500040406010701--
Responsible-Changed-From-To: freebsd-bugs->remko 
Responsible-Changed-By: remko 
Responsible-Changed-When: Wed Feb 13 06:39:40 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120569 
State-Changed-From-To: open->patched 
State-Changed-By: remko 
State-Changed-When: Fri Mar 7 14:31:53 UTC 2008 
State-Changed-Why:  
John patched this in -CURRENT (thanks!), bring this ticket 
over to him as MFC reminder or to close. 


Responsible-Changed-From-To: remko->jhb 
Responsible-Changed-By: remko 
Responsible-Changed-When: Fri Mar 7 14:31:53 UTC 2008 
Responsible-Changed-Why:  
John patched this in -CURRENT (thanks!), bring this ticket 
over to him as MFC reminder or to close. 

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

From: Gavin Atkinson <gavin@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: Sean Bruno <sbruno@miralink.com>
Subject: Re: kern/120569: [bge] [patch] Update dev id's for bge
Date: Fri, 06 Jun 2008 19:15:59 +0100

 As far as I can tell, this has been fixed and merged to all supported
 branches, however I'm reluctant to just close it, as the PHY fix has
 been done differently to the suggestion in the PR.  Although I'm pretty
 sure the in-tree fix is the correct one, submitter:  can you confirm
 that this works for you with 6-STABLE or 7-STABLE from after March 17th
 2008?
State-Changed-From-To: patched->closed 
State-Changed-By: gavin 
State-Changed-When: Fri Jun 6 20:22:07 UTC 2008 
State-Changed-Why:  
Submitter confirms that the version in RELENG_6/7 works for 
them, so this can be closed.  Thanks! 

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