summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.c
diff options
context:
space:
mode:
authornaddy <naddy@FreeBSD.org>2004-06-09 14:34:04 +0000
committernaddy <naddy@FreeBSD.org>2004-06-09 14:34:04 +0000
commit03b06cd9a3bb0e9d75237994d18bd6d3b6469ac1 (patch)
tree63c1a8adb963adf2b159557569195cbc8c219d33 /sys/pci/if_sis.c
parentd57aeb149e038b4931b3859597fe80119588eebc (diff)
downloadFreeBSD-src-03b06cd9a3bb0e9d75237994d18bd6d3b6469ac1.zip
FreeBSD-src-03b06cd9a3bb0e9d75237994d18bd6d3b6469ac1.tar.gz
Replace handrolled CRC calculation with ether_crc32_[lb]e().
Diffstat (limited to 'sys/pci/if_sis.c')
-rw-r--r--sys/pci/if_sis.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 332274b..72789f7 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -842,21 +842,10 @@ sis_mchash(sc, addr)
struct sis_softc *sc;
const uint8_t *addr;
{
- uint32_t crc, carry;
- int idx, bit;
- uint8_t data;
+ uint32_t crc;
/* Compute CRC for the address value. */
- crc = 0xFFFFFFFF; /* initial value */
-
- for (idx = 0; idx < 6; idx++) {
- for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (data & 0x01);
- crc <<= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
+ crc = ether_crc32_be(addr, ETHER_ADDR_LEN);
/*
* return the filter bit position
OpenPOWER on IntegriCloud