Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Create separate modules for i2c_bitbang and bpf_filter s...
details: https://anonhg.NetBSD.org/src/rev/2a2afc52af05
branches: trunk
changeset: 345751:2a2afc52af05
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue Jun 07 01:06:27 2016 +0000
description:
Create separate modules for i2c_bitbang and bpf_filter so these files
can be included in kernels which need them without also duplicating
them in other modules. Removes the duplicate symbols I found which
prevented loading i2c and bpf modules after having fixed PR 45125.
diffstat:
sys/dev/i2c/files.i2c | 4 ++--
sys/dev/i2c/i2c.c | 6 +++---
sys/dev/i2c/i2c_bitbang.c | 21 +++++++++++++++++++--
sys/modules/Makefile | 4 +++-
sys/modules/bpf/Makefile | 6 ++----
sys/modules/bpf_filter/Makefile | 11 +++++++++++
sys/modules/i2c_bitbang/Makefile | 10 ++++++++++
sys/modules/iic/Makefile | 4 ++--
sys/net/bpf.c | 6 +++---
sys/net/bpf_filter.c | 27 +++++++++++++++++++++++++--
10 files changed, 80 insertions(+), 19 deletions(-)
diffs (254 lines):
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/dev/i2c/files.i2c
--- a/sys/dev/i2c/files.i2c Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/dev/i2c/files.i2c Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.i2c,v 1.69 2015/12/16 07:56:48 jdc Exp $
+# $NetBSD: files.i2c,v 1.70 2016/06/07 01:06:27 pgoyette Exp $
obsolete defflag opt_i2cbus.h I2C_SCAN
define i2cbus { }
@@ -8,7 +8,7 @@
attach iic at i2cbus
file dev/i2c/i2c.c iic
file dev/i2c/i2c_exec.c iic | i2cbus | i2cexec
-file dev/i2c/i2c_subr.c iic | i2cbus
+file dev/i2c/i2c_subr.c i2cbus
defparam opt_i2c.h I2C_MAX_ADDR
# Common module for bit-bang'ing an I2C bus
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/dev/i2c/i2c.c Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.51 2015/12/13 17:14:56 jmcneill Exp $ */
+/* $NetBSD: i2c.c,v 1.52 2016/06/07 01:06:27 pgoyette Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.51 2015/12/13 17:14:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.52 2016/06/07 01:06:27 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -598,7 +598,7 @@
CFATTACH_DECL2_NEW(iic, sizeof(struct iic_softc),
iic_match, iic_attach, iic_detach, NULL, iic_rescan, iic_child_detach);
-MODULE(MODULE_CLASS_DRIVER, iic, "i2cexec");
+MODULE(MODULE_CLASS_DRIVER, iic, "i2cexec,i2c_bitbang");
#ifdef _MODULE
#include "ioconf.c"
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/dev/i2c/i2c_bitbang.c
--- a/sys/dev/i2c/i2c_bitbang.c Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/dev/i2c/i2c_bitbang.c Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c_bitbang.c,v 1.13 2010/04/25 00:35:58 tsutsui Exp $ */
+/* $NetBSD: i2c_bitbang.c,v 1.14 2016/06/07 01:06:27 pgoyette Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,8 +40,9 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c_bitbang.c,v 1.13 2010/04/25 00:35:58 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c_bitbang.c,v 1.14 2016/06/07 01:06:27 pgoyette Exp $");
+#include <sys/module.h>
#include <sys/param.h>
#include <dev/i2c/i2cvar.h>
@@ -261,3 +262,19 @@
return error;
}
+
+MODULE(MODULE_CLASS_MISC, i2c_bitbang, NULL);
+
+static int
+i2c_bitbang_modcmd(modcmd_t cmd, void *opaque)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return 0;
+ case MODULE_CMD_FINI:
+ return 0;
+ default:
+ return ENOTTY;
+ }
+}
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/modules/Makefile
--- a/sys/modules/Makefile Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/modules/Makefile Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.165 2015/12/26 01:00:01 pgoyette Exp $
+# $NetBSD: Makefile,v 1.166 2016/06/07 01:06:27 pgoyette Exp $
.include <bsd.own.mk>
@@ -10,6 +10,7 @@
SUBDIR+= aio
SUBDIR+= blowfish
SUBDIR+= bpf
+SUBDIR+= bpf_filter
SUBDIR+= camellia
SUBDIR+= cast128
SUBDIR+= ccd
@@ -43,6 +44,7 @@
SUBDIR+= hfs
SUBDIR+= hythygtemp
SUBDIR+= i2cexec
+SUBDIR+= i2c_bitbang
SUBDIR+= if_axe
SUBDIR+= if_axen
SUBDIR+= if_npflog
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/modules/bpf/Makefile
--- a/sys/modules/bpf/Makefile Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/modules/bpf/Makefile Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2012/09/27 18:28:56 alnsn Exp $
+# $NetBSD: Makefile,v 1.5 2016/06/07 01:06:27 pgoyette Exp $
#
.include "../Makefile.inc"
@@ -6,8 +6,6 @@
.PATH: ${S}/net
KMOD= bpf
-# XXX: bpf_filter.c maybe needs to be its own module (or made
-# inseparable from bpfilter?)
-SRCS= bpf.c bpf_filter.c
+SRCS= bpf.c
.include <bsd.kmodule.mk>
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/modules/bpf_filter/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/bpf_filter/Makefile Tue Jun 07 01:06:27 2016 +0000
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile,v 1.1 2016/06/07 01:06:28 pgoyette Exp $
+#
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/net
+
+KMOD= bpf_filter
+SRCS= bpf_filter.c
+
+.include <bsd.kmodule.mk>
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/modules/i2c_bitbang/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/i2c_bitbang/Makefile Tue Jun 07 01:06:27 2016 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2016/06/07 01:06:28 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/dev/i2c
+
+KMOD= i2c_bitbang
+SRCS= i2c_bitbang.c
+
+.include <bsd.kmodule.mk>
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/modules/iic/Makefile
--- a/sys/modules/iic/Makefile Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/modules/iic/Makefile Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2011/10/03 22:27:23 jmcneill Exp $
+# $NetBSD: Makefile,v 1.4 2016/06/07 01:06:28 pgoyette Exp $
.include "../Makefile.inc"
@@ -6,6 +6,6 @@
KMOD= iic
IOCONF= iic.ioconf
-SRCS= i2c.c i2c_bitbang.c i2c_subr.c
+SRCS= i2c.c
.include <bsd.kmodule.mk>
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/net/bpf.c
--- a/sys/net/bpf.c Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/net/bpf.c Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.195 2016/02/09 08:32:12 ozaki-r Exp $ */
+/* $NetBSD: bpf.c,v 1.196 2016/06/07 01:06:28 pgoyette Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.195 2016/02/09 08:32:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.196 2016/06/07 01:06:28 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -2107,7 +2107,7 @@
.bpf_mtap_sl_out = _bpf_mtap_sl_out,
};
-MODULE(MODULE_CLASS_DRIVER, bpf, NULL);
+MODULE(MODULE_CLASS_DRIVER, bpf, "bpf_filter");
static int
bpf_modcmd(modcmd_t cmd, void *arg)
diff -r 7939d2a5e6e0 -r 2a2afc52af05 sys/net/bpf_filter.c
--- a/sys/net/bpf_filter.c Tue Jun 07 00:40:00 2016 +0000
+++ b/sys/net/bpf_filter.c Tue Jun 07 01:06:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf_filter.c,v 1.70 2015/02/11 12:53:15 alnsn Exp $ */
+/* $NetBSD: bpf_filter.c,v 1.71 2016/06/07 01:06:28 pgoyette Exp $ */
/*-
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.70 2015/02/11 12:53:15 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf_filter.c,v 1.71 2016/06/07 01:06:28 pgoyette Exp $");
#if 0
#if !(defined(lint) || defined(KERNEL))
@@ -51,6 +51,10 @@
#include <sys/kmem.h>
#include <sys/endian.h>
+#ifdef _KERNEL
+#include <sys/module.h>
+#endif
+
#define __BPF_PRIVATE
#include <net/bpf.h>
@@ -809,3 +813,22 @@
#endif
return ok;
}
+
+/* Kernel module interface */
+
+#ifdef _KERNEL
+MODULE(MODULE_CLASS_MISC, bpf_filter, NULL);
+
+static int
+bpf_filter_modcmd(modcmd_t cmd, void *opaque)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ case MODULE_CMD_FINI:
+ return 0;
+ default:
+ return ENOTTY;
+ }
+}
+#endif
Home |
Main Index |
Thread Index |
Old Index