Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Oct 2010 23:24:58 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213465 - head/sys/dev/bge
Message-ID:  <201010052324.o95NOwFx075777@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Tue Oct  5 23:24:58 2010
New Revision: 213465
URL: http://svn.freebsd.org/changeset/base/213465

Log:
  Rearrange code a bit to correctly set PHY flags. This change make
  it easy to add more newer ASICs.
  
  Obtained from:	OpenBSD

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Tue Oct  5 23:03:48 2010	(r213464)
+++ head/sys/dev/bge/if_bge.c	Tue Oct  5 23:24:58 2010	(r213465)
@@ -2558,10 +2558,10 @@ bge_attach(device_t dev)
 		sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG;
 	if (pci_get_subvendor(dev) == DELL_VENDORID)
 		sc->bge_phy_flags |= BGE_PHY_NO_3LED;
-	if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M)
-		sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM;
-	if (BGE_IS_5705_PLUS(sc) &&
-	    !(sc->bge_phy_flags & BGE_PHY_ADJUST_TRIM)) {
+	if ((BGE_IS_5705_PLUS(sc)) &&
+	    sc->bge_asicrev != BGE_ASICREV_BCM5906 &&
+	    sc->bge_asicrev != BGE_ASICREV_BCM5785 &&
+	    sc->bge_asicrev != BGE_ASICREV_BCM57780) {
 		if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
 		    sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
 		    sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
@@ -2569,7 +2569,9 @@ bge_attach(device_t dev)
 			if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 &&
 			    pci_get_device(dev) != BCOM_DEVICEID_BCM5756)
 				sc->bge_phy_flags |= BGE_PHY_JITTER_BUG;
-		} else if (sc->bge_asicrev != BGE_ASICREV_BCM5906)
+			if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M)
+				sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM;
+		} else
 			sc->bge_phy_flags |= BGE_PHY_BER_BUG;
 	}
 



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