Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/usb Pull up revision 1.38 (via patch, requested...



details:   https://anonhg.NetBSD.org/src/rev/ca7090225d25
branches:  netbsd-1-5
changeset: 490854:ca7090225d25
user:      he <he%NetBSD.org@localhost>
date:      Tue Mar 13 20:46:18 2001 +0000

description:
Pull up revision 1.38 (via patch, requested by tsutsui):
  Handle allmulti case correctly as a NetBSD network driver;
  if we are requested range of multicast address or too many
  multicast address, program multicast filter to receive all
  multicast address.   And set/clear IFF_ALLMULTI flag properly.

diffstat:

 sys/dev/usb/if_kue.c |  33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)

diffs (60 lines):

diff -r 8796a6f41868 -r ca7090225d25 sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Tue Mar 13 20:46:00 2001 +0000
+++ b/sys/dev/usb/if_kue.c      Tue Mar 13 20:46:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.29 2000/06/01 14:28:58 augustss Exp $     */
+/*     $NetBSD: if_kue.c,v 1.29.2.1 2001/03/13 20:46:18 he Exp $       */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -413,7 +413,9 @@
 
        DPRINTFN(5,("%s: %s: enter\n", USBDEVNAME(sc->kue_dev), __FUNCTION__));
 
-       if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
+       if (ifp->if_flags & IFF_PROMISC) {
+allmulti:
+               ifp->if_flags |= IFF_ALLMULTI;
                sc->kue_rxfilt |= KUE_RXFILT_ALLMULTI;
                sc->kue_rxfilt &= ~KUE_RXFILT_MULTICAST;
                kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt);
@@ -445,29 +447,22 @@
        ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
 #endif
        while (enm != NULL) {
-               if (i == KUE_MCFILTCNT(sc))
-                       break;
-#if 0
-               if (memcmp(enm->enm_addrlo,
-                          enm->enm_addrhi, ETHER_ADDR_LEN) != 0) {
-                       ifp->if_flags |= IFF_ALLMULTI;
-                       /* XXX what now? */
-                       return;
-               }
-#endif
+               if (i == KUE_MCFILTCNT(sc) ||
+                   memcmp(enm->enm_addrlo, enm->enm_addrhi,
+                   ETHER_ADDR_LEN) != 0)
+                       goto allmulti;
+
                memcpy(KUE_MCFILT(sc, i), enm->enm_addrlo, ETHER_ADDR_LEN);
                ETHER_NEXT_MULTI(step, enm);
                i++;
        }
+
+       ifp->if_flags &= ~IFF_ALLMULTI;
 #endif
 
-       if (i == KUE_MCFILTCNT(sc))
-               sc->kue_rxfilt |= KUE_RXFILT_ALLMULTI;
-       else {
-               sc->kue_rxfilt |= KUE_RXFILT_MULTICAST;
-               kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SET_MCAST_FILTERS,
-                   i, sc->kue_mcfilters, i * ETHER_ADDR_LEN);
-       }
+       sc->kue_rxfilt |= KUE_RXFILT_MULTICAST;
+       kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SET_MCAST_FILTERS,
+           i, sc->kue_mcfilters, i * ETHER_ADDR_LEN);
 
        kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt);
 }



Home | Main Index | Thread Index | Old Index