diff options
author | julian <julian@FreeBSD.org> | 1995-12-08 11:19:42 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-12-08 11:19:42 +0000 |
commit | 1900eea896e2aaeae8a9fa8affa5fded2068c9b4 (patch) | |
tree | 5150d199464d64c1021f91b2c2f112d48546a8bf /sys/miscfs/devfs | |
parent | aaf9d7f10ecc63adae1dc4f55cfd31a2926c605a (diff) | |
download | FreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.zip FreeBSD-src-1900eea896e2aaeae8a9fa8affa5fded2068c9b4.tar.gz |
Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)
If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)
pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
Diffstat (limited to 'sys/miscfs/devfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 0110f8b..6f32322 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.8 1995/10/10 07:12:25 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.9 1995/11/29 10:48:36 julian Exp $ */ #include "param.h" @@ -908,15 +908,18 @@ int dev_add_entry(char *name, dn_p parent, int type, union typeinfo *by, devnm_p \***********************************************************************/ void *devfs_add_devsw(char *path, char *name, - int major, + void *devsw, int minor, int chrblk, uid_t uid, gid_t gid, int perms) { + int major; devnm_p new_dev; dn_p dnp; /* devnode for parent directory */ + struct cdevsw *cd; + struct bdevsw *bd; int retval; union typeinfo by; @@ -926,13 +929,19 @@ void *devfs_add_devsw(char *path, switch(chrblk) { case DV_CHR: - by.Cdev.cdevsw = cdevsw + major; + cd = devsw; + major = cd->d_maj; + if ( major == -1 ) return NULL; + by.Cdev.cdevsw = cd; by.Cdev.dev = makedev(major, minor); if( dev_add_entry(name, dnp, DEV_CDEV, &by,&new_dev)) return NULL; break; case DV_BLK: - by.Bdev.bdevsw = bdevsw + major; + bd = devsw; + major = bd->d_maj; + if ( major == -1 ) return NULL; + by.Bdev.bdevsw = bd; by.Bdev.dev = makedev(major, minor); if( dev_add_entry(name, dnp, DEV_BDEV, &by, &new_dev)) return NULL; |