Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci IFEF_START_MPSAFE flag should be set only if WM_...



details:   https://anonhg.NetBSD.org/src/rev/854a5568a0c8
branches:  trunk
changeset: 822128:854a5568a0c8
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Mar 03 03:33:44 2017 +0000

description:
IFEF_START_MPSAFE flag should be set only if WM_MPSAFE defined. some refactor.

pointed out and suggested by msaitoh@n.o, thanks.

diffstat:

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

diffs (51 lines):

diff -r b81928dde959 -r 854a5568a0c8 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Thu Mar 02 20:11:19 2017 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Mar 03 03:33:44 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.491 2017/03/01 08:56:33 knakahara Exp $    */
+/*     $NetBSD: if_wm.c,v 1.492 2017/03/03 03:33:44 knakahara Exp $    */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.491 2017/03/01 08:56:33 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.492 2017/03/03 03:33:44 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -161,6 +161,9 @@
 
 #ifdef NET_MPSAFE
 #define WM_MPSAFE      1
+#define CALLOUT_FLAGS  CALLOUT_MPSAFE
+#else
+#define CALLOUT_FLAGS  0
 #endif
 
 /*
@@ -538,12 +541,6 @@
 #define WM_CORE_UNLOCK(_sc)    if ((_sc)->sc_core_lock) mutex_exit((_sc)->sc_core_lock)
 #define WM_CORE_LOCKED(_sc)    (!(_sc)->sc_core_lock || mutex_owned((_sc)->sc_core_lock))
 
-#ifdef WM_MPSAFE
-#define CALLOUT_FLAGS  CALLOUT_MPSAFE
-#else
-#define CALLOUT_FLAGS  0
-#endif
-
 #define        WM_RXCHAIN_RESET(rxq)                                           \
 do {                                                                   \
        (rxq)->rxq_tailp = &(rxq)->rxq_head;                            \
@@ -2539,7 +2536,9 @@
        strlcpy(ifp->if_xname, xname, IFNAMSIZ);
        ifp->if_softc = sc;
        ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+#ifdef WM_MPSAFE
        ifp->if_extflags = IFEF_START_MPSAFE;
+#endif
        ifp->if_ioctl = wm_ioctl;
        if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) {
                ifp->if_start = wm_nq_start;



Home | Main Index | Thread Index | Old Index