Date: Tue, 21 Apr 2015 08:54:15 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281819 - head/sys/dev/mii Message-ID: <201504210854.t3L8sFOi024298@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504210854.t3L8sFOi024298>