From 19195a00f93d7fe540174f181d8ac0516c27c260 Mon Sep 17 00:00:00 2001 From: Ryzee119 Date: Wed, 29 May 2024 18:18:31 +0930 Subject: [PATCH] nvnetdrv: Soft error if framing error only --- lib/net/nvnetdrv/nvnetdrv.c | 2 +- lib/net/nvnetdrv/nvnetdrv_regs.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/net/nvnetdrv/nvnetdrv.c b/lib/net/nvnetdrv/nvnetdrv.c index 82583477e..7f2ea1fa7 100644 --- a/lib/net/nvnetdrv/nvnetdrv.c +++ b/lib/net/nvnetdrv/nvnetdrv.c @@ -201,7 +201,7 @@ static void nvnetdrv_handle_rx_irq (void) goto release_packet; } - if (!(flags & NV_RX_ERROR) || (flags & NV_RX_FRAMINGERR)) { + if ((flags & NV_RX_ERROR_MASK) == 0) { uint16_t packet_length = rx_packet->length; if (flags & NV_RX_SUBTRACT1) { diff --git a/lib/net/nvnetdrv/nvnetdrv_regs.h b/lib/net/nvnetdrv/nvnetdrv_regs.h index a6caeb45c..9371e5f7f 100644 --- a/lib/net/nvnetdrv/nvnetdrv_regs.h +++ b/lib/net/nvnetdrv/nvnetdrv_regs.h @@ -202,4 +202,5 @@ enum { #define NV_RX_OVERFLOW (1 << 12) #define NV_RX_FRAMINGERR (1 << 13) #define NV_RX_ERROR (1 << 14) -#define NV_RX_AVAIL (1 << 15) \ No newline at end of file +#define NV_RX_AVAIL (1 << 15) +#define NV_RX_ERROR_MASK (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4|NV_RX_CRCERR|NV_RX_OVERFLOW)