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/scsi/sd.c | |
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/scsi/sd.c')
-rw-r--r-- | sys/scsi/sd.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 495ac8a..b9f1f96 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.82 1995/12/14 19:38:40 bde Exp $ + * $Id: sd.c,v 1.83 1996/01/05 20:12:49 wollman Exp $ */ #include "opt_bounce.h" @@ -193,6 +193,7 @@ sdattach(struct scsi_link *sc_link) u_int32 unit; struct disk_parms *dp; #ifdef DEVFS + int mynor; char name[32]; #endif @@ -236,14 +237,14 @@ sdattach(struct scsi_link *sc_link) sd_registerdev(unit); #ifdef DEVFS -/* Fix minor numbers */ - sprintf(name,"rsd%d",unit); - sd->c_devfs_token = devfs_add_devsw( "/", name, &sd_cdevsw, 0, - DV_CHR, 0, 0, 0600); - sprintf(name,"sd%d",unit); - sd->b_devfs_token = devfs_add_devsw( "/", name, &sd_bdevsw, 0, - DV_BLK, 0, 0, 0600); + mynor = dkmakeminor(unit, WHOLE_DISK_SLICE, RAW_PART); + sprintf(name, "rsd%d", unit); + sd->b_devfs_token = devfs_add_devsw("/", name + 1, &sd_bdevsw, mynor, + DV_BLK, 0, 0, 0640); + sd->c_devfs_token = devfs_add_devsw("/", name, &sd_cdevsw, mynor, + DV_CHR, 0, 0, 0640); #endif + return 0; } @@ -352,7 +353,7 @@ sd_open(dev, mode, fmt, p, sc_link) /* Initialize slice tables. */ errcode = dsopen("sd", dev, fmt, &sd->dk_slices, &label, sdstrategy1, - (ds_setgeom_t *)NULL); + (ds_setgeom_t *)NULL, &sd_bdevsw, &sd_cdevsw); if (errcode != 0) goto bad; SC_DEBUG(sc_link, SDEV_DB3, ("Slice tables initialized ")); |