Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic only set PR bit in frame filter if IFF_PROMISC is...



details:   https://anonhg.NetBSD.org/src/rev/40f5ab80234c
branches:  trunk
changeset: 803247:40f5ab80234c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Oct 19 13:15:23 2014 +0000

description:
only set PR bit in frame filter if IFF_PROMISC is set, and set PM bit if IFF_ALLMULTI is set

diffstat:

 sys/dev/ic/dwc_gmac.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 10f718945808 -r 40f5ab80234c sys/dev/ic/dwc_gmac.c
--- a/sys/dev/ic/dwc_gmac.c     Sun Oct 19 13:04:24 2014 +0000
+++ b/sys/dev/ic/dwc_gmac.c     Sun Oct 19 13:15:23 2014 +0000
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.12 2014/10/19 13:04:24 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.13 2014/10/19 13:15:23 jmcneill Exp $");
 
 /* #define     DWC_GMAC_DEBUG  1 */
 
@@ -690,6 +690,7 @@
 dwc_gmac_init(struct ifnet *ifp)
 {
        struct dwc_gmac_softc *sc = ifp->if_softc;
+       uint32_t ffilt;
 
        if (ifp->if_flags & IFF_RUNNING)
                return 0;
@@ -706,10 +707,14 @@
            __SHIFTIN(8, GMCA_BUSMODE_PBL));
 
        /*
-        * Set up address filter (XXX for testing only: promiscous)
+        * Set up address filter
         */
-       bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_FFILT,
-           AWIN_GMAC_MAC_FFILT_PR);
+       ffilt = 0;
+       if (ifp->if_flags & IFF_PROMISC)
+               ffilt |= AWIN_GMAC_MAC_FFILT_PR;
+       else if (ifp->if_flags & IFF_ALLMULTI)
+               ffilt |= AWIN_GMAC_MAC_FFILT_PM;
+       bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_FFILT, ffilt);
 
        /*
         * Set up dma pointer for RX and TX ring



Home | Main Index | Thread Index | Old Index