From c1a8443416256111ffbeb1beb00efd25bc89557c Mon Sep 17 00:00:00 2001 From: Andrew Webster Date: Thu, 21 Jan 2016 18:45:46 -0600 Subject: [PATCH] inetis enet: disallow transmit when the queue is full --- arch/arm/src/kinetis/kinetis_enet.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 3754db3a82b..85184aafd34 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -347,6 +347,16 @@ static int kinetis_transmit(FAR struct kinetis_driver_s *priv) struct enet_desc_s *txdesc; uint32_t regval; + /* Since this can be called from kinetis_receive, it is possible that + * the transmit queue is full, so check for that now. If this is the + * case, the outgoing packet will be dropped (e.g. an ARP reply) + */ + + if (kinetics_txringfull(priv)) + { + return -EBUSY; + } + /* When we get here the TX descriptor should show that the previous * transfer has completed. If we get here, then we are committed to * sending a packet; Higher level logic must have assured that there is