From owner-svn-src-all@FreeBSD.ORG Tue Apr 21 08:54:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CEB87C9; Tue, 21 Apr 2015 08:54:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 601C21885; Tue, 21 Apr 2015 08:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3L8sFte024299; Tue, 21 Apr 2015 08:54:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3L8sFOi024298; Tue, 21 Apr 2015 08:54:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201504210854.t3L8sFOi024298@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 21 Apr 2015 08:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281819 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 08:54:15 -0000 Author: glebius Date: Tue Apr 21 08:54:14 2015 New Revision: 281819 URL: https://svnweb.freebsd.org/changeset/base/281819 Log: The comment on BMCR data in if_media entry is wrong. The ifm_data stores the index array, not a value for BMCR register. In case of IFM_10_T there could be either MII_MEDIA_10_T or MII_MEDIA_10_T_FDX, which are 1 and 2, accordingly. Neither matches a valid BMCR value. My guessing is that this write is harmless, since later mii_phy_setmedia() would write a proper value there. The code is here since the initial checkin. Note that case IFM_100_TX has the same comment, but a proper value of BMCR_ISO is written. So, collapse two cases into one, always writing there BMCR_ISO. Sponsored by: Nginx, Inc. Modified: head/sys/dev/mii/mlphy.c Modified: head/sys/dev/mii/mlphy.c ============================================================================== --- head/sys/dev/mii/mlphy.c Tue Apr 21 08:47:27 2015 (r281818) +++ head/sys/dev/mii/mlphy.c Tue Apr 21 08:54:14 2015 (r281819) @@ -220,29 +220,11 @@ mlphy_service(xsc, mii, cmd) msc->ml_linked = 0; return (0); case IFM_10_T: - /* - * For 10baseT modes, reset and program the - * companion PHY (of any), then program ourselves - * to match. This will put us in pass-through - * mode and let the companion PHY do all the - * work. - * - * BMCR data is stored in the ifmedia entry. - */ - if (other != NULL) { - PHY_RESET(other); - PHY_WRITE(other, MII_BMCR, ife->ifm_data); - } - mii_phy_setmedia(sc); - msc->ml_state = 0; - break; case IFM_100_TX: /* - * For 100baseTX modes, reset and isolate the - * companion PHY (if any), then program ourselves + * For 10baseT and 100baseTX modes, reset and isolate + * the companion PHY (if any), then program ourselves * accordingly. - * - * BMCR data is stored in the ifmedia entry. */ if (other != NULL) { PHY_RESET(other);