Re: rigth crc32 implementation

From: Jose M Rodriguez <josemi_at_freebsd.jazztel.es>
Date: Tue, 26 Apr 2005 21:12:53 +0200
El Martes, 26 de Abril de 2005 20:48, Christian Weisgerber escribió:
> Jose M Rodriguez <josemi_at_freebsd.jazztel.es> wrote:
> > Working on usb_adslsubr{.c,.h}
> >
> > About how to implement crc32
> >
> > My first think was use the libkern based one, but I found:
> > sys/linkern/crc32.c
>
> Not sure what's required for usb_adsl, but just about all the
> ethernet drivers use ether_crc32_be() or ether_crc32_le() from
> sys/net/if_ethersubr.c.

For what I Know, this is used for unicast masking calculations.

I think using  sys/kern/crc32.c is more in the way, but the problem is 
the same.

Those functions are oriented to calculate the crc of a formed string, 
while I need do this 'in transit', with the classical crc_init(&acum), 
crc_do(&acum, &str, len), crc=crc_get(&acum)

But I don't know if crc32.c will be right in non-i386 like endian 
systems.  I allways see this implemented with a previous crc table 
generation.

If (I Hope) there aren't endian problems with crc32.c (I doesn't have 
the hard to test this), my plans are add those 2/3 functions to 
sys/kern/crc32.c using the same table.

Any comments on this are welcome.

--
  josemi
Received on Tue Apr 26 2005 - 17:13:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:33 UTC