diff options
author | phk <phk@FreeBSD.org> | 2000-08-20 21:34:39 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-08-20 21:34:39 +0000 |
commit | b648921accec69a7e5c83e915ded3037cbca7f3d (patch) | |
tree | fa2e43c05e3c1d31732408f806d72db091c03d14 /sys/net/bpf.c | |
parent | 1c624ac57c791b6df4b51eb86e04dc404052c700 (diff) | |
download | FreeBSD-src-b648921accec69a7e5c83e915ded3037cbca7f3d.zip FreeBSD-src-b648921accec69a7e5c83e915ded3037cbca7f3d.tar.gz |
Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)
Remove old DEVFS support fields from dev_t.
Make uid, gid & mode members of dev_t and set them in make_dev().
Use correct uid, gid & mode in make_dev in disk minilayer.
Add support for registering alias names for a dev_t using the
new function make_dev_alias(). These will show up as symlinks
in DEVFS.
Use makedev() rather than make_dev() for MFSs magic devices to prevent
DEVFS from noticing this abuse.
Add a field for DEVFS inode number in dev_t.
Add new DEVFS in fs/devfs.
Add devfs cloning to:
disk minilayer (ie: ad(4), sd(4), cd(4) etc etc)
md(4), tun(4), bpf(4), fd(4)
If DEVFS add -d flag to /sbin/inits args to make it mount devfs.
Add commented out DEVFS to GENERIC
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r-- | sys/net/bpf.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 5fc8262..ecccbcf 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -41,6 +41,7 @@ */ #include "bpf.h" +#include "opt_devfs.h" #ifndef __GNUC__ #define inline @@ -78,6 +79,11 @@ #include <sys/kernel.h> #include <sys/sysctl.h> +#ifdef DEVFS +#include <sys/eventhandler.h> +#include <fs/devfs/devfs.h> +#endif + MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); #if NBPF > 0 @@ -1357,12 +1363,38 @@ bpfdetach(ifp) static void bpf_drvinit __P((void *unused)); +#ifdef DEVFS +static void bpf_clone __P((void *arg, char *name, int namelen, dev_t *dev)); + +static void +bpf_clone(arg, name, namelen, dev) + void *arg; + char *name; + int namelen; + dev_t *dev; +{ + int u; + + if (*dev != NODEV) + return; + if (devfs_stdclone(name, NULL, "bpf", &u) != 1) + return; + /* XXX: minor encoding if u > 255 */ + *dev = make_dev(&bpf_cdevsw, u, 0, 0, 0600, "bpf%d", u); + return; +} +#endif + static void bpf_drvinit(unused) void *unused; { +#ifdef DEVFS + EVENTHANDLER_REGISTER(devfs_clone, bpf_clone, 0, 1000); +#else cdevsw_add(&bpf_cdevsw); +#endif } SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bpf_drvinit,NULL) |