summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-02-23 23:44:50 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-02-23 23:44:50 +0000
commit941ba54816aedf5113029ad3f3f281e024277c64 (patch)
tree2c9b26a1b507a71362bf9813a5cb9a73712ac859 /sys
parent1653ac2e44f6b40ffd1bdbc91aa4a3a383c11377 (diff)
better promisc and allmulti handling
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/hme.c26
-rw-r--r--sys/arch/sparc/dev/hmevar.h3
2 files changed, 14 insertions, 15 deletions
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c
index 6839ab258cf..c09ecc3ff12 100644
--- a/sys/arch/sparc/dev/hme.c
+++ b/sys/arch/sparc/dev/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.17 1999/02/06 03:42:57 jason Exp $ */
+/* $OpenBSD: hme.c,v 1.18 1999/02/23 23:44:48 jason Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -417,7 +417,6 @@ hmeioctl(ifp, cmd, data)
break;
case SIOCSIFFLAGS:
- sc->sc_promisc = ifp->if_flags & IFF_PROMISC;
if ((ifp->if_flags & IFF_UP) == 0 &&
(ifp->if_flags & IFF_RUNNING) != 0) {
/*
@@ -554,11 +553,6 @@ hmeinit(sc)
cr->ipkt_gap1 = HME_DEFAULT_IPKT_GAP1;
cr->ipkt_gap2 = HME_DEFAULT_IPKT_GAP2;
- cr->htable3 = 0;
- cr->htable2 = 0;
- cr->htable1 = 0;
- cr->htable0 = 0;
-
rxr->rx_ring = (u_int32_t)&sc->sc_desc_dva->hme_rxd[0];
txr->tx_ring = (u_int32_t)&sc->sc_desc_dva->hme_txd[0];
@@ -596,7 +590,8 @@ hmeinit(sc)
if (c != rxr->cfg) /* the receiver sometimes misses bits */
printf("%s: setting rxreg->cfg failed.\n", sc->sc_dev.dv_xname);
- cr->rx_cfg = CR_RXCFG_HENABLE;
+ cr->rx_cfg = 0;
+ hme_mcreset(sc);
DELAY(10);
cr->tx_cfg |= CR_TXCFG_DGIVEUP;
@@ -940,16 +935,19 @@ hme_mcreset(sc)
struct ether_multi *enm;
struct ether_multistep step;
+ if (ifp->if_flags & IFF_PROMISC) {
+ cr->rx_cfg |= CR_RXCFG_PMISC;
+ return;
+ }
+ else
+ cr->rx_cfg &= ~CR_RXCFG_PMISC;
+
if (ifp->if_flags & IFF_ALLMULTI) {
cr->htable3 = 0xffff;
cr->htable2 = 0xffff;
cr->htable1 = 0xffff;
cr->htable0 = 0xffff;
- return;
- }
-
- if (ifp->if_flags & IFF_PROMISC) {
- cr->rx_cfg |= CR_RXCFG_PMISC;
+ cr->rx_cfg |= CR_RXCFG_HENABLE;
return;
}
@@ -972,6 +970,7 @@ hme_mcreset(sc)
cr->htable2 = 0xffff;
cr->htable1 = 0xffff;
cr->htable0 = 0xffff;
+ cr->rx_cfg |= CR_RXCFG_HENABLE;
ifp->if_flags |= IFF_ALLMULTI;
return;
}
@@ -1000,6 +999,7 @@ hme_mcreset(sc)
cr->htable2 = hash[2];
cr->htable1 = hash[1];
cr->htable0 = hash[0];
+ cr->rx_cfg |= CR_RXCFG_HENABLE;
ifp->if_flags &= ~IFF_ALLMULTI;
}
diff --git a/sys/arch/sparc/dev/hmevar.h b/sys/arch/sparc/dev/hmevar.h
index a0ea534bff5..3b032c1bb76 100644
--- a/sys/arch/sparc/dev/hmevar.h
+++ b/sys/arch/sparc/dev/hmevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hmevar.h,v 1.5 1998/09/10 17:34:32 jason Exp $ */
+/* $OpenBSD: hmevar.h,v 1.6 1999/02/23 23:44:49 jason Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -55,7 +55,6 @@ struct hme_softc {
int sc_rev; /* Card revision */
u_int32_t sc_flags; /* status flags */
- u_int32_t sc_promisc; /* are we promiscuous? */
/*
* RX/TX ring buffers, descriptors, and counters