diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-05-31 04:21:13 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-05-31 04:21:13 +0000 |
commit | 695ed5dd556e3c399e5f181f4e075b09a9d23f3d (patch) | |
tree | 8eeff02542b0ea4c50a778887c831d8a19a8cc8b /sys/dev/pci | |
parent | cfd8abeca8eca630f76200ee2f379251d5188948 (diff) |
Replace tulip_crc32 with ether_crc32_le.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_de.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index 394d9fd35ef..698137101af 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.59 2004/05/12 06:35:11 tedu Exp $ */ +/* $OpenBSD: if_de.c,v 1.60 2004/05/31 04:21:12 mcbride Exp $ */ /* $NetBSD: if_de.c,v 1.45 1997/06/09 00:34:18 thorpej Exp $ */ /*- @@ -2091,33 +2091,11 @@ tulip_mii_writereg( #endif } -#define tulip_mchash(mca) (tulip_crc32(mca, 6) & 0x1FF) +#define tulip_mchash(mca) (ether_crc32_le(mca, 6) & 0x1FF) #define tulip_srom_crcok(databuf) ( \ - ((tulip_crc32(databuf, 126) & 0xFFFFU) ^ 0xFFFFU) == \ + ((ether_crc32_le(databuf, 126) & 0xFFFFU) ^ 0xFFFFU) == \ ((databuf)[126] | ((databuf)[127] << 8))) -static unsigned -tulip_crc32( - const unsigned char *databuf, - size_t datalen) -{ - u_int idx, crc = 0xFFFFFFFFUL; - static const u_int crctab[] = { - 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, - 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, - 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, - 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c - }; - - for (idx = 0; idx < datalen; idx++) { - crc ^= *databuf++; - crc = (crc >> 4) ^ crctab[crc & 0xf]; - crc = (crc >> 4) ^ crctab[crc & 0xf]; - } - - return crc; -} - static void tulip_identify_dec_nic( tulip_softc_t * const sc) |