Source-Changes-HG archive

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

[src/trunk]: src/sys/net net: remove IFEF_NO_LINK_STATE_CHANGE



details:   https://anonhg.NetBSD.org/src/rev/423fdd3e8c0a
branches:  trunk
changeset: 1015138:423fdd3e8c0a
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Oct 15 10:20:44 2020 +0000

description:
net: remove IFEF_NO_LINK_STATE_CHANGE

This flag was only set for virtual interfaces.
All virtual interfaces have a means of knowing if they are going to work
or not and as such now support link state changes.

If we want this flag back, it should be used as an indicator that
the interfaces does not support link state changes that userland can use
so it can make a decision on what to do when the link state is UNKNOWN.

diffstat:

 sys/net/if.c |   8 ++------
 sys/net/if.h |  10 +---------
 2 files changed, 3 insertions(+), 15 deletions(-)

diffs (60 lines):

diff -r 020426822390 -r 423fdd3e8c0a sys/net/if.c
--- a/sys/net/if.c      Thu Oct 15 10:09:49 2020 +0000
+++ b/sys/net/if.c      Thu Oct 15 10:20:44 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.483 2020/09/27 19:16:28 roy Exp $     */
+/*     $NetBSD: if.c,v 1.484 2020/10/15 10:20:44 roy Exp $     */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.483 2020/09/27 19:16:28 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.484 2020/10/15 10:20:44 roy Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2277,10 +2277,6 @@
 {
        int idx;
 
-       KASSERTMSG(if_is_link_state_changeable(ifp),
-           "%s: IFEF_NO_LINK_STATE_CHANGE must not be set, but if_extflags=0x%x",
-           ifp->if_xname, ifp->if_extflags);
-
        /* Ensure change is to a valid state */
        switch (link_state) {
        case LINK_STATE_UNKNOWN:        /* FALLTHROUGH */
diff -r 020426822390 -r 423fdd3e8c0a sys/net/if.h
--- a/sys/net/if.h      Thu Oct 15 10:09:49 2020 +0000
+++ b/sys/net/if.h      Thu Oct 15 10:20:44 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.288 2020/09/27 19:16:28 roy Exp $     */
+/*     $NetBSD: if.h,v 1.289 2020/10/15 10:20:44 roy Exp $     */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -457,7 +457,6 @@
 #define        IFF_MULTICAST   0x8000          /* supports multicast */
 
 #define        IFEF_MPSAFE                     __BIT(0)        /* handlers can run in parallel (see below) */
-#define        IFEF_NO_LINK_STATE_CHANGE       __BIT(1)        /* doesn't use link state interrupts */
 
 /*
  * The guidelines for converting an interface to IFEF_MPSAFE are as follows
@@ -537,13 +536,6 @@
        }
 }
 
-static __inline bool
-if_is_link_state_changeable(struct ifnet *ifp)
-{
-
-       return ((ifp->if_extflags & IFEF_NO_LINK_STATE_CHANGE) == 0);
-}
-
 #define KERNEL_LOCK_IF_IFP_MPSAFE(ifp)                                 \
        do { if (if_is_mpsafe(ifp)) { KERNEL_LOCK(1, NULL); } } while (0)
 #define KERNEL_UNLOCK_IF_IFP_MPSAFE(ifp)                               \



Home | Main Index | Thread Index | Old Index