netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.
Date: Wed, 25 Mar 2009 15:55:07 +0100	[thread overview]
Message-ID: <20090325145507.GC11710@avionic-design.de> (raw)
In-Reply-To: <20090324120157.GB6859@ports.donpac.ru>

* Andrey Panin wrote:
> On 083, 03 24, 2009 at 11:18:43AM +0100, Thierry Reding wrote:
[snip]
> > +static int ethoc_get_multicast_bit(struct dev_mc_list *mc)
> > +{
> > +	u32 crc = 0xffffffff;
> > +	u32 carry;
> > +	int i, j;
> > +
> > +	for (i = 0; i < mc->dmi_addrlen; i++) {
> > +		u8 byte = mc->dmi_addr[i];
> > +
> > +		for (j = 0; j < 8; j++) {
> > +			carry = ((crc & 0x80000000) ? 1 : 0) ^ (byte & 0x1);
> > +			byte >>= 1;
> > +			crc <<= 1;
> > +
> > +			if (carry)
> > +				crc = (crc ^ 0x04c11db6) | carry;
> > +		}
> > +	}
> 
> This looks like yet another crc32 implementation, consider using ether_crc_le()
[snip]

Yes, ether_crc() does the trick. See follow-up patch. Thanks.

Cheers,
Thierry


  reply	other threads:[~2009-03-25 14:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 10:18 [PATCH] net: Add support for the OpenCores 10/100 Mbps Ethernet MAC Thierry Reding
2009-03-24 10:32 ` Florian Fainelli
2009-03-25 14:43   ` Thierry Reding
2009-03-25 21:00     ` Florian Fainelli
2009-03-24 11:13 ` Andrey Panin
2009-03-24 23:36   ` David Miller
2009-03-25 14:52     ` Thierry Reding
2009-03-24 12:01 ` Andrey Panin
2009-03-25 14:55   ` Thierry Reding [this message]
2009-03-25 14:57 ` [PATCH v2] " Thierry Reding
2009-03-26  0:18   ` David Miller
2009-03-26  7:42     ` [PATCH v3] " Thierry Reding
2009-03-26  7:55       ` David Miller
2009-03-26  7:58         ` David Miller
2009-03-26  8:09           ` Thierry Reding
2009-03-26 10:16             ` [PATCH v4] " Thierry Reding
2009-03-27  7:17               ` David Miller

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=20090325145507.GC11710@avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).