svn commit: r245866 - stable/8/sys/dev/mii

Pyun YongHyeon yongari at FreeBSD.org
Thu Jan 24 02:20:26 UTC 2013


Author: yongari
Date: Thu Jan 24 02:20:25 2013
New Revision: 245866
URL: http://svnweb.freebsd.org/changeset/base/245866

Log:
  MFC r244482:
    Recognize 5720S PHY and treat it as 5708S PHY.
    Unfortunately 5720S uses 5709S PHY id so add a hack to detect 5720S
    PHY by checking parent device name.  5720S PHY does not support 2500SX.

Modified:
  stable/8/sys/dev/mii/brgphy.c
  stable/8/sys/dev/mii/miidevs
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/mii/brgphy.c
==============================================================================
--- stable/8/sys/dev/mii/brgphy.c	Thu Jan 24 02:19:38 2013	(r245865)
+++ stable/8/sys/dev/mii/brgphy.c	Thu Jan 24 02:20:25 2013	(r245866)
@@ -217,11 +217,18 @@ brgphy_attach(device_t dev)
 	bsc->mii_model = MII_MODEL(ma->mii_id2);
 	bsc->mii_rev = MII_REV(ma->mii_id2);
 	bsc->serdes_flags = 0;
+	ifp = sc->mii_pdata->mii_ifp;
 
 	if (bootverbose)
 		device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n",
 		    bsc->mii_oui, bsc->mii_model, bsc->mii_rev);
 
+	/* Find the MAC driver associated with this PHY. */
+	if (strcmp(ifp->if_dname, "bge") == 0)
+		bge_sc = ifp->if_softc;
+	else if (strcmp(ifp->if_dname, "bce") == 0)
+		bce_sc = ifp->if_softc;
+
 	/* Handle any special cases based on the PHY ID */
 	switch (bsc->mii_oui) {
 	case MII_OUI_xxBROADCOM:
@@ -252,22 +259,21 @@ brgphy_attach(device_t dev)
 			sc->mii_flags |= MIIF_HAVEFIBER;
 			break;
 		case MII_MODEL_xxBROADCOM_ALT1_BCM5709S:
-			bsc->serdes_flags |= BRGPHY_5709S;
+			/*
+			 * XXX
+			 * 5720S and 5709S shares the same PHY id.
+			 * Assume 5720S PHY if parent device is bge(4).
+			 */
+			if (bge_sc != NULL)
+				bsc->serdes_flags |= BRGPHY_5708S;
+			else
+				bsc->serdes_flags |= BRGPHY_5709S;
 			sc->mii_flags |= MIIF_HAVEFIBER;
 			break;
 		}
 		break;
 	}
 
-	ifp = sc->mii_pdata->mii_ifp;
-
-	/* Find the MAC driver associated with this PHY. */
-	if (strcmp(ifp->if_dname, "bge") == 0)	{
-		bge_sc = ifp->if_softc;
-	} else if (strcmp(ifp->if_dname, "bce") == 0) {
-		bce_sc = ifp->if_softc;
-	}
-
 	brgphy_reset(sc);
 
 	/* Read the PHY's capabilities. */

Modified: stable/8/sys/dev/mii/miidevs
==============================================================================
--- stable/8/sys/dev/mii/miidevs	Thu Jan 24 02:19:38 2013	(r245865)
+++ stable/8/sys/dev/mii/miidevs	Thu Jan 24 02:20:25 2013	(r245866)
@@ -156,7 +156,7 @@ model xxBROADCOM_ALT1 BCM5722	0x002d BCM
 model xxBROADCOM_ALT1 BCM5784	0x003a BCM5784 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5709C	0x003c BCM5709C 10/100/1000baseTX PHY
 model xxBROADCOM_ALT1 BCM5761	0x003d BCM5761 10/100/1000baseTX PHY
-model xxBROADCOM_ALT1 BCM5709S	0x003f BCM5709S 1000/2500baseSX PHY
+model xxBROADCOM_ALT1 BCM5709S	0x003f BCM5709S/5720S 1000/2500baseSX PHY
 model xxBROADCOM_ALT2 BCM57780	0x0019 BCM57780 1000BASE-T media interface
 model xxBROADCOM_ALT2 BCM5717C	0x0020 BCM5717C 10/100/1000baseTX PHY
 model xxBROADCOM_ALT2 BCM5719C	0x0022 BCM5719C 10/100/1000baseTX PHY


More information about the svn-src-all mailing list