Forwarding a patch I recieved from a NSLU2-linux developer.

Øyvind Repvik

-------- Original Message --------
Subject:        Patch for zd1211
Date:   Mon, 1 May 2006 10:16:08 -0500
From:   Mike (mwester) <[EMAIL PROTECTED]>
CC:     Mike Westerhof <[EMAIL PROTECTED]>

Here's the bug that's been in the driver for some time now.  One little
overlooked "endian" problem...

If you're wondering why "CurFrmLen" instead of
"le32_to_cpu(rfd->ActualCount)" -- I went back to the original source
from Zydas, and they were using the construct rfd->ActualCount
throughout that section of code.  When the "endian" fix was performed
for the zd1211, the author of the "endian" fix observed that "CurFrmLen"
== "le32_to_cpu(rfd->ActualCount)" and that using the former was far
more efficient.  I merely followed that author's approach and used
"CurFrmLen" as well.  The point of all of this is that I think this
patch should be accepted by the zd1211 group as-is --- so if you agree,
could you submit it?

I fixed it in the r74 version of the driver; so I commited a new .bb
file along with the patch.  The bug is present in the r67 version as
well, but I did not add the patch to that .bb file.

I also commited some truely horrible hacks specific to unslung along
with this fix.

Finally, there remains an alignment issue (per /proc/cpu/alignment).
And it locks up badly when put under very heavy load, such as NFS
(there's a post in the archives of the zd1211 group mailing list that
describes exactly what happens, so this is a known problem).


--- zd1211-driver-r67/src/zd1211.c~     2006-02-16 15:33:51.000000000 -0600
+++ zd1211-driver-r67/src/zd1211.c      2006-04-30 22:47:13.000000000 -0500
@@ -2228,7 +2228,7 @@

                         if (CurFrmLen & 0x03)
                                 tmpLen += 4;
-                        rfd->ActualCount += macp->rxOffset;
+                        rfd->ActualCount = cpu_to_le32(CurFrmLen +
         } else {
                 // last_pkt_len = 509, 510, 511

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Zd1211-devs mailing list -

Reply via email to