summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_pcn.c
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/pci/if_pcn.c
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/pci/if_pcn.c')
-rw-r--r--sys/pci/if_pcn.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index 57dd4a6..c5bd726 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -136,7 +136,7 @@ static void pcn_miibus_statchg (device_t);
static void pcn_setfilt (struct ifnet *);
static void pcn_setmulti (struct pcn_softc *);
-static u_int32_t pcn_crc (caddr_t);
+static u_int32_t pcn_mchash (caddr_t);
static void pcn_reset (struct pcn_softc *);
static int pcn_list_rx_init (struct pcn_softc *);
static int pcn_list_tx_init (struct pcn_softc *);
@@ -309,10 +309,12 @@ pcn_miibus_statchg(dev)
#define DC_POLY 0xEDB88320
static u_int32_t
-pcn_crc(addr)
- caddr_t addr;
+pcn_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 */
@@ -353,7 +355,7 @@ pcn_setmulti(sc)
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
- h = pcn_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
+ h = pcn_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
hashes[h >> 4] |= 1 << (h & 0xF);
}
OpenPOWER on IntegriCloud