summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-08-08 19:55:32 +0000
committerrwatson <rwatson@FreeBSD.org>2005-08-08 19:55:32 +0000
commitdaa1c89f450d2c308009c125db1d28bbd9c044fa (patch)
treed655c312aefcf63bff80cd1977af84d2c685fd16 /sys/dev
parent540e708ef59e78a3e053a16463d855a75422f2bc (diff)
downloadFreeBSD-src-daa1c89f450d2c308009c125db1d28bbd9c044fa.zip
FreeBSD-src-daa1c89f450d2c308009c125db1d28bbd9c044fa.tar.gz
Merge the dev_clone and dev_clone_cred event handlers into a single
event handler, dev_clone, which accepts a credential argument. Implementors of the event can ignore it if they're not interested, and most do. This avoids having multiple event handler types and fall-back/precedence logic in devfs. This changes the kernel API for /dev cloning, and may affect third party packages containg cloning kernel modules. Requested by: phk MFC after: 3 days
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/firewire/firewirereg.h2
-rw-r--r--sys/dev/firewire/fwdev.c3
-rw-r--r--sys/dev/nmdm/nmdm.c3
-rw-r--r--sys/dev/snp/snp.c5
-rw-r--r--sys/dev/sound/pcm/dsp.c3
-rw-r--r--sys/dev/sound/pcm/mixer.c3
-rw-r--r--sys/dev/vkbd/vkbd.c6
7 files changed, 16 insertions, 9 deletions
diff --git a/sys/dev/firewire/firewirereg.h b/sys/dev/firewire/firewirereg.h
index 3b991ea..4061b8b 100644
--- a/sys/dev/firewire/firewirereg.h
+++ b/sys/dev/firewire/firewirereg.h
@@ -303,7 +303,7 @@ struct fw_bind *fw_bindlookup (struct firewire_comm *, uint16_t, uint32_t);
void fw_drain_txq (struct firewire_comm *);
int fwdev_makedev (struct firewire_softc *);
int fwdev_destroydev (struct firewire_softc *);
-void fwdev_clone (void *, char *, int, struct cdev **);
+void fwdev_clone (void *, struct ucred *, char *, int, struct cdev **);
extern int firewire_debug;
extern devclass_t firewire_devclass;
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c
index ecd56c4..e42c30a 100644
--- a/sys/dev/firewire/fwdev.c
+++ b/sys/dev/firewire/fwdev.c
@@ -840,7 +840,8 @@ fwdev_destroydev(struct firewire_softc *sc)
#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
#define NDEVTYPE 2
void
-fwdev_clone(void *arg, char *name, int namelen, struct cdev **dev)
+fwdev_clone(void *arg, struct ucred *cred, char *name, int namelen,
+ struct cdev **dev)
{
struct firewire_softc *sc;
char *devnames[NDEVTYPE] = {"fw", "fwmem"};
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index e61a05f..1c118d2 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -104,7 +104,8 @@ static struct clonedevs *nmdmclones;
static TAILQ_HEAD(,nm_softc) nmdmhead = TAILQ_HEAD_INITIALIZER(nmdmhead);
static void
-nmdm_clone(void *arg, char *name, int nameen, struct cdev **dev)
+nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen,
+ struct cdev **dev)
{
int i, unit;
char *p;
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 8be2b19..3e190c7 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -114,7 +114,7 @@ static LIST_HEAD(, snoop) snp_sclist = LIST_HEAD_INITIALIZER(&snp_sclist);
static struct clonedevs *snpclones;
static struct tty *snpdevtotty(struct cdev *dev);
-static void snp_clone(void *arg, char *name,
+static void snp_clone(void *arg, struct ucred *cred, char *name,
int namelen, struct cdev **dev);
static int snp_detach(struct snoop *snp);
static int snp_down(struct snoop *snp);
@@ -627,8 +627,9 @@ snppoll(dev, events, td)
}
static void
-snp_clone(arg, name, namelen, dev)
+snp_clone(arg, cred, name, namelen, dev)
void *arg;
+ struct ucred *cred;
char *name;
int namelen;
struct cdev **dev;
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index c57b59f..9c34f65 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -1130,7 +1130,8 @@ dsp_mmap(struct cdev *i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
* if xN.i isn't busy, return its dev_t
*/
static void
-dsp_clone(void *arg, char *name, int namelen, struct cdev **dev)
+dsp_clone(void *arg, struct ucred *cred, char *name, int namelen,
+ struct cdev **dev)
{
struct cdev *pdev;
struct snddev_info *pcm_dev;
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 96b08fc..e7e3e0c 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -486,7 +486,8 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread
#ifdef USING_DEVFS
static void
-mixer_clone(void *arg, char *name, int namelen, struct cdev **dev)
+mixer_clone(void *arg, struct ucred *cred, char *name, int namelen,
+ struct cdev **dev)
{
struct snddev_info *sd;
diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c
index ed39007..b399726 100644
--- a/sys/dev/vkbd/vkbd.c
+++ b/sys/dev/vkbd/vkbd.c
@@ -124,7 +124,8 @@ typedef struct vkbd_state vkbd_state_t;
*****************************************************************************
*****************************************************************************/
-static void vkbd_dev_clone(void *, char *, int, struct cdev **);
+static void vkbd_dev_clone(void *, struct ucred *, char *, int,
+ struct cdev **);
static d_open_t vkbd_dev_open;
static d_close_t vkbd_dev_close;
static d_read_t vkbd_dev_read;
@@ -152,7 +153,8 @@ static struct clonedevs *vkbd_dev_clones = NULL;
/* Clone device */
static void
-vkbd_dev_clone(void *arg, char *name, int namelen, struct cdev **dev)
+vkbd_dev_clone(void *arg, struct ucred *cred, char *name, int namelen,
+ struct cdev **dev)
{
int unit;
OpenPOWER on IntegriCloud