Looking @ ethernet.cpp I am assuming it's because @ line 239 bEthLink is set to false, and the function is only called if it was set to true. Moving line 239 after the callback is executed solves the problem.
Before:
Code: Select all
...
else // There was no link detected
{
bEthLink = FALSE;
if( PHY_OUI_ID == DAVICOM_OUI_ID )
{
sim.fec.mdata = phy_read_mdata11; // Set to have read Davicom reg 0x11 in next check for parallel link fault ( Gigabit negotiation fix )
last_phy_read = 0x11;
}
else
{
sim.fec.mdata = phy_read_mdata1; // Set to read phy reg 1 for next link check
last_phy_read = 1;
}
if (bEthLink && EtherLinkCallback)
{
(*EtherLinkCallback)(FALSE);
}
}
...
Before:
Code: Select all
...
else // There was no link detected
{
if( PHY_OUI_ID == DAVICOM_OUI_ID )
{
sim.fec.mdata = phy_read_mdata11; // Set to have read Davicom reg 0x11 in next check for parallel link fault ( Gigabit negotiation fix )
last_phy_read = 0x11;
}
else
{
sim.fec.mdata = phy_read_mdata1; // Set to read phy reg 1 for next link check
last_phy_read = 1;
}
if (bEthLink && EtherLinkCallback)
{
(*EtherLinkCallback)(FALSE);
}
bEthLink = FALSE;
}
...