From e7206318fa5f4232deb03c87dee1071e92b8a72e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 30 May 2018 14:34:00 +0300 Subject: [PATCH] drivers: eth: mcux: Inform IP stack when carrier is lost If carrier is ON or OFF, then tell this information to upper IP stack so that it can act accordingly. Signed-off-by: Jukka Rissanen --- drivers/ethernet/eth_mcux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index d53423fa294..b369bbf003d 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -286,12 +286,14 @@ static void eth_mcux_phy_event(struct eth_context *context) kENET_MiiReadValidFrame); context->link_up = link_up; context->phy_state = eth_mcux_phy_state_read_duplex; + net_eth_carrier_on(context->iface); } else if (!link_up && context->link_up) { SYS_LOG_INF("Link down"); context->link_up = link_up; k_delayed_work_submit(&context->delayed_phy_work, CONFIG_ETH_MCUX_PHY_TICK_MS); context->phy_state = eth_mcux_phy_state_wait; + net_eth_carrier_off(context->iface); } else { k_delayed_work_submit(&context->delayed_phy_work, CONFIG_ETH_MCUX_PHY_TICK_MS);