Received: from eggs.gnu.org ([2001:4830:134:3::10]:44818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFJmt-0005ju-Rv for qemu-devel@nongnu.org; Wed, 15 Jul 2015 06:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFJms-0006bB-SX for qemu-devel@nongnu.org; Wed, 15 Jul 2015 06:19:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFJms-0006b0-OR for qemu-devel@nongnu.org; Wed, 15 Jul 2015 06:19:38 -0400 From: Fam Zheng Date: Wed, 15 Jul 2015 18:19:04 +0800 Message-Id: <1436955553-22791-4-git-send-email-famz@redhat.com> In-Reply-To: <1436955553-22791-1-git-send-email-famz@redhat.com> References: <1436955553-22791-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2 for-2.4 03/12] eepro100: Drop nic_can_receive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Rob Herring , jasowang@redhat.com, Michael Walle , Gerd Hoffmann , stefanha@redhat.com, "Edgar E. Iglesias" nic_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 Reviewed-by: Stefan Hajnoczi --- hw/net/eepro100.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index c374c1a..60333b7 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -1617,16 +1617,6 @@ static const MemoryRegionOps eepro100_ops = { .endianness = DEVICE_LITTLE_ENDIAN, }; -static int nic_can_receive(NetClientState *nc) -{ - EEPRO100State *s = qemu_get_nic_opaque(nc); - TRACE(RXTX, logout("%p\n", s)); - return get_ru_state(s) == ru_ready; -#if 0 - return !eepro100_buffer_full(s); -#endif -} - static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size) { /* TODO: @@ -1844,7 +1834,6 @@ static void pci_nic_uninit(PCIDevice *pci_dev) static NetClientInfo net_eepro100_info = { .type = NET_CLIENT_OPTIONS_KIND_NIC, .size = sizeof(NICState), - .can_receive = nic_can_receive, .receive = nic_receive, }; -- 2.4.3