Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net/npf Defer initialization of built-in npf module unti...
details: https://anonhg.NetBSD.org/src/rev/202bdfa08ab5
branches: trunk
changeset: 341117:202bdfa08ab5
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Oct 18 20:39:53 2015 +0000
description:
Defer initialization of built-in npf module until other pseudo-devices
are initialized. MODULE_CLASS_DRIVER modules are now initialized before
autoconfiguration starts, but npf_init has a dependency on percpu(9) which
doesn't work until CPUs have attached (at least on ARM).
diffstat:
sys/net/npf/npf.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (41 lines):
diff -r e1b0232a4432 -r 202bdfa08ab5 sys/net/npf/npf.c
--- a/sys/net/npf/npf.c Sun Oct 18 18:48:01 2015 +0000
+++ b/sys/net/npf/npf.c Sun Oct 18 20:39:53 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf.c,v 1.25 2015/10/18 18:48:01 christos Exp $ */
+/* $NetBSD: npf.c,v 1.26 2015/10/18 20:39:53 jmcneill Exp $ */
/*-
* Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.25 2015/10/18 18:48:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.26 2015/10/18 20:39:53 jmcneill Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -160,7 +160,12 @@
switch (cmd) {
case MODULE_CMD_INIT:
+#if defined(_MODULE)
return npf_init();
+#else
+ /* initialized by npfattach */
+ return 0;
+#endif
case MODULE_CMD_FINI:
return npf_fini();
case MODULE_CMD_AUTOUNLOAD:
@@ -177,8 +182,7 @@
void
npfattach(int nunits)
{
-
- /* Void. */
+ npf_init();
}
static int
Home |
Main Index |
Thread Index |
Old Index