summaryrefslogtreecommitdiff
path: root/sys/dev/streams/streams.c
diff options
context:
space:
mode:
authorMark Newton <newton@FreeBSD.org>1999-02-22 11:44:46 +0000
committerMark Newton <newton@FreeBSD.org>1999-02-22 11:44:46 +0000
commit86e9118bcca83b8b6b1852c6ca50f7258df69a49 (patch)
tree2299d7d602170f708b2b55897d6ec4c28abbcc1e /sys/dev/streams/streams.c
parented720ec3dcf55d1e1ad7b215b9a98754f2b9018f (diff)
Notes
Diffstat (limited to 'sys/dev/streams/streams.c')
-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 248f7ac5eab4..eb5d4694517a 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