aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sk/if_sk.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2003-11-13 20:55:53 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2003-11-13 20:55:53 +0000
commitaa8255025ab0924083e32a0a72457566d8d6e7da (patch)
tree9f53fad8ba546c1e709992d118c397465dd5b01f /sys/dev/sk/if_sk.c
parent2e76d77fd0916092e6d3c4a78d678bd795cea12f (diff)
downloadsrc-aa8255025ab0924083e32a0a72457566d8d6e7da.tar.gz
src-aa8255025ab0924083e32a0a72457566d8d6e7da.zip
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).
Notes
Notes: svn path=/head/; revision=122625
Diffstat (limited to 'sys/dev/sk/if_sk.c')
-rw-r--r--sys/dev/sk/if_sk.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index 93313284caf6..1b0c41aece8b 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sk.c,v 1.33 2003/08/12 05:23:06 nate Exp $ */
+/* $OpenBSD: if_sk.c,v 2.33 2003/08/12 05:23:06 nate Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -226,7 +226,7 @@ static int sk_marv_miibus_writereg (struct sk_if_softc *, int, int,
int);
static void sk_marv_miibus_statchg (struct sk_if_softc *);
-static u_int32_t sk_calchash (caddr_t);
+static u_int32_t sk_mchash (caddr_t);
static void sk_setfilt (struct sk_if_softc *, caddr_t, int);
static void sk_setmulti (struct sk_if_softc *);
@@ -715,10 +715,12 @@ sk_marv_miibus_statchg(sc_if)
#define SK_BITS 6
static u_int32_t
-sk_calchash(addr)
- caddr_t addr;
+sk_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 */
@@ -798,7 +800,7 @@ sk_setmulti(sc_if)
continue;
}
- h = sk_calchash(
+ h = sk_mchash(
LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
if (h < 32)
hashes[0] |= (1 << h);