staticint ncn26000_config_init(struct phy_device *phydev)
{ /* HW bug workaround: the default value of the PLCA TO_TIMER should be * 32, where the current version of NCN26000 reports 24. This will be * fixed in future PHY versions. For the time being, we force the * correct default here.
*/ return phy_write_mmd(phydev, MDIO_MMD_VEND2, MDIO_OATC14_PLCA_TOTMR,
TO_TMR_DEFAULT);
}
staticint ncn26000_config_aneg(struct phy_device *phydev)
{ /* Note: the NCN26000 supports only P2MP link mode. Therefore, AN is not * supported. However, this function is invoked by phylib to enable the * PHY, regardless of the AN support.
*/
phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
phydev->mdix = ETH_TP_MDI;
// bring up the link return phy_write(phydev, MII_BMCR, NCN26000_BCMR_LINK_CTRL_BIT);
}
staticint ncn26000_read_status(struct phy_device *phydev)
{ /* The NCN26000 reports NCN26000_LINK_STATUS_BIT if the link status of * the PHY is up. It further reports the logical AND of the link status * and the PLCA status in the BMSR_LSTATUS bit.
*/ int ret;
/* The link state is latched low so that momentary link * drops can be detected. Do not double-read the status * in polling mode to detect such short link drops except * the link was already down.
*/ if (!phy_polling_mode(phydev) || !phydev->link) {
ret = phy_read(phydev, MII_BMSR); if (ret < 0) return ret; elseif (ret & NCN26000_BMSR_LINK_STATUS_BIT) goto upd_link;
}
ret = phy_read(phydev, MII_BMSR); if (ret < 0) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.