diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-08-06 21:55:32 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-08-06 21:55:32 +0000 |
commit | 226d3b621ef34ce3bc45fefccf44913d47bd0d1d (patch) | |
tree | 8f7a87a25f74e475c2b1ea76b9aacfd7b819e51b /sys/dev/pci | |
parent | cee7d8894cdfedcf9376cd6bacf4b30cf0406e3e (diff) |
kill sc->promisc
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_oce.c | 22 | ||||
-rw-r--r-- | sys/dev/pci/ocevar.h | 4 |
2 files changed, 11 insertions, 15 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c index 12b4e035c9b..0749eb42725 100644 --- a/sys/dev/pci/if_oce.c +++ b/sys/dev/pci/if_oce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_oce.c,v 1.2 2012/08/02 22:14:31 mikeb Exp $ */ +/* $OpenBSD: if_oce.c,v 1.3 2012/08/06 21:55:31 mikeb Exp $ */ /* * Copyright (c) 2012 Mike Belopuhov @@ -236,7 +236,6 @@ oce_attach(struct device *parent, struct device *self, void *aux) sc->rx_ring_size = OCE_RX_RING_SIZE; sc->rq_frag_size = OCE_RQ_BUF_SIZE; sc->flow_control = OCE_DEFAULT_FLOW_CONTROL; - sc->promisc = OCE_DEFAULT_PROMISCUOUS; /* initialise the hardware */ rc = oce_hw_init(sc); @@ -397,19 +396,18 @@ void oce_iff(struct oce_softc *sc) { struct ifnet *ifp = &sc->arpcom.ac_if; + struct arpcom *ac = &sc->arpcom; + int promisc = 0; ifp->if_flags &= ~IFF_ALLMULTI; - if ((ifp->if_flags & IFF_PROMISC) && !sc->promisc) { - sc->promisc = TRUE; - oce_rxf_set_promiscuous(sc, sc->promisc); - } else if (!(ifp->if_flags & IFF_PROMISC) && sc->promisc) { - sc->promisc = FALSE; - oce_rxf_set_promiscuous(sc, sc->promisc); - } - if (oce_hw_update_multicast(sc)) - printf("%s: Update multicast address failed\n", - sc->dev.dv_xname); + if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0 || + ac->ac_multicnt > OCE_MAX_MC_FILTER_SIZE) + promisc = 1; + else + oce_hw_update_multicast(sc); + + oce_rxf_set_promiscuous(sc, promisc); } int diff --git a/sys/dev/pci/ocevar.h b/sys/dev/pci/ocevar.h index aaa66f0df02..56f25ac0217 100644 --- a/sys/dev/pci/ocevar.h +++ b/sys/dev/pci/ocevar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ocevar.h,v 1.3 2012/08/02 22:14:31 mikeb Exp $ */ +/* $OpenBSD: ocevar.h,v 1.4 2012/08/06 21:55:31 mikeb Exp $ */ /*- * Copyright (C) 2012 Emulex @@ -80,7 +80,6 @@ #define OCE_MAX_TX_SIZE 65535 #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 -#define OCE_DEFAULT_PROMISCUOUS 0 #define RSS_ENABLE_IPV4 0x1 #define RSS_ENABLE_TCP_IPV4 0x2 @@ -678,7 +677,6 @@ struct oce_softc { uint32_t if_cap_flags; uint32_t flow_control; - char promisc; char be3_native; uint32_t pvid; |