Messages in this thread | | | Date | Wed, 25 Mar 2009 15:55:07 +0100 | From | Thierry Reding <> | Subject | Re: [PATCH] net: Add support for the OpenCores 10/100 Mbps Ethernet MAC. |
| |
* 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
| |