svn commit: r281819 - head/sys/dev/mii
Gleb Smirnoff
glebius at FreeBSD.org
Tue Apr 21 08:54:15 UTC 2015
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);
More information about the svn-src-head
mailing list