aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2020-01-29 20:27:49 +1100
committerJason Wang <jasowang@redhat.com>2020-03-03 18:04:47 +0800
commit80b60673ea598869050c66d95d8339480e4cefd0 (patch)
tree84acbb1fd2995cb162b2a70ba6cda50cd99ea916 /hw
parentd9fae13196a31716f45dcddcdd958fbb8e59b35a (diff)
downloadqemu-80b60673ea598869050c66d95d8339480e4cefd0.zip
qemu-80b60673ea598869050c66d95d8339480e4cefd0.tar.gz
qemu-80b60673ea598869050c66d95d8339480e4cefd0.tar.bz2
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 <fthain@telegraphics.com.au> Tested-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/dp8393x.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 08194a4..cfbc2ee 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -901,12 +901,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 */