summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aic6915.c16
-rw-r--r--sys/dev/ic/ath.c18
-rw-r--r--sys/dev/ic/athn.c10
-rw-r--r--sys/dev/ic/atw.c13
-rw-r--r--sys/dev/ic/dp8390.c20
-rw-r--r--sys/dev/ic/i82596.c17
-rw-r--r--sys/dev/ic/if_wi.c11
-rw-r--r--sys/dev/ic/lance.c16
-rw-r--r--sys/dev/ic/lemac.c16
-rw-r--r--sys/dev/ic/mtd8xx.c13
-rw-r--r--sys/dev/ic/rtw.c16
-rw-r--r--sys/dev/ic/smc83c170.c8
12 files changed, 66 insertions, 108 deletions
diff --git a/sys/dev/ic/aic6915.c b/sys/dev/ic/aic6915.c
index 8a6d6e5c510..02a5fcf3b97 100644
--- a/sys/dev/ic/aic6915.c
+++ b/sys/dev/ic/aic6915.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic6915.c,v 1.10 2013/08/07 01:06:27 bluhm Exp $ */
+/* $OpenBSD: aic6915.c,v 1.11 2013/11/26 09:50:32 mpi Exp $ */
/* $NetBSD: aic6915.c,v 1.15 2005/12/24 20:27:29 perry Exp $ */
/*-
@@ -1341,6 +1341,9 @@ sf_set_filter(struct sf_softc *sc)
*/
sf_set_filter_perfect(sc, 0, LLADDR(ifp->if_sadl));
+ if (ac->ac_multirangecnt > 0)
+ goto allmulti;
+
/*
* Now set the hash bits for each multicast address in our
* list.
@@ -1349,17 +1352,6 @@ sf_set_filter(struct sf_softc *sc)
if (enm == NULL)
goto done;
while (enm != NULL) {
- if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
- /*
- * We must listen to a range of multicast addresses.
- * For now, just accept all multicasts, rather than
- * trying to set only those filter bits needed to match
- * the range. (At this time, the only use of address
- * ranges is for IP multicast routing, for which the
- * range is big enough to require all bits set.)
- */
- goto allmulti;
- }
sf_set_filter_hash(sc, enm->enm_addrlo);
ETHER_NEXT_MULTI(step, enm);
}
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index d8d90a3e2f3..83cd2339197 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.97 2013/11/21 16:16:08 mpi Exp $ */
+/* $OpenBSD: ath.c,v 1.98 2013/11/26 09:50:32 mpi Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -1147,18 +1147,20 @@ ath_mcastfilter_accum(caddr_t dl, u_int32_t (*mfilt)[2])
void
ath_mcastfilter_compute(struct ath_softc *sc, u_int32_t (*mfilt)[2])
{
+ struct arpcom *ac = &sc->sc_ic.ic_ac;
struct ifnet *ifp = &sc->sc_ic.ic_if;
struct ether_multi *enm;
struct ether_multistep estep;
- ETHER_FIRST_MULTI(estep, &sc->sc_ic.ic_ac, enm);
- while (enm != NULL) {
+ if (ac->ac_multirangecnt > 0) {
/* XXX Punt on ranges. */
- if (!IEEE80211_ADDR_EQ(enm->enm_addrlo, enm->enm_addrhi)) {
- (*mfilt)[0] = (*mfilt)[1] = ~((u_int32_t)0);
- ifp->if_flags |= IFF_ALLMULTI;
- return;
- }
+ (*mfilt)[0] = (*mfilt)[1] = ~((u_int32_t)0);
+ ifp->if_flags |= IFF_ALLMULTI;
+ return;
+ }
+
+ ETHER_FIRST_MULTI(estep, ac, enm);
+ while (enm != NULL) {
ath_mcastfilter_accum(enm->enm_addrlo, mfilt);
ETHER_NEXT_MULTI(estep, enm);
}
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index ffa6cb65a09..5d5ab61c569 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: athn.c,v 1.78 2013/11/15 01:45:44 krw Exp $ */
+/* $OpenBSD: athn.c,v 1.79 2013/11/26 09:50:32 mpi Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -2626,6 +2626,9 @@ athn_set_multi(struct athn_softc *sc)
uint32_t val, lo, hi;
uint8_t bit;
+ if (ac->ac_multirangecnt > 0)
+ ifp->if_flags |= IFF_ALLMULTI;
+
if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) {
lo = hi = 0xffffffff;
goto done;
@@ -2633,11 +2636,6 @@ athn_set_multi(struct athn_softc *sc)
lo = hi = 0;
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) {
- ifp->if_flags |= IFF_ALLMULTI;
- lo = hi = 0xffffffff;
- goto done;
- }
addr = enm->enm_addrlo;
/* Calculate the XOR value of all eight 6-bit words. */
val = addr[0] | addr[1] << 8 | addr[2] << 16;
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index 042bf6cf2e7..27e98c64f94 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atw.c,v 1.77 2013/11/14 12:30:39 dlg Exp $ */
+/* $OpenBSD: atw.c,v 1.78 2013/11/26 09:50:32 mpi Exp $ */
/* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -2030,7 +2030,7 @@ void
atw_filter_setup(struct atw_softc *sc)
{
struct ieee80211com *ic = &sc->sc_ic;
- struct arpcom *ec = &ic->ic_ac;
+ struct arpcom *ac = &ic->ic_ac;
struct ifnet *ifp = &sc->sc_ic.ic_if;
int hash;
u_int32_t hashes[2];
@@ -2058,15 +2058,14 @@ atw_filter_setup(struct atw_softc *sc)
hashes[0] = hashes[1] = 0x0;
+ if (ac->ac_multirangecnt > 0)
+ goto allmulti;
+
/*
* Program the 64-bit multicast hash filter.
*/
- ETHER_FIRST_MULTI(step, ec, enm);
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
- ETHER_ADDR_LEN) != 0)
- goto allmulti;
-
hash = atw_calchash(enm->enm_addrlo);
hashes[hash >> 5] |= 1 << (hash & 0x1f);
ETHER_NEXT_MULTI(step, enm);
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index 4868f9fcb62..b4ec9323467 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390.c,v 1.45 2013/08/07 01:06:29 bluhm Exp $ */
+/* $OpenBSD: dp8390.c,v 1.46 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */
/*
@@ -923,7 +923,7 @@ dp8390_getmcaf(struct arpcom *ac, u_int8_t *af)
* the word.
*/
- if (ifp->if_flags & IFF_PROMISC) {
+ if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0) {
ifp->if_flags |= IFF_ALLMULTI;
for (i = 0; i < 8; i++)
af[i] = 0xff;
@@ -933,22 +933,6 @@ dp8390_getmcaf(struct arpcom *ac, u_int8_t *af)
af[i] = 0;
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi,
- sizeof(enm->enm_addrlo)) != 0) {
- /*
- * We must listen to a range of multicast addresses.
- * For now, just accept all multicasts, rather than
- * trying to set only those filter bits needed to match
- * the range. (At this time, the only use of address
- * ranges is for IP multicast routing, for which the
- * range is big enough to require all bits set.)
- */
- ifp->if_flags |= IFF_ALLMULTI;
- for (i = 0; i < 8; i++)
- af[i] = 0xff;
- return;
- }
-
/* Just want the 6 most significant bits. */
crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 26;
diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c
index 6c07c66800f..c20e9f2ab65 100644
--- a/sys/dev/ic/i82596.c
+++ b/sys/dev/ic/i82596.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82596.c,v 1.34 2013/08/07 01:06:29 bluhm Exp $ */
+/* $OpenBSD: i82596.c,v 1.35 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */
/*-
@@ -1949,10 +1949,17 @@ void
ie_mc_reset(sc)
struct ie_softc *sc;
{
+ struct arpcom *ac = &sc->sc_arpcom;
struct ether_multi *enm;
struct ether_multistep step;
int size;
+ if (ac->ac_multicnt >= IE_MAXMCAST || ac->ac_multirangecnt > 0) {
+ ac->ac_if.if_flags |= IFF_ALLMULTI;
+ i82596_ioctl(&ac->.ac_if, SIOCSIFFLAGS, (void *)0);
+ return;
+ }
+
/*
* Step through the list of addresses.
*/
@@ -1961,14 +1968,6 @@ ie_mc_reset(sc)
ETHER_FIRST_MULTI(step, &sc->sc_arpcom, enm);
while (enm) {
size += ETHER_ADDR_LEN;
- if (sc->mcast_count >= IE_MAXMCAST ||
- bcmp(enm->enm_addrlo, enm->enm_addrhi,
- ETHER_ADDR_LEN) != 0) {
- sc->sc_arpcom.ac_if.if_flags |= IFF_ALLMULTI;
- i82596_ioctl(&sc->sc_arpcom.ac_if,
- SIOCSIFFLAGS, (void *)0);
- return;
- }
sc->mcast_count++;
ETHER_NEXT_MULTI(step, enm);
}
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index ed2f248eef5..0c44fd50a47 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.153 2013/10/01 19:33:49 kettenis Exp $ */
+/* $OpenBSD: if_wi.c,v 1.154 2013/11/26 09:50:33 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1394,6 +1394,7 @@ wi_alloc_nicmem_io(struct wi_softc *sc, int len, int *id)
STATIC void
wi_setmulti(struct wi_softc *sc)
{
+ struct arpcom *ac = &sc->sc_ic.ic_ac;
struct ifnet *ifp;
int i = 0;
struct wi_ltv_mcast mcast;
@@ -1407,7 +1408,9 @@ wi_setmulti(struct wi_softc *sc)
mcast.wi_type = WI_RID_MCAST_LIST;
mcast.wi_len = ((ETHER_ADDR_LEN / 2) * 16) + 1;
-allmulti:
+ if (ac->ac_multirangecnt > 0)
+ ifp->if_flags |= IFF_ALLMULTI;
+
if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
wi_write_record(sc, (struct wi_ltv_gen *)&mcast);
return;
@@ -1420,10 +1423,6 @@ allmulti:
break;
}
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
- ifp->if_flags |= IFF_ALLMULTI;
- goto allmulti;
- }
bcopy(enm->enm_addrlo, &mcast.wi_mcast[i], ETHER_ADDR_LEN);
i++;
ETHER_NEXT_MULTI(step, enm);
diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c
index 731cf8a5980..4d29cf1bd48 100644
--- a/sys/dev/ic/lance.c
+++ b/sys/dev/ic/lance.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lance.c,v 1.1 2013/09/24 20:10:58 miod Exp $ */
+/* $OpenBSD: lance.c,v 1.2 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: lance.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */
/*-
@@ -603,24 +603,12 @@ lance_setladrf(struct arpcom *ac, uint16_t *af)
* the word.
*/
- if (ifp->if_flags & IFF_PROMISC)
+ if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0)
goto allmulti;
af[0] = af[1] = af[2] = af[3] = 0x0000;
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (ETHER_CMP(enm->enm_addrlo, enm->enm_addrhi)) {
- /*
- * We must listen to a range of multicast addresses.
- * For now, just accept all multicasts, rather than
- * trying to set only those filter bits needed to match
- * the range. (At this time, the only use of address
- * ranges is for IP multicast routing, for which the
- * range is big enough to require all bits set.)
- */
- goto allmulti;
- }
-
crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
/* Just want the 6 most significant bits. */
diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c
index 76d5470547d..30908ff4604 100644
--- a/sys/dev/ic/lemac.c
+++ b/sys/dev/ic/lemac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lemac.c,v 1.14 2013/08/07 01:06:30 bluhm Exp $ */
+/* $OpenBSD: lemac.c,v 1.15 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */
/*-
@@ -490,6 +490,7 @@ void
lemac_multicast_filter(struct lemac_softc *sc)
{
#if 0
+ struct arpcom *ac = &sc->sc_ec;
struct ether_multistep step;
struct ether_multi *enm;
#endif
@@ -499,13 +500,14 @@ lemac_multicast_filter(struct lemac_softc *sc)
lemac_multicast_op(sc->sc_mctbl, etherbroadcastaddr, 1);
#if 0
- ETHER_FIRST_MULTI(step, &sc->sc_ec, enm);
+ if (ac->ac_multirangecnt > 0) {
+ sc->sc_flags |= LEMAC_ALLMULTI;
+ sc->sc_if.if_flags |= IFF_ALLMULTI;
+ return;
+ }
+
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (!LEMAC_ADDREQUAL(enm->enm_addrlo, enm->enm_addrhi)) {
- sc->sc_flags |= LEMAC_ALLMULTI;
- sc->sc_if.if_flags |= IFF_ALLMULTI;
- return;
- }
lemac_multicast_op(sc->sc_mctbl, enm->enm_addrlo, TRUE);
ETHER_NEXT_MULTI(step, enm);
}
diff --git a/sys/dev/ic/mtd8xx.c b/sys/dev/ic/mtd8xx.c
index add477fefc5..f05cd067053 100644
--- a/sys/dev/ic/mtd8xx.c
+++ b/sys/dev/ic/mtd8xx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtd8xx.c,v 1.20 2013/08/21 05:21:43 dlg Exp $ */
+/* $OpenBSD: mtd8xx.c,v 1.21 2013/11/26 09:50:33 mpi Exp $ */
/*
* Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru>
@@ -315,13 +315,16 @@ mtd_miibus_statchg(struct device *self)
void
mtd_setmulti(struct mtd_softc *sc)
{
+ struct arpcom *ac = &sc->sc_arpcom;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
u_int32_t rxfilt, crc, hash[2] = { 0, 0 };
struct ether_multistep step;
struct ether_multi *enm;
int mcnt = 0;
-allmulti:
+ if (ac->ac_multirangecnt > 0)
+ ifp->if_flags |= IFF_ALLMULTI;
+
rxfilt = CSR_READ_4(MTD_TCRRCR) & ~RCR_AM;
if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
rxfilt |= RCR_AM;
@@ -336,12 +339,8 @@ allmulti:
CSR_WRITE_4(MTD_MAR4, 0);
/* Now program new ones. */
- ETHER_FIRST_MULTI(step, &sc->sc_arpcom, enm);
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
- ifp->if_flags |= IFF_ALLMULTI;
- goto allmulti;
- }
crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 26;
hash[crc >> 5] |= 1 << (crc & 0xf);
++mcnt;
diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c
index f79999753b8..02622421ac3 100644
--- a/sys/dev/ic/rtw.c
+++ b/sys/dev/ic/rtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtw.c,v 1.82 2012/12/05 23:20:19 deraadt Exp $ */
+/* $OpenBSD: rtw.c,v 1.83 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */
/*-
@@ -2278,7 +2278,7 @@ rtw_pktfilt_load(struct rtw_softc *sc)
{
struct rtw_regs *regs = &sc->sc_regs;
struct ieee80211com *ic = &sc->sc_ic;
- struct arpcom *ec = &ic->ic_ac;
+ struct arpcom *ac = &ic->ic_ac;
struct ifnet *ifp = &sc->sc_ic.ic_if;
int hash;
u_int32_t hashes[2] = { 0, 0 };
@@ -2317,8 +2317,9 @@ rtw_pktfilt_load(struct rtw_softc *sc)
if ((ifp->if_flags & IFF_BROADCAST) != 0)
sc->sc_rcr |= RTW_RCR_AB; /* accept all broadcast */
- if (ifp->if_flags & IFF_PROMISC) {
- sc->sc_rcr |= RTW_RCR_AB; /* accept all broadcast */
+ if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0) {
+ if (ifp->if_flags & IFF_PROMISC)
+ sc->sc_rcr |= RTW_RCR_AB; /* accept all broadcast */
allmulti:
ifp->if_flags |= IFF_ALLMULTI;
goto setit;
@@ -2327,13 +2328,8 @@ allmulti:
/*
* Program the 64-bit multicast hash filter.
*/
- ETHER_FIRST_MULTI(step, ec, enm);
+ ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- /* XXX */
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi,
- ETHER_ADDR_LEN) != 0)
- goto allmulti;
-
hash = ether_crc32_be((enm->enm_addrlo),
IEEE80211_ADDR_LEN) >> 26;
hashes[hash >> 5] |= (1 << (hash & 0x1f));
diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c
index 08eea91b7d8..befdee44846 100644
--- a/sys/dev/ic/smc83c170.c
+++ b/sys/dev/ic/smc83c170.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc83c170.c,v 1.15 2013/08/07 01:06:31 bluhm Exp $ */
+/* $OpenBSD: smc83c170.c,v 1.16 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */
/*-
@@ -1285,13 +1285,13 @@ epic_set_mchash(struct epic_softc *sc)
goto allmulti;
}
+ if (ac->ac_multirangecnt > 0)
+ goto allmulti;
+
mchash[0] = mchash[1] = mchash[2] = mchash[3] = 0;
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN))
- goto allmulti;
-
hash = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
hash >>= 26;