From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTe4f-0002wF-Kb for qemu-devel@nongnu.org; Thu, 05 Mar 2015 17:16:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTe4a-0003Wf-Lj for qemu-devel@nongnu.org; Thu, 05 Mar 2015 17:16:57 -0500 Received: from smtp2-g21.free.fr ([212.27.42.2]:32290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTe4a-0003WY-Fq for qemu-devel@nongnu.org; Thu, 05 Mar 2015 17:16:52 -0500 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Thu, 5 Mar 2015 23:13:21 +0100 Message-Id: <1425593606-5909-4-git-send-email-hpoussin@reactos.org> In-Reply-To: <1425593606-5909-1-git-send-email-hpoussin@reactos.org> References: <1425593606-5909-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 3/8] 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 , Laurent@Vivier.EU, 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 4f3e8a2..802f2b0 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, ...) \ @@ -763,11 +757,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 1.7.10.4