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.
This commit is contained in:
Gleb Smirnoff 2015-04-21 08:54:14 +00:00
parent 2eba9bbe06
commit ac55afa3ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281819

View file

@ -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);