[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/1] pcnet: Flush queued packets on end of STOP state
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 1/1] pcnet: Flush queued packets on end of STOP state |
Date: |
Mon, 5 Aug 2013 14:16:15 +0200 |
From: Jan Kiszka <address@hidden>
Analogously to other NICs, we have to inform the network layer when
the can_receive handler will no longer report 0. Without this, we may
get stuck waiting on queued incoming packets.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/net/pcnet.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index b606d2b..63aa73a 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -861,6 +861,8 @@ static void pcnet_init(PCNetState *s)
s->csr[0] |= 0x0101;
s->csr[0] &= ~0x0004; /* clear STOP bit */
+
+ qemu_flush_queued_packets(qemu_get_queue(s->nic));
}
static void pcnet_start(PCNetState *s)
@@ -878,6 +880,8 @@ static void pcnet_start(PCNetState *s)
s->csr[0] &= ~0x0004; /* clear STOP bit */
s->csr[0] |= 0x0002;
pcnet_poll_timer(s);
+
+ qemu_flush_queued_packets(qemu_get_queue(s->nic));
}
static void pcnet_stop(PCNetState *s)
--
1.8.1.4