From owner-freebsd-arch@FreeBSD.ORG Mon May 31 10:30:01 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17C4B16A4CE for ; Mon, 31 May 2004 10:30:01 -0700 (PDT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id A804B43D49 for ; Mon, 31 May 2004 10:30:00 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.11/8.12.11) with ESMTP id i4VHSqMl097380; Mon, 31 May 2004 11:28:52 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 31 May 2004 11:29:17 -0600 (MDT) Message-Id: <20040531.112917.111988212.imp@bsdimp.com> To: naddy@mips.inka.de From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-arch@freebsd.org Subject: Re: ether_crc32_[bl]e() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2004 17:30:01 -0000 In message: naddy@mips.inka.de (Christian Weisgerber) writes: : NetBSD and OpenBSD have two helper functions in if_ethersubr.c : : ether_crc32_le(const u_int8_t *buf, size_t len) ------------------------^^^^^^^^ uint8_t : ether_crc32_be(const u_int8_t *buf, size_t len) ------------------------^^^^^^^^ uint8_t : These CRCs are used all over our network drivers, e.g. for setting : up multicast hash filters. Functions to calculate them are duplicated : all over. These could be factored out of some thirty drivers. : NetBSD has done so, btw. ... The other comment that I have about this stuff is to make sure that if you are directly copying these routines form somewhere, you make sure that you give proper credit in the if_ethersubr.c file. : +ether_crc32_be(const u_int8_t *buf, size_t len) ------------------------^^^^^^^^ uint8_t Warner