netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: netdev@vger.kernel.org
Subject: Re: CRC16 in rt2x00
Date: Sat, 27 May 2006 22:46:22 +0200	[thread overview]
Message-ID: <200605272246.30450.IvDoorn@gmail.com> (raw)
In-Reply-To: <20060527163059.GB14973@procyon.home>

[-- Attachment #1: Type: text/plain, Size: 2251 bytes --]

On Saturday 27 May 2006 18:30, Sergey Vlasov wrote:
> On Sat, May 27, 2006 at 04:24:07PM +0200, Ivo van Doorn wrote:
> > On Saturday 27 May 2006 15:55, Sergey Vlasov wrote:
> [skip]
> > > However, fs/udf/crc.c has exactly the same CRC table as rt2x00:
> [skip]
> > > This is a bit-reversed form of CRC-CCITT supported by lib/crc-ccitt.c.
> > > Unfortunately, this does not help much, because converting one form to
> > > the other is too expensive (you would need to reverse bits in all data
> > > bytes, and then reverse bits in the 16-bit result).
> > > 
> > > BTW, there is more CRC code duplication in drivers/bluetooth/hci_bcsp.c
> > > (bcsp_crc_update() seems to give the same result as crc_ccitt_byte()).
> > > 
> > > In drivers/media/dvb/frontends/nxt200x.c, nxt200x_crc() seems to give
> > > the same result as rt2x00crc_byte() (but without using a table).
> > > 
> > > drivers/net/wan/cycx_drv.c:checksum() is also some mutated version of
> > > CRC-CCITT (adding two additional zero bytes at the end of data makes it
> > > return the same result as rt2x00crc()).
> 
> More stealth CRC implementations:
> 
> - drivers/ieee1394/csr.c:csr_crc16() - the same as rt2x00crc();
> 
> - drivers/ieee1394/csr1212.c:csr1212_crc16() - again the same as
>   rt2x00crc(), except the final byteswap;
> 
> - drivers/net/wireless/wavelan.c:psa_crc() is plain crc16(); it is
>   duplicated in drivers/net/wireless/wavelan_cs.c;
> 
> - drivers/scsi/FlashPoint.c:FPT_CalcCrc16() is also crc16();
> 
> > Interesting, so it would actually be usefull to move the nxt200x
> > crc16 implemetation into the crc16 library (Is not using a table
> > preferred over using a table?)
> 
> Using a table is probably faster, but consumes more memory.
> 
> > And make rt2x00 and fs/udf/crc.c make use of this library?
> > 
> > And perhaps hci_bcsp could be updated to use crc_ccitt_byte() instead?

Thanks,
I will take another look at the drivers as well and see which drivers
could best be udpated to use the kernel library instead of using
its own implementation.
This will take a couple of days, but then I should have a couple of
patches ready to add some crc libs and update the drivers to make
use of these labs.

Ivo

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2006-05-27 20:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-27 11:27 CRC16 in rt2x00 Ivo van Doorn
2006-05-27 13:55 ` Sergey Vlasov
2006-05-27 14:24   ` Ivo van Doorn
2006-05-27 16:30     ` Sergey Vlasov
2006-05-27 20:46       ` Ivo van Doorn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605272246.30450.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vsu@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).