summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-07-08 14:48:58 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-07-08 14:48:58 +0000
commit683db6974e07dec62f43f81aa588c8a549d857dc (patch)
treeacbf0ef77a0e2de8dc97d45d4908cc7f26a9b80c
parent7011033ef1e190ba532360de2ea255957fb02fe7 (diff)
tl* multicast filter is broken. use ALLMULTI for now.
-rw-r--r--sys/dev/pci/if_tl.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c
index 47cc15f5618..dba8b329874 100644
--- a/sys/dev/pci/if_tl.c
+++ b/sys/dev/pci/if_tl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tl.c,v 1.27 2002/07/05 13:48:11 aaron Exp $ */
+/* $OpenBSD: if_tl.c,v 1.28 2002/07/08 14:48:57 itojun Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -860,42 +860,43 @@ void tl_setmulti(sc)
{
struct ifnet *ifp;
u_int32_t hashes[2] = { 0, 0 };
- int h, i;
+ int h;
struct arpcom *ac = &sc->arpcom;
struct ether_multistep step;
struct ether_multi *enm;
- u_int8_t dummy[] = { 0, 0, 0, 0, 0 ,0 };
ifp = &sc->arpcom.ac_if;
- /* First, zot all the existing filters. */
- for (i = 1; i < 4; i++)
- tl_setfilt(sc, (caddr_t)&dummy, i);
tl_dio_write32(sc, TL_HASH1, 0);
tl_dio_write32(sc, TL_HASH2, 0);
- /* Now program new ones. */
- if (ifp->if_flags & IFF_ALLMULTI) {
- hashes[0] = 0xFFFFFFFF;
- hashes[1] = 0xFFFFFFFF;
- } else {
- i = 1;
- ETHER_FIRST_MULTI(step, ac, enm);
- while (enm != NULL) {
- if (i < 4) {
- tl_setfilt(sc, enm->enm_addrlo, i);
- i++;
- continue;
- }
-
+ ifp->if_flags &= ~IFF_ALLMULTI;
+#if 0
+ ETHER_FIRST_MULTI(step, ac, enm);
+ while (enm != NULL) {
+ if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6) == 0) {
h = tl_calchash(enm->enm_addrlo);
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
-
- ETHER_NEXT_MULTI(step, enm);
+ hashes[h/32] |= (1 << (h % 32));
+ } else {
+ hashes[0] = hashes[1] = 0xffffffff;
+ ifp->if_flags |= IFF_ALLMULTI;
+ break;
}
+ ETHER_NEXT_MULTI(step, enm);
}
+#else
+ ETHER_FIRST_MULTI(step, ac, enm);
+ h = 0;
+ while (enm != NULL) {
+ h++;
+ ETHER_NEXT_MULTI(step, enm);
+ }
+ if (h) {
+ hashes[0] = hashes[1] = 0xffffffff;
+ ifp->if_flags |= IFF_ALLMULTI;
+ } else {
+ hashes[0] = hashes[1] = 0x00000000;
+ }
+#endif
tl_dio_write32(sc, TL_HASH1, hashes[0]);
tl_dio_write32(sc, TL_HASH2, hashes[1]);