summaryrefslogtreecommitdiffstats
path: root/sys/dev/streams
diff options
context:
space:
mode:
authornewton <newton@FreeBSD.org>1999-10-10 22:57:40 +0000
committernewton <newton@FreeBSD.org>1999-10-10 22:57:40 +0000
commitf0fca10890e9666b0a3c2abe0240a7f20a6b08d8 (patch)
tree76656a91fb777ccfb5adb09af4f2d9f4ba70a604 /sys/dev/streams
parent9f1f03f986bdd53d2f0a718fbe982ba0d43b612c (diff)
downloadFreeBSD-src-f0fca10890e9666b0a3c2abe0240a7f20a6b08d8.zip
FreeBSD-src-f0fca10890e9666b0a3c2abe0240a7f20a6b08d8.tar.gz
Replace cdevsw_add() and friends with make_dev()/remove_dev().
Diffstat (limited to 'sys/dev/streams')
-rw-r--r--sys/dev/streams/streams.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c
index 62e4b42..d7d1d89 100644
--- a/sys/dev/streams/streams.c
+++ b/sys/dev/streams/streams.c
@@ -95,6 +95,9 @@ enum {
dev_unix_ord_stream = 40
};
+dev_t dt_ptm, dt_arp, dt_icmp, dt_ip, dt_tcp, dt_udp, dt_rawip,
+ dt_unix_dgram, dt_unix_stream, dt_unix_ord_stream;
+
static struct fileops svr4_netops = {
soo_read, soo_write, soo_ioctl, soo_poll, svr4_soo_close
};
@@ -131,11 +134,47 @@ streams_modevent(module_t mod, int type, void *unused)
switch (type) {
case MOD_LOAD:
/* XXX should make sure it isn't already loaded first */
- cdevsw_add(&streams_cdevsw);
+ dt_ptm = make_dev(&streams_cdevsw, dev_ptm, 0, 0, 0666,
+ "ptm");
+ dt_arp = make_dev(&streams_cdevsw, dev_arp, 0, 0, 0666,
+ "arp");
+ dt_icmp = make_dev(&streams_cdevsw, dev_icmp, 0, 0, 0666,
+ "icmp");
+ dt_ip = make_dev(&streams_cdevsw, dev_ip, 0, 0, 0666,
+ "ip");
+ dt_tcp = make_dev(&streams_cdevsw, dev_tcp, 0, 0, 0666,
+ "tcp");
+ dt_udp = make_dev(&streams_cdevsw, dev_udp, 0, 0, 0666,
+ "udp");
+ dt_rawip = make_dev(&streams_cdevsw, dev_rawip, 0, 0, 0666,
+ "rawip");
+ dt_unix_dgram = make_dev(&streams_cdevsw, dev_unix_dgram,
+ 0, 0, 0666, "ticlts");
+ dt_unix_stream = make_dev(&streams_cdevsw, dev_unix_stream,
+ 0, 0, 0666, "ticots");
+ dt_unix_ord_stream = make_dev(&streams_cdevsw,
+ dev_unix_ord_stream, 0, 0, 0666, "ticotsord");
+
+ if (! (dt_ptm && dt_arp && dt_icmp && dt_ip && dt_tcp &&
+ dt_udp && dt_rawip && dt_unix_dgram &&
+ dt_unix_stream && dt_unix_ord_stream)) {
+ printf("WARNING: device config for STREAMS failed\n");
+ printf("Suggest unloading streams KLD\n");
+ }
return 0;
case MOD_UNLOAD:
/* XXX should check to see if it's busy first */
- cdevsw_remove(&streams_cdevsw);
+ remove_dev(dt_ptm);
+ remove_dev(dt_arp);
+ remove_dev(dt_icmp);
+ remove_dev(dt_ip);
+ remove_dev(dt_tcp);
+ remove_dev(dt_udp);
+ remove_dev(dt_rawip);
+ remove_dev(dt_unix_dgram);
+ remove_dev(dt_unix_stream);
+ remove_dev(dt_unix_ord_stream);
+
return 0;
default:
break;
OpenPOWER on IntegriCloud