diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-08-01 13:10:29 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-08-01 13:10:29 +0000 |
commit | ccf1d14a1e37abe1f0da162c00a8941963b47a4c (patch) | |
tree | 58a02292ef91a1ad307999fd1204e2f4239060b5 /hw | |
parent | bf5ee2487b707d586ff4ac1de43c815a1b1634d4 (diff) | |
download | qemu-ccf1d14a1e37abe1f0da162c00a8941963b47a4c.zip qemu-ccf1d14a1e37abe1f0da162c00a8941963b47a4c.tar.gz qemu-ccf1d14a1e37abe1f0da162c00a8941963b47a4c.tar.bz2 |
Fix rtl8139 checksum calculation, by Tim Deegan.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3109 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/rtl8139.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 705bddb..210af44 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -53,9 +53,8 @@ /* debug RTL8139 card C+ mode only */ //#define DEBUG_RTL8139CP 1 -/* RTL8139 provides frame CRC with received packet, this feature seems to be - ignored by most drivers, disabled by default */ -//#define RTL8139_CALCULATE_RXCRC 1 +/* Calculate CRCs properly on Rx packets */ +#define RTL8139_CALCULATE_RXCRC 1 /* Uncomment to enable on-board timer interrupts */ //#define RTL8139_ONBOARD_TIMER 1 @@ -747,7 +746,7 @@ static void rtl8139_write_buffer(RTL8139State *s, const void *buf, int size) int wrapped = MOD2(s->RxBufAddr + size, s->RxBufferSize); /* write packet data */ - if (wrapped && s->RxBufferSize < 65536 && !rtl8139_RxWrap(s)) + if (wrapped && !(s->RxBufferSize < 65536 && rtl8139_RxWrap(s))) { DEBUG_PRINT((">>> RTL8139: rx packet wrapped in buffer at %d\n", size-wrapped)); @@ -1023,7 +1022,7 @@ static void rtl8139_do_receive(void *opaque, const uint8_t *buf, int size, int d /* write checksum */ #if defined (RTL8139_CALCULATE_RXCRC) - val = cpu_to_le32(crc32(~0, buf, size)); + val = cpu_to_le32(crc32(0, buf, size)); #else val = 0; #endif @@ -1129,7 +1128,7 @@ static void rtl8139_do_receive(void *opaque, const uint8_t *buf, int size, int d /* write checksum */ #if defined (RTL8139_CALCULATE_RXCRC) - val = cpu_to_le32(crc32(~0, buf, size)); + val = cpu_to_le32(crc32(0, buf, size)); #else val = 0; #endif |