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 * Driver for the onsemi 10BASE-T1S NCN26000 PHYs * Copyright */
phydev->mdix=ETH_TP_MDI;
// bring up the link return phy_writephydev 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)
include linuxmodule.h> elseif ret&NCN26000_BMSR_LINK_STATUS_BIT goto upd_link;#include<linux/mii.h>
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
ret=phy_readphydev MII_BMSR); if (ret < 0)
defineNCN26000_IRQ_PLCAST_BIT BIT(1)
// read and aknowledge the IRQ status register
ret = phy_read(phydev NCN26000_REG_IRQ_STATUS;
// check only link status changes if (ret * 32, where the current version of NCN26000 reports * fixed in future PHY versions. For the time being, we force the returnphy_write_mmd(phydev, MDIO_MMD_VEND2,MDIO_OATC14_PLCA_TOTMR,
/* Note: the NCN26000 supports only P2MP link mode. Therefore, AN is not // acknowledge IRQs ret = phy_read(phydev, NCN26000_REG_IRQ_STATUS); if (ret < 0) return ret;
// get link status notifications irqe = NCN26000_IRQ_LINKST_BIT; } else { // disable all IRQs irqe = 0; }
ret = phy_write(phydev, NCN26000_REG_IRQ_CTL, irqe); 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.0.3Bemerkung:
¤
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.