diff options
| author | Christian Weisgerber <naddy@FreeBSD.org> | 2004-06-09 14:34:04 +0000 |
|---|---|---|
| committer | Christian Weisgerber <naddy@FreeBSD.org> | 2004-06-09 14:34:04 +0000 |
| commit | 0e939c0ceab8e6f6421a2ccc1501f6d3fabd118f (patch) | |
| tree | 63c1a8adb963adf2b159557569195cbc8c219d33 /sys/dev/de | |
| parent | 6c27c6039b0c96613aaca7a958e18ab9cd1778f6 (diff) | |
Notes
Diffstat (limited to 'sys/dev/de')
| -rw-r--r-- | sys/dev/de/if_de.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index c4e184d29c08..a56f1b89b961 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -1992,31 +1992,10 @@ 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( |
