From patchwork Wed Jun 3 20:45:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 480191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 17E0B140157 for ; Thu, 4 Jun 2015 06:54:05 +1000 (AEST) Received: from localhost ([::1]:38027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Ffm-0007A4-PV for incoming@patchwork.ozlabs.org; Wed, 03 Jun 2015 16:54:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0FbR-0007xB-Ng for qemu-devel@nongnu.org; Wed, 03 Jun 2015 16:49:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0FbP-00084A-Dv for qemu-devel@nongnu.org; Wed, 03 Jun 2015 16:49:33 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:36518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0FbP-00083K-8x for qemu-devel@nongnu.org; Wed, 03 Jun 2015 16:49:31 -0400 Received: from localhost.localdomain (unknown [82.227.227.196]) by smtp2-g21.free.fr (Postfix) with ESMTP id 974BB4B021E; Wed, 3 Jun 2015 22:47:31 +0200 (CEST) From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Wed, 3 Jun 2015 22:45:42 +0200 Message-Id: <1433364350-19380-9-git-send-email-hpoussin@reactos.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433364350-19380-1-git-send-email-hpoussin@reactos.org> References: <1433364350-19380-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 212.27.42.2 Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Leon Alrae , Aurelien Jarno Subject: [Qemu-devel] [PATCH v3 08/16] net/dp8393x: always calculate proper checksums X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Hervé Poussineau Reviewed-by: Aurelien Jarno --- hw/net/dp8393x.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 2297231..093f0cc 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -21,16 +21,10 @@ #include "qemu/timer.h" #include "net/net.h" #include "hw/mips/mips.h" +#include //#define DEBUG_SONIC -/* Calculate CRCs properly on Rx packets */ -#define SONIC_CALCULATE_RXCRC - -#if defined(SONIC_CALCULATE_RXCRC) -/* For crc32 */ -#include -#endif #ifdef DEBUG_SONIC #define DPRINTF(fmt, ...) \ @@ -764,11 +758,7 @@ static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size) s->regs[SONIC_TRBA0] = s->regs[SONIC_CRBA0]; /* Calculate the ethernet checksum */ -#ifdef SONIC_CALCULATE_RXCRC checksum = cpu_to_le32(crc32(0, buf, rx_len)); -#else - checksum = 0; -#endif /* Put packet into RBA */ DPRINTF("Receive packet at %08x\n", (s->regs[SONIC_CRBA1] << 16) | s->regs[SONIC_CRBA0]);