From db9ce7543e31445dc49f9732b9044ddedc23e9e3 Mon Sep 17 00:00:00 2001 From: DrDoof <8052722+DrDoof@users.noreply.github.com> Date: Thu, 24 Sep 2026 14:37:11 +0200 Subject: [PATCH] rx: keep draining while the NIC buffer holds data The main loop drains the NIC only after an RX interrupt, at most RX_BUDGET frames, then clears the status and waits for the next one. When frames are left and the buffer reaches the RX stop threshold, the NIC takes no more frames and raises no further interrupt, so reception stops for good. Check the buffer after clearing the status and keep draining while it holds data; the interrupt is re-enabled only once it is empty. --- rtlplayground.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtlplayground.c b/rtlplayground.c index 85f69243..dbe39ab4 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -1300,7 +1300,11 @@ void idle(void) rx_irq = 0; handle_rx(); REG_SET(RTL837X_NIC_INT_STS, NIC_INT_RXIS); - EX1 = 1; + reg_read(RTL837X_REG_NIC_RX_BUFF_DATA); + if (SFR_DATA_U16) + rx_irq = 1; + else + EX1 = 1; } health_phase(HEALTH_PH_RX); if (cmd_available) {