From ea652f9abaee4ba1f1b760a430f9e2b6d1c4ed67 Mon Sep 17 00:00:00 2001 From: Sam Grove Date: Fri, 12 Jun 2015 09:20:18 +0100 Subject: [PATCH] Update k64f_emac.c process all available packets at once. Because the interrupt handler is triggered at an interval and multiple packets could have been received during that interval. Fix from private fork by Liyou Zhou --- libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c b/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c index 482cd79595..a2ec35c39a 100644 --- a/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c +++ b/libraries/net/eth/lwip-eth/arch/TARGET_Freescale/k64f_emac.c @@ -540,7 +540,7 @@ static void packet_rx(void* pvParameters) { /* Wait for receive task to wakeup */ sys_arch_sem_wait(&k64f_enet->RxReadySem, 0); - if ((bdPtr[idx].control & kEnetRxBdEmpty) == 0) { + while ((bdPtr[idx].control & kEnetRxBdEmpty) == 0) { k64f_enetif_input(k64f_enet->netif, idx); idx = (idx + 1) % ENET_RX_RING_LEN; }