The current tools/crc32.cc file (used by the two io
drivers io/sc90x/3c90x.cc and io/rtl8139/rtl8139.cc)
contains a lot of unused code and conditional
statements, and, worst of all, it returns an incorrect
CRC when called (you can check this by monitoring the
network with Ethereal).
I submit here two files (crc32.h and crc32.cc) that I
wrote for replacing the existing tools/crc32.h and
This is not a patch : these two files are completely
new. I rewrote them to be as much simple and efficient
as possible, using information found on Internet about
If used, two others existing files (tools/crc32defs.h
and tools/crc32table.h) that are only #include'd in the
previous version of crc32.cc, can be completely discarded.
I discarded also the "copyright" comments at the
beginning, as I think that they no longer apply, and I
don't know the PearPc's rules for making new ones from
scratch. I hope that the PearPc team will add the
proper ones if they accept the change. :-)
I kept the "brief CRC tutorial" found at the end of the
old tools/crc32.cc file.
These new files have been compiled and tested by myself
with PearPc. Using them, Ethereal reports the CRC as