Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2005 21:12:53 +0200
From:      Jose M Rodriguez <josemi@freebsd.jazztel.es>
To:        freebsd-current@freebsd.org
Cc:        Christian Weisgerber <naddy@mips.inka.de>
Subject:   Re: rigth crc32 implementation
Message-ID:  <200504262112.54889.josemi@redesjm.local>
In-Reply-To: <d4m2di$2849$2@kemoauc.mips.inka.de>
References:  <200504261143.55195.josemi@redesjm.local> <d4m2di$2849$2@kemoauc.mips.inka.de>

index | next in thread | previous in thread | raw e-mail

El Martes, 26 de Abril de 2005 20:48, Christian Weisgerber escribió:
> Jose M Rodriguez <josemi@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


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504262112.54889.josemi>