summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-06-11 18:55:19 +0000
committered <ed@FreeBSD.org>2008-06-11 18:55:19 +0000
commit1bfc2929862ee5b2f075e0e679a8e903d61e0bce (patch)
tree08955a306d4e2b47f429af5b10f9ef048618b232 /sys/dev
parentcaec8ca31895494e3aa869e4a120eb00f6fda2ea (diff)
downloadFreeBSD-src-1bfc2929862ee5b2f075e0e679a8e903d61e0bce.zip
FreeBSD-src-1bfc2929862ee5b2f075e0e679a8e903d61e0bce.tar.gz
Don't enforce unique device minor number policy anymore.
Except for the case where we use the cloner library (clone_create() and friends), there is no reason to enforce a unique device minor number policy. There are various drivers in the source tree that allocate unr pools and such to provide minor numbers, without using them themselves. Because we still need to support unique device minor numbers for the cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's that are used in combination with the cloner library should be marked with this flag to make the cloning work. This means drivers can now freely use si_drv0 to store their own flags and state, making it effectively the same as si_drv1 and si_drv2. We still keep the minor() and dev2unit() routines around to make drivers happy. The NTFS code also used the minor number in its hash table. We should not do this anymore. If the si_drv0 field would be changed, it would no longer end up in the same list. Approved by: philip (mentor)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/nmdm/nmdm.c2
-rw-r--r--sys/dev/snp/snp.c2
-rw-r--r--sys/dev/vkbd/vkbd.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index 110553a..8536c18 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -68,7 +68,7 @@ static struct cdevsw nmdm_cdevsw = {
.d_open = nmdmopen,
.d_close = nmdmclose,
.d_name = "nmdn",
- .d_flags = D_TTY | D_PSEUDO | D_NEEDGIANT,
+ .d_flags = D_TTY | D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR,
};
#define BUFSIZ 100 /* Chunk size iomoved to/from user */
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 845ef31..3b52e48 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -44,7 +44,7 @@ static d_poll_t snppoll;
static struct cdevsw snp_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_PSEUDO | D_NEEDGIANT,
+ .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR,
.d_open = snpopen,
.d_close = snpclose,
.d_read = snpread,
diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c
index 9807036..10e3516 100644
--- a/sys/dev/vkbd/vkbd.c
+++ b/sys/dev/vkbd/vkbd.c
@@ -158,7 +158,7 @@ static int vkbd_data_read(vkbd_state_t *, int);
static struct cdevsw vkbd_dev_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_PSEUDO | D_NEEDGIANT,
+ .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR,
.d_open = vkbd_dev_open,
.d_close = vkbd_dev_close,
.d_read = vkbd_dev_read,
OpenPOWER on IntegriCloud