static irqreturn_t lxt970_handle_interrupt(struct phy_device *phydev)
{ int irq_status;
/* The interrupt status register is cleared by reading BMSR * followed by MII_LXT970_ISR
*/
irq_status = phy_read(phydev, MII_BMSR); if (irq_status < 0) {
phy_error(phydev); return IRQ_NONE;
}
if (!(irq_status & MII_LXT971_ISR_MASK)) return IRQ_NONE;
phy_trigger_machine(phydev);
return IRQ_HANDLED;
}
/* * A2 version of LXT973 chip has an ERRATA: it randomly return the contents * of the previous even register when you read a odd register regularly
*/
staticint lxt973a2_update_link(struct phy_device *phydev)
{ int status; int control; int retry = 8; /* we try 8 times */
/* Do a fake read */
status = phy_read(phydev, MII_BMSR);
if (status < 0) return status;
control = phy_read(phydev, MII_BMCR); if (control < 0) return control;
do { /* Read link and autonegotiation status */
status = phy_read(phydev, MII_BMSR);
} while (status >= 0 && retry-- && status == control);
staticint lxt973_probe(struct phy_device *phydev)
{ int val = phy_read(phydev, MII_LXT973_PCR);
if (val & PCR_FIBER_SELECT) { /* * If fiber is selected, then the only correct setting * is 100Mbps, full duplex, and auto negotiation off.
*/
val = phy_read(phydev, MII_BMCR);
val |= (BMCR_SPEED100 | BMCR_FULLDPLX);
val &= ~BMCR_ANENABLE;
phy_write(phydev, MII_BMCR, val); /* Remember that the port is in fiber mode. */
phydev->priv = lxt973_probe;
phydev->port = PORT_FIBRE;
} else {
phydev->priv = NULL;
} return 0;
}
staticint lxt973_config_aneg(struct phy_device *phydev)
{ /* Do nothing if port is in fiber mode. */ return phydev->priv ? 0 : genphy_config_aneg(phydev);
}
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.