Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/usb Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/bfdf07f5471f
branches:  netbsd-9
changeset: 458158:bfdf07f5471f
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Aug 09 16:15:06 2019 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #39):

        sys/dev/usb/if_aue.c: revision 1.156

Fix panic when setting multicast addresses. Write the hash table outside of
ETHER_LOC()/ETHER_UNLOCK().

diffstat:

 sys/dev/usb/if_aue.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r 2f7ed32c8c3f -r bfdf07f5471f sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Fri Aug 09 16:13:35 2019 +0000
+++ b/sys/dev/usb/if_aue.c      Fri Aug 09 16:15:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.154 2019/05/28 07:41:50 msaitoh Exp $     */
+/*     $NetBSD: if_aue.c,v 1.154.2.1 2019/08/09 16:15:06 martin Exp $  */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.154 2019/05/28 07:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.154.2.1 2019/08/09 16:15:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -587,6 +587,7 @@
        struct ether_multi      *enm;
        struct ether_multistep  step;
        uint32_t                h = 0, i;
+       uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 
        DPRINTFN(5,("%s: %s: enter\n", device_xname(sc->aue_dev), __func__));
 
@@ -601,10 +602,6 @@
 
        AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI);
 
-       /* first, zot all the existing hash bits */
-       for (i = 0; i < 8; i++)
-               aue_csr_write_1(sc, AUE_MAR0 + i, 0);
-
        /* now program new ones */
        ETHER_LOCK(ec);
        ETHER_FIRST_MULTI(step, ec, enm);
@@ -616,11 +613,15 @@
                }
 
                h = aue_crc(enm->enm_addrlo);
-               AUE_SETBIT(sc, AUE_MAR + (h >> 3), 1 << (h & 0x7));
+               hashtbl[h >> 3] |= 1 << (h & 0x7);
                ETHER_NEXT_MULTI(step, enm);
        }
        ETHER_UNLOCK(ec);
 
+       /* write the hashtable */
+       for (i = 0; i < 8; i++)
+               aue_csr_write_1(sc, AUE_MAR0 + i, hashtbl[i]);
+
        ifp->if_flags &= ~IFF_ALLMULTI;
 }
 



Home | Main Index | Thread Index | Old Index