summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_rl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r--sys/pci/if_rl.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 849b4c8..a1ec964 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -207,7 +207,6 @@ static int rl_miibus_readreg (device_t, int, int);
static int rl_miibus_writereg (device_t, int, int, int);
static void rl_miibus_statchg (device_t);
-static uint32_t rl_mchash (const uint8_t *);
static void rl_setmulti (struct rl_softc *);
static void rl_reset (struct rl_softc *);
static int rl_list_tx_init (struct rl_softc *);
@@ -734,33 +733,6 @@ rl_miibus_statchg(dev)
}
/*
- * Calculate CRC of a multicast group address, return the upper 6 bits.
- */
-static u_int32_t
-rl_mchash(addr)
- const uint8_t *addr;
-{
- uint32_t crc, carry;
- 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 ) {
- carry = ((crc & 0x80000000) ? 1 : 0) ^ (data & 0x01);
- crc <<= 1;
- if (carry)
- crc = (crc ^ 0x04c11db6) | carry;
- }
- }
-
- /* return the filter bit position */
- return(crc >> 26);
-}
-
-/*
* Program the 64-bit multicast hash filter.
*/
static void
@@ -794,7 +766,8 @@ rl_setmulti(sc)
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
- h = rl_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+ h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
+ ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
if (h < 32)
hashes[0] |= (1 << h);
else
OpenPOWER on IntegriCloud