summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2003-11-13 20:55:53 +0000
committerobrien <obrien@FreeBSD.org>2003-11-13 20:55:53 +0000
commitae5ec4308110fc11464507f63b5d9a1908a426b8 (patch)
tree9f53fad8ba546c1e709992d118c397465dd5b01f /sys/dev/bge
parenta9128aec4ed6ce7c8d433530c6899775e94045d0 (diff)
downloadFreeBSD-src-ae5ec4308110fc11464507f63b5d9a1908a426b8.zip
FreeBSD-src-ae5ec4308110fc11464507f63b5d9a1908a426b8.tar.gz
Try to create some sort of consistency in how the routings to find the
multicast hash are written. There are still two distinct algorithms used, and there actually isn't any reason each driver should have its own copy of this function as they could all share one copy of it (if it grew an additional argument).
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 3a2321a..0b8328c 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -209,7 +209,7 @@ static void bge_ifmedia_sts (struct ifnet *, struct ifmediareq *);
static u_int8_t bge_eeprom_getbyte (struct bge_softc *, int, u_int8_t *);
static int bge_read_eeprom (struct bge_softc *, caddr_t, int, int);
-static u_int32_t bge_crc (caddr_t);
+static u_int32_t bge_mchash (caddr_t);
static void bge_setmulti (struct bge_softc *);
static void bge_handle_events (struct bge_softc *);
@@ -1134,10 +1134,12 @@ bge_init_tx_ring(sc)
#define BGE_POLY 0xEDB88320
static u_int32_t
-bge_crc(addr)
+bge_mchash(addr)
caddr_t addr;
{
- u_int32_t idx, bit, data, crc;
+ u_int32_t crc;
+ int idx, bit;
+ u_int8_t data;
/* Compute CRC for the address value. */
crc = 0xFFFFFFFF; /* initial value */
@@ -1177,7 +1179,7 @@ bge_setmulti(sc)
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
- h = bge_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+ h = bge_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F);
}
OpenPOWER on IntegriCloud