Module Name: src
Committed By: roy
Date: Thu Oct 15 10:20:44 UTC 2020
Modified Files:
src/sys/net: if.c if.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.483 -r1.484 src/sys/net/if.c
cvs rdiff -u -r1.288 -r1.289 src/sys/net/if.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.483 src/sys/net/if.c:1.484
--- src/sys/net/if.c:1.483 Sun Sep 27 19:16:28 2020
+++ src/sys/net/if.c Thu Oct 15 10:20:44 2020
@@ -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 @@ if_link_state_change(struct ifnet *ifp,
{
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 */
Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.288 src/sys/net/if.h:1.289
--- src/sys/net/if.h:1.288 Sun Sep 27 19:16:28 2020
+++ src/sys/net/if.h Thu Oct 15 10:20:44 2020
@@ -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 @@ typedef struct ifnet {
#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 @@ if_start_lock(struct ifnet *ifp)
}
}
-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) \