From owner-svn-src-head@FreeBSD.ORG Thu Dec 20 05:02:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7EEA7F7; Thu, 20 Dec 2012 05:02:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B31458FC13; Thu, 20 Dec 2012 05:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBK52Dv2073648; Thu, 20 Dec 2012 05:02:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBK52Dj6073645; Thu, 20 Dec 2012 05:02:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201212200502.qBK52Dj6073645@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 20 Dec 2012 05:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244482 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2012 05:02:14 -0000 Author: yongari Date: Thu Dec 20 05:02:12 2012 New Revision: 244482 URL: http://svnweb.freebsd.org/changeset/base/244482 Log: 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. Tested by: Geans Pin < geanspin <> broadcom dot com > Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Thu Dec 20 04:47:31 2012 (r244481) +++ head/sys/dev/mii/brgphy.c Thu Dec 20 05:02:12 2012 (r244482) @@ -204,6 +204,13 @@ brgphy_attach(device_t dev) &brgphy_funcs, 0); bsc->serdes_flags = 0; + 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; /* Handle any special cases based on the PHY ID */ switch (sc->mii_mpd_oui) { @@ -235,22 +242,21 @@ brgphy_attach(device_t dev) sc->mii_flags |= MIIF_HAVEFIBER; break; case MII_MODEL_BROADCOM2_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; - } - PHY_RESET(sc); /* Read the PHY's capabilities. */ Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Thu Dec 20 04:47:31 2012 (r244481) +++ head/sys/dev/mii/miidevs Thu Dec 20 05:02:12 2012 (r244482) @@ -180,7 +180,7 @@ model BROADCOM2 BCM5722 0x002d BCM5722 model BROADCOM2 BCM5784 0x003a BCM5784 10/100/1000baseT PHY model BROADCOM2 BCM5709C 0x003c BCM5709 10/100/1000baseT PHY model BROADCOM2 BCM5761 0x003d BCM5761 10/100/1000baseT PHY -model BROADCOM2 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY +model BROADCOM2 BCM5709S 0x003f BCM5709S/5720S 1000/2500baseSX PHY model BROADCOM3 BCM57780 0x0019 BCM57780 1000BASE-T media interface model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T media interface model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface