summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-26 09:50:34 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-26 09:50:34 +0000
commit3b2e59a86d7cdbb14446277252ac4029ad50a025 (patch)
treef0ecf9018ecc9c09e51420fbaea423b178e1ad3c /sys/dev/sbus
parentc9ed8e3acafb6f8b5270d893558be103887617d7 (diff)
Instead of comparing the lower and higher addresses of all the multicast
entries to decide if the IFF_ALLMULTI flag should be set, check if there is at least one real range between them. This should not change the behavior of any driver but if you encounter any problem, feel free to revert the offending chunk and ping me about it. ok naddy@, dlg@
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r--sys/dev/sbus/be.c21
-rw-r--r--sys/dev/sbus/qe.c25
2 files changed, 8 insertions, 38 deletions
diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c
index 9621b7513ae..c2fc2fa53a3 100644
--- a/sys/dev/sbus/be.c
+++ b/sys/dev/sbus/be.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: be.c,v 1.25 2013/08/07 01:06:40 bluhm Exp $ */
+/* $OpenBSD: be.c,v 1.26 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: be.c,v 1.26 2001/03/20 15:39:20 pk Exp $ */
/*-
@@ -1116,6 +1116,9 @@ be_mcreset(struct be_softc *sc)
return;
}
+ if (ac->ac_multirangecnt > 0)
+ ifp->if_flags |= IFF_ALLMULTI;
+
if (ifp->if_flags & IFF_ALLMULTI) {
hash[3] = hash[2] = hash[1] = hash[0] = 0xffff;
goto chipit;
@@ -1125,22 +1128,6 @@ be_mcreset(struct be_softc *sc)
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (bcmp(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.)
- */
- hash[3] = hash[2] = hash[1] = hash[0] = 0xffff;
- ifp->if_flags |= IFF_ALLMULTI;
- goto chipit;
- }
-
crc = 0xffffffff;
for (i = 0; i < ETHER_ADDR_LEN; i++) {
diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c
index c988407038c..ec17c7f05f4 100644
--- a/sys/dev/sbus/qe.c
+++ b/sys/dev/sbus/qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qe.c,v 1.24 2013/08/07 01:06:40 bluhm Exp $ */
+/* $OpenBSD: qe.c,v 1.25 2013/11/26 09:50:33 mpi Exp $ */
/* $NetBSD: qe.c,v 1.16 2001/03/30 17:30:18 christos Exp $ */
/*-
@@ -1098,6 +1098,9 @@ qe_mcreset(sc)
return;
}
+ if (ac->ac_multirangecnt > 0)
+ ifp->if_flags |= IFF_ALLMULTI;
+
if (ifp->if_flags & IFF_ALLMULTI) {
bus_space_write_1(t, mr, QE_MRI_IAC,
QE_MR_IAC_ADDRCHG | QE_MR_IAC_LOGADDR);
@@ -1111,26 +1114,6 @@ qe_mcreset(sc)
ETHER_FIRST_MULTI(step, ac, enm);
while (enm != NULL) {
- if (bcmp(enm->enm_addrlo, enm->enm_addrhi,
- ETHER_ADDR_LEN) != 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.)
- */
- bus_space_write_1(t, mr, QE_MRI_IAC,
- QE_MR_IAC_ADDRCHG | QE_MR_IAC_LOGADDR);
- bus_space_set_multi_1(t, mr, QE_MRI_LADRF, 0xff, 8);
- bus_space_write_1(t, mr, QE_MRI_IAC, 0);
- ifp->if_flags |= IFF_ALLMULTI;
- break;
- }
-
crc = 0xffffffff;
for (i = 0; i < ETHER_ADDR_LEN; i++) {