Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys fix up virtio module for current structure; add virtio_p...
details: https://anonhg.NetBSD.org/src/rev/fdfe063506e6
branches: trunk
changeset: 323270:fdfe063506e6
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Wed Jun 06 16:11:36 2018 +0000
description:
fix up virtio module for current structure; add virtio_pci module
diffstat:
sys/dev/pci/virtio.c | 6 ++--
sys/dev/pci/virtio_pci.c | 36 ++++++++++++++++++++++++++++++-
sys/modules/virtio/Makefile | 3 +-
sys/modules/virtio/virtio.ioconf | 10 --------
sys/modules/virtio_pci/Makefile | 14 ++++++++++++
sys/modules/virtio_pci/virtio_pci.ioconf | 10 ++++++++
6 files changed, 62 insertions(+), 17 deletions(-)
diffs (147 lines):
diff -r 70b89e6792f6 -r fdfe063506e6 sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c Wed Jun 06 15:54:03 2018 +0000
+++ b/sys/dev/pci/virtio.c Wed Jun 06 16:11:36 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio.c,v 1.31 2018/06/02 22:43:15 jakllsch Exp $ */
+/* $NetBSD: virtio.c,v 1.32 2018/06/06 16:11:36 jakllsch Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.31 2018/06/02 22:43:15 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.32 2018/06/06 16:11:36 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -932,7 +932,7 @@
return sc->sc_features;
}
-MODULE(MODULE_CLASS_DRIVER, virtio, "pci");
+MODULE(MODULE_CLASS_DRIVER, virtio, NULL);
#ifdef _MODULE
#include "ioconf.c"
diff -r 70b89e6792f6 -r fdfe063506e6 sys/dev/pci/virtio_pci.c
--- a/sys/dev/pci/virtio_pci.c Wed Jun 06 15:54:03 2018 +0000
+++ b/sys/dev/pci/virtio_pci.c Wed Jun 06 16:11:36 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.4 2018/06/02 22:43:15 jakllsch Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.5 2018/06/06 16:11:36 jakllsch Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -26,11 +26,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.4 2018/06/02 22:43:15 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.5 2018/06/06 16:11:36 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kmem.h>
+#include <sys/module.h>
#include <sys/device.h>
@@ -727,3 +728,34 @@
r = (sc->sc_config_change)(sc);
return r;
}
+
+MODULE(MODULE_CLASS_DRIVER, virtio_pci, "pci,virtio");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+virtio_pci_modcmd(modcmd_t cmd, void *opaque)
+{
+ int error = 0;
+
+#ifdef _MODULE
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ error = config_init_component(cfdriver_ioconf_virtio_pci,
+ cfattach_ioconf_virtio_pci, cfdata_ioconf_virtio_pci);
+ break;
+ case MODULE_CMD_FINI:
+ error = config_fini_component(cfdriver_ioconf_virtio_pci,
+ cfattach_ioconf_virtio_pci, cfdata_ioconf_virtio_pci);
+ break;
+ default:
+ error = ENOTTY;
+ break;
+ }
+#endif
+
+ return error;
+}
+
diff -r 70b89e6792f6 -r fdfe063506e6 sys/modules/virtio/Makefile
--- a/sys/modules/virtio/Makefile Wed Jun 06 15:54:03 2018 +0000
+++ b/sys/modules/virtio/Makefile Wed Jun 06 16:11:36 2018 +0000
@@ -1,11 +1,10 @@
-# $NetBSD: Makefile,v 1.1 2016/09/27 03:53:09 pgoyette Exp $
+# $NetBSD: Makefile,v 1.2 2018/06/06 16:11:36 jakllsch Exp $
.include "../Makefile.inc"
.PATH: ${S}/dev/pci
KMOD= virtio
-IOCONF= virtio.ioconf
SRCS+= virtio.c
diff -r 70b89e6792f6 -r fdfe063506e6 sys/modules/virtio/virtio.ioconf
--- a/sys/modules/virtio/virtio.ioconf Wed Jun 06 15:54:03 2018 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: virtio.ioconf,v 1.1 2016/09/27 03:53:09 pgoyette Exp $
-
-ioconf virtio
-
-include "conf/files"
-include "dev/pci/files.pci"
-
-pseudo-root pci*
-
-virtio* at pci? dev ? function ?
diff -r 70b89e6792f6 -r fdfe063506e6 sys/modules/virtio_pci/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/virtio_pci/Makefile Wed Jun 06 16:11:36 2018 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2018/06/06 16:11:36 jakllsch Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/dev/pci
+
+KMOD= virtio_pci
+IOCONF= virtio_pci.ioconf
+
+SRCS+= virtio_pci.c
+
+CPPFLAGS+= -DDIAGNOSTIC
+
+.include <bsd.kmodule.mk>
diff -r 70b89e6792f6 -r fdfe063506e6 sys/modules/virtio_pci/virtio_pci.ioconf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/virtio_pci/virtio_pci.ioconf Wed Jun 06 16:11:36 2018 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: virtio_pci.ioconf,v 1.1 2018/06/06 16:11:36 jakllsch Exp $
+
+ioconf virtio_pci
+
+include "conf/files"
+include "dev/pci/files.pci"
+
+pseudo-root pci*
+
+virtio* at pci? dev ? function ?
Home |
Main Index |
Thread Index |
Old Index