DRV_ETHPHY_LinkStatusGet Function

C

DRV_ETHPHY_RESULT DRV_ETHPHY_LinkStatusGet(DRV_HANDLE handle, DRV_ETHPHY_INTERFACE_INDEX portIndex, DRV_ETHPHY_LINK_STATUS* pLinkStat, bool refresh); 

Returns

  • DRV_ETHPHY_RES_PENDING for ongoing, in progress operation

  • an DRV_ETHPHY_RESULT error code if the link status get procedure failed.

Description

This function returns the current link status.

Remarks

This function reads the Ethernet PHY to get current link status. If refresh is specified then, if the link is down a second read will be performed to return the current link status. Use DRV_ETHPHY_ClientStatus() and DRV_ETHPHY_ClientOperationResult() to check when the operation was completed and its outcome.

Preconditions

  • The DRV_ETHPHY_Initialize routine must have been called.

  • DRV_ETHPHY_Open must have been called to obtain a valid device handle.

  • DRV_ETHPHY_Setup must have been called to properly configure the PHY