Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci comment mods and code tiddy ups



details:   https://anonhg.NetBSD.org/src/rev/2409004b7ca7
branches:  trunk
changeset: 744918:2409004b7ca7
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Mon Feb 17 06:05:31 2020 +0000

description:
comment mods and code tiddy ups

diffstat:

 sys/dev/pci/if_kse.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r ab1d777e8463 -r 2409004b7ca7 sys/dev/pci/if_kse.c
--- a/sys/dev/pci/if_kse.c      Sun Feb 16 23:14:19 2020 +0000
+++ b/sys/dev/pci/if_kse.c      Mon Feb 17 06:05:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kse.c,v 1.48 2020/02/04 07:37:00 skrll Exp $        */
+/*     $NetBSD: if_kse.c,v 1.49 2020/02/17 06:05:31 nisimura Exp $     */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.48 2020/02/04 07:37:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.49 2020/02/17 06:05:31 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,9 +66,9 @@
 #define KSE_LINKDEBUG 0
 
 #define CSR_READ_4(sc, off) \
-           bus_space_read_4(sc->sc_st, sc->sc_sh, off)
+           bus_space_read_4((sc)->sc_st, (sc)->sc_sh, (off))
 #define CSR_WRITE_4(sc, off, val) \
-           bus_space_write_4(sc->sc_st, sc->sc_sh, off, val)
+           bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (off), (val))
 #define CSR_READ_2(sc, off) \
            bus_space_read_2((sc)->sc_st, (sc)->sc_sh, (off))
 #define CSR_WRITE_2(sc, off, val) \
@@ -833,7 +833,7 @@
                    CSR_READ_2(sc, SGCR3) | CR3_USEFC);
        }
 
-       /* build multicast hash filter if necessary */
+       /* accept multicast frame or run promisc mode */
        kse_set_filter(sc);
 
        /* set current media */
@@ -1098,16 +1098,18 @@
        int i;
 
        sc->sc_rxc &= ~(RXC_MHTE | RXC_RM | RXC_RA);
-       ifp->if_flags &= ~IFF_ALLMULTI;
 
        if (ifp->if_flags & IFF_PROMISC) {
                ifp->if_flags |= IFF_ALLMULTI;
                goto update;
        }
+       ifp->if_flags &= ~IFF_ALLMULTI;
 
+       /* clear perfect match filter and prepare mcast hash table */
        for (i = 0; i < 16; i++)
                 CSR_WRITE_4(sc, MAAH0 + i*8, 0);
        crc = mchash[0] = mchash[1] = 0;
+
        ETHER_LOCK(ec);
        ETHER_FIRST_MULTI(step, ec, enm);
        i = 0;



Home | Main Index | Thread Index | Old Index