summaryrefslogtreecommitdiffstats
path: root/sys/dev/streams
diff options
context:
space:
mode:
authornewton <newton@FreeBSD.org>1999-02-22 11:44:46 +0000
committernewton <newton@FreeBSD.org>1999-02-22 11:44:46 +0000
commit2d24e4c75dd062632ab7648ed6d04dcea99a13eb (patch)
treeee07b6d29226d89518e28691f6763f58ce8485b9 /sys/dev/streams
parentf4ef1ef7800544d6be643b5191de1b72717d2674 (diff)
downloadFreeBSD-src-2d24e4c75dd062632ab7648ed6d04dcea99a13eb.zip
FreeBSD-src-2d24e4c75dd062632ab7648ed6d04dcea99a13eb.tar.gz
Converted "streams" pseudo-device into a KLD
Diffstat (limited to 'sys/dev/streams')
-rw-r--r--sys/dev/streams/streams.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c
index 248f7ac..eb5d469 100644
--- a/sys/dev/streams/streams.c
+++ b/sys/dev/streams/streams.c
@@ -146,6 +146,35 @@ typedef struct streams_softc *sc_p;
static sc_p sca[NSTREAMS];
+static void
+streamsattach(void *dummy)
+{
+ cdevsw_add_generic(CDEV_MAJOR, CDEV_MAJOR, &streams_cdevsw);
+}
+
+static int
+streams_modevent(module_t mod, int type, void *unused)
+{
+ switch (type) {
+ case MOD_LOAD:
+ streamsattach(NULL);
+ return 0;
+ case MOD_UNLOAD:
+ cdevsw[CDEV_MAJOR] = NULL; /* clean up cdev */
+ return 0;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static moduledata_t streams_mod = {
+ "streams",
+ streams_modevent,
+ 0
+};
+DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+
/*
* We only need open() and close() routines. open() calls socreate()
* to allocate a "real" object behind the stream and mallocs some state
OpenPOWER on IntegriCloud