From owner-svn-src-stable@FreeBSD.ORG Wed Mar 18 03:33:45 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B58CC106566C; Wed, 18 Mar 2009 03:33:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87B1D8FC17; Wed, 18 Mar 2009 03:33:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2I3Xj5O014458; Wed, 18 Mar 2009 03:33:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2I3Xj2L014457; Wed, 18 Mar 2009 03:33:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903180333.n2I3Xj2L014457@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 18 Mar 2009 03:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189953 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 03:33:46 -0000 Author: yongari Date: Wed Mar 18 03:33:45 2009 New Revision: 189953 URL: http://svn.freebsd.org/changeset/base/189953 Log: MFC r189566: Use mii_phy_add_media() and remove setting each media type. While I'm here, don't set mii_anegticks as it's set by mii_phy_add_media(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:31:19 2009 (r189952) +++ stable/7/sys/dev/mii/ip1000phy.c Wed Mar 18 03:33:45 2009 (r189953) @@ -118,7 +118,6 @@ ip1000phy_attach(device_t dev) sc->mii_phy = ma->mii_phyno; sc->mii_service = ip1000phy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_NOISOLATE; mii->mii_instance++; @@ -126,37 +125,14 @@ ip1000phy_attach(device_t dev) isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + if (sc->mii_capabilities & BMSR_EXTSTAT) + sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), - IP1000PHY_BMCR_10); - printf("10baseT, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_10 | IP1000PHY_BMCR_FDX); - printf("10baseT-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), - IP1000PHY_BMCR_100); - printf("100baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_100 | IP1000PHY_BMCR_FDX); - printf("100baseTX-FDX, "); - /* 1000baseT half-duplex, really supported? */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), - IP1000PHY_BMCR_1000); - printf("1000baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_1000 | IP1000PHY_BMCR_FDX); - printf("1000baseTX-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0); - printf("auto\n"); -#undef ADD - ip1000phy_reset(sc); + mii_phy_add_media(sc); + printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); return(0);