From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxaN7-0005zU-B8 for qemu-devel@nongnu.org; Wed, 27 May 2015 08:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxaN0-0002qx-BG for qemu-devel@nongnu.org; Wed, 27 May 2015 08:23:45 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:27978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxaN0-0002qb-6G for qemu-devel@nongnu.org; Wed, 27 May 2015 08:23:38 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 27 May 2015 14:19:51 +0200 Message-Id: <1432729200-5322-9-git-send-email-hpoussin@reactos.org> In-Reply-To: <1432729200-5322-1-git-send-email-hpoussin@reactos.org> References: <1432729200-5322-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 08/17] net/dp8393x: always calculate proper checksums List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Leon Alrae , Aurelien Jarno Signed-off-by: Herv=C3=A9 Poussineau --- 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 =20 //#define DEBUG_SONIC =20 -/* Calculate CRCs properly on Rx packets */ -#define SONIC_CALCULATE_RXCRC - -#if defined(SONIC_CALCULATE_RXCRC) -/* For crc32 */ -#include -#endif =20 #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] =3D s->regs[SONIC_CRBA0]; =20 /* Calculate the ethernet checksum */ -#ifdef SONIC_CALCULATE_RXCRC checksum =3D cpu_to_le32(crc32(0, buf, rx_len)); -#else - checksum =3D 0; -#endif =20 /* Put packet into RBA */ DPRINTF("Receive packet at %08x\n", (s->regs[SONIC_CRBA1] << 16) | s= ->regs[SONIC_CRBA0]); --=20 2.1.4