From: Hervé Poussineau Date: Wed, 3 Jun 2015 20:45:42 +0000 (+0200) Subject: net/dp8393x: always calculate proper checksums X-Git-Tag: v2.4.0-rc0~79^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2f62c4db244f392381c9061c4185ced98f9be57;p=thirdparty%2Fqemu.git net/dp8393x: always calculate proper checksums Signed-off-by: Hervé Poussineau Reviewed-by: Aurelien Jarno Signed-off-by: Leon Alrae --- diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 2297231aa4f..093f0cc3aaa 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]);