summaryrefslogtreecommitdiff
path: root/hw/net/pcnet.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2015-07-15 18:19:03 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2015-07-27 14:12:18 +0100
commitb0ba0b9b6b402d738f11f27eea6c94d97bf84cbf (patch)
tree151f1a84607a1a4506053365199c6e85218c7dcf /hw/net/pcnet.c
parent8c8c460c5f38f878675631a66286a6e87bb4d111 (diff)
downloadqemu-b0ba0b9b6b402d738f11f27eea6c94d97bf84cbf.tar.gz
pcnet: Drop pcnet_can_receive
pcnet_receive already checks the conditions and drop packets if false. Due to the new semantics since 6e99c63 ("net/socket: Drop net_socket_can_send"), having .can_receive returning 0 requires us to explicitly flush the queued packets when the conditions are becoming true, but queuing the packets when guest driver is not ready doesn't make much sense. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Jason Wang <jasowang@redhat.com> Message-id: 1436955553-22791-3-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/net/pcnet.c')
-rw-r--r--hw/net/pcnet.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index 68b9981983..34373767d9 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -995,15 +995,6 @@ static int pcnet_tdte_poll(PCNetState *s)
return !!(CSR_CXST(s) & 0x8000);
}
-int pcnet_can_receive(NetClientState *nc)
-{
- PCNetState *s = qemu_get_nic_opaque(nc);
- if (CSR_STOP(s) || CSR_SPND(s))
- return 0;
-
- return sizeof(s->buffer)-16;
-}
-
#define MIN_BUF_SIZE 60
ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_)