- EthIntf: checking line status on enabling an interface added

- IODef: llTrigLinkChg added
This commit is contained in:
Wiesner András 2024-06-19 16:55:51 +02:00
parent bb7a8e1f16
commit db50beb71a
2 changed files with 5 additions and 1 deletions

View File

@ -212,7 +212,10 @@ bool ethinf_get_link_state(EthInterface *intf) {
void ethinf_up(EthInterface *intf) { void ethinf_up(EthInterface *intf) {
intf->up = true; 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) { void ethinf_down(EthInterface *intf) {

View File

@ -22,6 +22,7 @@ typedef struct EthIODef_ {
int (*llTxTrigger)(struct EthIODef_ *io, MsgQueue *mq); ///< Function pointer to low-level transmit function trigger 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 (*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 (*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 (*llRxStore)(struct EthIODef_ *io, const RawPckt *rawPckt); ///< Receive done callback
int (*llError)(struct EthIODef_ *io, int error); ///< Low-level error interrupt int (*llError)(struct EthIODef_ *io, int error); ///< Low-level error interrupt
int (*llRxRead)(struct EthIODef_ *io); ///< Read received packets int (*llRxRead)(struct EthIODef_ *io); ///< Read received packets