From ac55afa3ca722bf3dc3721c6652dc46c4c2d2b9d Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 21 Apr 2015 08:54:14 +0000 Subject: [PATCH] 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. --- sys/dev/mii/mlphy.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c index fbb34819a96d..89b4f2cc0b48 100644 --- a/sys/dev/mii/mlphy.c +++ b/sys/dev/mii/mlphy.c @@ -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);