Fixed rtl8139 checksum calculation for Vista (rhbz #308201)

This commit is contained in:
Daniel P. Berrange 2007-09-27 03:26:18 +00:00
parent 4ecadb0ce8
commit f4a1bb22a5
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,47 @@
Index: hw/rtl8139.c
===================================================================
RCS file: /sources/qemu/qemu/hw/rtl8139.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- hw/rtl8139.c 11 Jul 2007 22:48:58 -0000 1.10
+++ hw/rtl8139.c 1 Aug 2007 13:10:29 -0000 1.11
@@ -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 @@
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 @@
/* 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 @@
/* 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

View File

@ -8,7 +8,7 @@
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 0.9.0
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2+, LGPLv2+
Group: Development/Tools
URL: http://www.qemu.org/
@ -23,7 +23,10 @@ Patch3: qemu-0.9.0-nic-defaults.patch
Patch4: qemu-0.9.0-vnc-authentication.patch
# Fix RTL8139 MMIO regions. Remove at next upgrade
Patch5: qemu-0.9.0-rtl8139-mmio-regions.patch
# Fix Atapi errors with latest kernel
Patch6: qemu-0.9.0-atapi-hsm.patch
# Fix RTL8139 checksum calculations for Vista
Patch7: qemu-0.9.0-rtl8139-checksum.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel compat-gcc-%{gccver} zlib-devel which texi2html gnutls-devel
Requires(post): /sbin/chkconfig
@ -53,6 +56,7 @@ As QEMU requires no host kernel patches to run, it is safe and easy to use.
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p0
%build
./configure \
@ -104,6 +108,9 @@ fi
%{_mandir}/man1/*
%changelog
* Wed Sep 26 2007 Daniel P. Berrange <berrange@redhat.com> - 0.9.0-5.fc8
- Fix rtl8139 checksum calculation for Vista (rhbz #308201)
* Tue Aug 28 2007 Daniel P. Berrange <berrange@redhat.com> - 0.9.0-4.fc8
- Fix debuginfo by passing -Wl,--build-id to linker