diff --git a/eth_interface.c b/eth_interface.c index 33e48f0..c3b84b3 100644 --- a/eth_interface.c +++ b/eth_interface.c @@ -212,7 +212,10 @@ bool ethinf_get_link_state(EthInterface *intf) { void ethinf_up(EthInterface *intf) { intf->up = true; - // TODO: check PHY link state + // trigger a link change interrupt to query link state + if (intf->ioDef->llTrigLinkChg != NULL) { + intf->ioDef->llTrigLinkChg(intf->ioDef); + } } void ethinf_down(EthInterface *intf) { diff --git a/eth_interface.h b/eth_interface.h index dec04d0..cf07233 100644 --- a/eth_interface.h +++ b/eth_interface.h @@ -22,6 +22,7 @@ typedef struct EthIODef_ { int (*llTxTrigger)(struct EthIODef_ *io, MsgQueue *mq); ///< Function pointer to low-level transmit function trigger int (*llTxDone)(struct EthIODef_ *io, const RawPckt *rawPckt); ///< Transmission done (interrupt) callback int (*llLinkChg)(struct EthIODef_ *io, int linkState, uint16_t speed, bool duplex); ///< Link change interrupt + int (*llTrigLinkChg)(struct EthIODef_ *io); ///< Trigger a link change interrupt callback int (*llRxStore)(struct EthIODef_ *io, const RawPckt *rawPckt); ///< Receive done callback int (*llError)(struct EthIODef_ *io, int error); ///< Low-level error interrupt int (*llRxRead)(struct EthIODef_ *io); ///< Read received packets