* [Qemu-devel] [PATCH] RTL8139 rx-path fixes
@ 2007-07-17 10:27 Tim Deegan
2007-07-17 19:56 ` Igor Kovalenko
0 siblings, 1 reply; 2+ messages in thread
From: Tim Deegan @ 2007-07-17 10:27 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
Two small changes: fix the buffer wraparound code for 64k ring-buffers,
and enable (and fix) the crc32 checksum calculation. These changes are
needed for the the Realtek driver that shipped with 32-bit Vista.
Cheers,
Tim.
--
Tim Deegan <Tim.Deegan@xensource.com>, XenSource UK Limited
Registered office c/o EC2Y 5EB, UK; company number 05334508
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1523 bytes --]
Index: hw/rtl8139.c
===================================================================
RCS file: /sources/qemu/qemu/hw/rtl8139.c,v
retrieving revision 1.10
diff -u -r1.10 rtl8139.c
--- hw/rtl8139.c 11 Jul 2007 22:48:58 -0000 1.10
+++ hw/rtl8139.c 17 Jul 2007 10:09:03 -0000
@@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] RTL8139 rx-path fixes
2007-07-17 10:27 [Qemu-devel] [PATCH] RTL8139 rx-path fixes Tim Deegan
@ 2007-07-17 19:56 ` Igor Kovalenko
0 siblings, 0 replies; 2+ messages in thread
From: Igor Kovalenko @ 2007-07-17 19:56 UTC (permalink / raw)
To: qemu-devel
On 7/17/07, Tim Deegan <Tim.Deegan@xensource.com> wrote:
> Two small changes: fix the buffer wraparound code for 64k ring-buffers,
> and enable (and fix) the crc32 checksum calculation. These changes are
> needed for the the Realtek driver that shipped with 32-bit Vista.
>
Fix for crc32 first argument may be needed for smc91c111.c and
mcf_fec.c as well, if I understand correctly, zlib documentation
indeed states that pre- and post-conditioning (one's complement) is
performed within crc32 function.
--
Kind regards,
Igor V. Kovalenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-17 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17 10:27 [Qemu-devel] [PATCH] RTL8139 rx-path fixes Tim Deegan
2007-07-17 19:56 ` Igor Kovalenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).