summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_aue.c
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2004-06-09 14:34:04 +0000
committerChristian Weisgerber <naddy@FreeBSD.org>2004-06-09 14:34:04 +0000
commit0e939c0ceab8e6f6421a2ccc1501f6d3fabd118f (patch)
tree63c1a8adb963adf2b159557569195cbc8c219d33 /sys/dev/usb/if_aue.c
parent6c27c6039b0c96613aaca7a958e18ab9cd1778f6 (diff)
Notes
Diffstat (limited to 'sys/dev/usb/if_aue.c')
-rw-r--r--sys/dev/usb/if_aue.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 36bf5fabd432..22f2b7a86c9d 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -208,7 +208,6 @@ Static int aue_miibus_writereg(device_ptr_t, int, int, int);
Static void aue_miibus_statchg(device_ptr_t);
Static void aue_setmulti(struct aue_softc *);
-Static uint32_t aue_mchash(const uint8_t *);
Static void aue_reset(struct aue_softc *);
Static int aue_csr_read_1(struct aue_softc *, int);
@@ -519,27 +518,8 @@ aue_miibus_statchg(device_ptr_t dev)
return;
}
-#define AUE_POLY 0xEDB88320
#define AUE_BITS 6
-Static u_int32_t
-aue_mchash(const uint8_t *addr)
-{
- uint32_t crc;
- int idx, bit;
- uint8_t data;
-
- /* 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)
- crc = (crc >> 1) ^ (((crc ^ data) & 1) ? AUE_POLY : 0);
- }
-
- return (crc & ((1 << AUE_BITS) - 1));
-}
-
Static void
aue_setmulti(struct aue_softc *sc)
{
@@ -569,7 +549,8 @@ aue_setmulti(struct aue_softc *sc)
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
- h = aue_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+ h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
+ ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1);
AUE_SETBIT(sc, AUE_MAR + (h >> 3), 1 << (h & 0x7));
}