diff options
author | bde <bde@FreeBSD.org> | 1996-01-27 04:18:15 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-01-27 04:18:15 +0000 |
commit | 4cf50d85eec3dff9f5df3411d87b0a2aea9c083d (patch) | |
tree | f93e309637079217e5820d51bef98f295ccb958a /sys/isa | |
parent | b367666afd7d12a7802e173170448bcd9f13d89b (diff) | |
download | FreeBSD-src-4cf50d85eec3dff9f5df3411d87b0a2aea9c083d.zip FreeBSD-src-4cf50d85eec3dff9f5df3411d87b0a2aea9c083d.tar.gz |
First attempt at creating devfs entries for sliced devices. Doesn't
quite work yet, so the heart of it is disabled.
Added bdev and cdev args to dsopen().
drivers:
Fixed device names, links, minor numbers and modes.
wd.c:
Started actually supporting devfs.
diskslice.h:
Added devfs tokens to structs (currently 576 of them per disk! :-().
subr_diskslice.c:
Create devfs entries in dsopen() and (unsuccessfully) attempt to make
them go away at the right times. DEVFS is #undefed at the start so
that this shouldn't cause problems.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/fd.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 2470803..f755ad5 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.77 1995/12/10 19:44:45 bde Exp $ + * $Id: fd.c,v 1.78 1996/01/27 02:33:35 bde Exp $ * */ @@ -247,8 +247,8 @@ static struct fd_data { int options; /* user configurable options, see ioctl_fd.h */ int dkunit; /* disk stats unit number */ #ifdef DEVFS - void *rfd_devfs_token; - void *fd_devfs_token; + void *bdev; + void *cdev; #endif } fd_data[NFD]; @@ -568,6 +568,7 @@ fdattach(struct isa_device *dev) struct isa_device *fdup; int ic_type = 0; #ifdef DEVFS + int mynor; char name[64]; #endif /* DEVFS */ @@ -765,12 +766,14 @@ fdattach(struct isa_device *dev) } kdc_fd[fdu].kdc_state = DC_IDLE; #ifdef DEVFS - fd->rfd_devfs_token = devfs_add_devsw( - "/",name,&fd_cdevsw, fdu * 8, - DV_CHR,0,0,0644); - fd->fd_devfs_token = devfs_add_devsw( - "/",name+1, &fd_bdevsw, fdu * 8, - DV_BLK,0,0,0644); + mynor = 8 * fdu; + fd->bdev = devfs_add_devsw("/", name + 1, &fd_bdevsw, mynor, + DV_BLK, 0, 0, 0640); + fd->cdev = devfs_add_devsw("/", name, &fd_cdevsw, mynor, + DV_CHR, 0, 0, 0640); + sprintf(name, "rfd%d", fdu); + dev_link("/", name + 1, fd->bdev); + dev_link("/", name, fd->cdev); #endif /* DEVFS */ if (dk_ndrive < DK_NDRIVE) { sprintf(dk_names[dk_ndrive], "fd%d", fdu); |