summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-09-02 19:17:34 +0000
committerphk <phk@FreeBSD.org>2000-09-02 19:17:34 +0000
commite47f61e18396b6e5f61ee91b9f9f832976ee96cf (patch)
treebc17f23dc3fa3b9663516bac048049a5f02652ea /sys/net/bpf.c
parent0ab175f21b9e105fcbe4db6569019e946f23e13c (diff)
downloadFreeBSD-src-e47f61e18396b6e5f61ee91b9f9f832976ee96cf.zip
FreeBSD-src-e47f61e18396b6e5f61ee91b9f9f832976ee96cf.tar.gz
Avoid the modules madness I inadvertently introduced by making the
cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index ecccbcf..0416b51 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -41,7 +41,6 @@
*/
#include "bpf.h"
-#include "opt_devfs.h"
#ifndef __GNUC__
#define inline
@@ -79,11 +78,6 @@
#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
@@ -1363,7 +1357,6 @@ 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
@@ -1377,24 +1370,20 @@ bpf_clone(arg, name, namelen, dev)
if (*dev != NODEV)
return;
- if (devfs_stdclone(name, NULL, "bpf", &u) != 1)
+ if (dev_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
+ EVENTHANDLER_REGISTER(dev_clone, bpf_clone, 0, 1000);
cdevsw_add(&bpf_cdevsw);
-#endif
}
SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bpf_drvinit,NULL)
OpenPOWER on IntegriCloud