From: Finn Thain Date: Wed, 29 Jan 2020 09:27:49 +0000 (+1100) Subject: dp8393x: Always update RRA pointers and sequence numbers X-Git-Tag: v4.2.1~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1190026fe415ce29605bdadbb68956a3315714e8;p=thirdparty%2Fqemu.git dp8393x: Always update RRA pointers and sequence numbers These operations need to take place regardless of whether or not rx descriptors have been used up (that is, EOL flag was observed). The algorithm is now the same for a packet that was withheld as for a packet that was not. Signed-off-by: Finn Thain Tested-by: Laurent Vivier Signed-off-by: Jason Wang (cherry picked from commit 80b60673ea598869050c66d95d8339480e4cefd0) Signed-off-by: Michael Roth --- diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 4ce2ef818bd..aa7bd785f34 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -897,12 +897,14 @@ static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf, /* Move to next descriptor */ s->regs[SONIC_CRDA] = s->regs[SONIC_LLFA]; s->regs[SONIC_ISR] |= SONIC_ISR_PKTRX; - s->regs[SONIC_RSC] = (s->regs[SONIC_RSC] & 0xff00) | (((s->regs[SONIC_RSC] & 0x00ff) + 1) & 0x00ff); + } - if (s->regs[SONIC_RCR] & SONIC_RCR_LPKT) { - /* Read next RRA */ - dp8393x_do_read_rra(s); - } + s->regs[SONIC_RSC] = (s->regs[SONIC_RSC] & 0xff00) | + ((s->regs[SONIC_RSC] + 1) & 0x00ff); + + if (s->regs[SONIC_RCR] & SONIC_RCR_LPKT) { + /* Read next RRA */ + dp8393x_do_read_rra(s); } /* Done */