Commit ee76c1f8 authored by Jan Kiszka's avatar Jan Kiszka Committed by Stefan Hajnoczi
Browse files

pcnet: Flush queued packets on end of STOP state



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: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent b9ac5d92
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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)