...
Network interface number to get last known physical link state.
perr
p_err
Pointer to variable that will receive the return error code from this function:
...
Use NetIF_IO_Ctrl()
with option NET_IF_IO_CTRL_LINK_STATE_GET
to get a network interface’s current physical link state.
See section Ethernet PHY Link State for more information on how to get the Link State.