Re: [PATCH] net: Add support for the OpenCores 10/100 MbpsEthernet MAC.

From: Thierry Reding
Date: Wed Mar 25 2009 - 10:55:30 EST


* 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/