From d63ec65663d6c390149f7c71f6052ea2fb28c1b3 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 30 Oct 2023 16:36:35 -0300 Subject: [PATCH] honor ifp->nerr --- src/drivers/stm32h.c | 1 + src/drivers/tm4c.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/drivers/stm32h.c b/src/drivers/stm32h.c index 2567f95d..a3113342 100644 --- a/src/drivers/stm32h.c +++ b/src/drivers/stm32h.c @@ -213,6 +213,7 @@ static size_t mg_tcpip_driver_stm32h_tx(const void *buf, size_t len, MG_ERROR(("Frame too big, %ld", (long) len)); len = 0; // Frame is too big } else if ((s_txdesc[s_txno][3] & BIT(31))) { + ifp->nerr++; MG_ERROR(("No free descriptors: %u %08X %08X %08X", s_txno, s_txdesc[s_txno][3], ETH->DMACSR, ETH->DMACTCR)); for (int i = 0; i < ETH_DESC_CNT; i++) MG_ERROR(("%08X", s_txdesc[i][3])); diff --git a/src/drivers/tm4c.c b/src/drivers/tm4c.c index 61bd5b0e..b1f0cd3b 100644 --- a/src/drivers/tm4c.c +++ b/src/drivers/tm4c.c @@ -188,6 +188,7 @@ static size_t mg_tcpip_driver_tm4c_tx(const void *buf, size_t len, MG_ERROR(("Frame too big, %ld", (long) len)); len = 0; // fail } else if ((s_txdesc[s_txno][0] & BIT(31))) { + ifp->nerr++; MG_ERROR(("No descriptors available")); // printf("D0 %lx SR %lx\n", (long) s_txdesc[0][0], (long) // EMAC->EMACDMARIS);