From owner-freebsd-current@FreeBSD.ORG Tue Apr 26 19:13:01 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B740B16A4CE for ; Tue, 26 Apr 2005 19:13:01 +0000 (GMT) Received: from 62-15-211-171.inversas.jazztel.es (62-15-211-171.inversas.jazztel.es [62.15.211.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8006B43D2F for ; Tue, 26 Apr 2005 19:13:00 +0000 (GMT) (envelope-from josemi@freebsd.jazztel.es) Received: from redesjm.local (orion.redesjm.local [192.168.254.16]) j3QJCuK7005124; Tue, 26 Apr 2005 21:12:56 +0200 (CEST) (envelope-from josemi@redesjm.local) Received: from localhost (localhost [[UNIX: localhost]]) by redesjm.local (8.13.3/8.13.3/Submit) id j3QJCtQ9068303; Tue, 26 Apr 2005 21:12:55 +0200 (CEST) (envelope-from josemi@redesjm.local) From: Jose M Rodriguez To: freebsd-current@freebsd.org Date: Tue, 26 Apr 2005 21:12:53 +0200 User-Agent: KMail/1.8 References: <200504261143.55195.josemi@redesjm.local> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-13" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200504262112.54889.josemi@redesjm.local> X-AntiVirus: checked by AntiVir Milter (version: 1.1.0-3; AVE: 6.30.0.7; VDF: 6.30.0.116; host: antares.redesjm.local) cc: Christian Weisgerber Subject: Re: rigth crc32 implementation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2005 19:13:01 -0000 El Martes, 26 de Abril de 2005 20:48, Christian Weisgerber escribi=F3: > Jose M Rodriguez 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. =46or 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=20 the same. Those functions are oriented to calculate the crc of a formed string,=20 while I need do this 'in transit', with the classical crc_init(&acum),=20 crc_do(&acum, &str, len), crc=3Dcrc_get(&acum) But I don't know if crc32.c will be right in non-i386 like endian=20 systems. I allways see this implemented with a previous crc table=20 generation. If (I Hope) there aren't endian problems with crc32.c (I doesn't have=20 the hard to test this), my plans are add those 2/3 functions to=20 sys/kern/crc32.c using the same table. Any comments on this are welcome. =2D- josemi