diff options
author | Matt Jacob <mjacob@FreeBSD.org> | 1999-11-21 19:17:47 +0000 |
---|---|---|
committer | Matt Jacob <mjacob@FreeBSD.org> | 1999-11-21 19:17:47 +0000 |
commit | 2728bfbd9ee4b11e0162d8547615427f0d565148 (patch) | |
tree | f8c46f07277e9bec8a5cfda2f61b34ae2c0f8307 /sys | |
parent | f90c9f8e9e86508021d0de1d4d968786cb3a4018 (diff) | |
download | src-2728bfbd9ee4b11e0162d8547615427f0d565148.tar.gz src-2728bfbd9ee4b11e0162d8547615427f0d565148.zip |
Add make_dev functions. Tested with only one changer (sigh- all my others
are broken).
Submitted by: ken@freebsd.org
Notes
Notes:
svn path=/head/; revision=53520
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/scsi/scsi_ch.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index cc1bdb727164..c8bf8a35c66f 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -147,6 +147,7 @@ struct ch_softc { ch_quirks quirks; union ccb saved_ccb; struct devstat device_stats; + dev_t dev; int sc_picker; /* current picker */ @@ -270,9 +271,6 @@ chinit(void) if (status != CAM_REQ_CMP) { printf("ch: Failed to attach master async callback " "due to status 0x%x!\n", status); - } else { - /* If we were successfull, register our devsw */ - cdevsw_add(&ch_cdevsw); } } @@ -310,6 +308,7 @@ chcleanup(struct cam_periph *periph) softc = (struct ch_softc *)periph->softc; devstat_remove_entry(&softc->device_stats); + destroy_dev(softc->dev); cam_extend_release(chperiphs, periph->unit_number); xpt_print_path(periph->path); printf("removing device entry\n"); @@ -400,6 +399,11 @@ chregister(struct cam_periph *periph, void *arg) cgd->pd_type | DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_OTHER); + /* Register the device */ + softc->dev = make_dev(&ch_cdevsw, periph->unit_number, UID_ROOT, + GID_OPERATOR, 0600, "%s%d", periph->periph_name, + periph->unit_number); + /* * Add an async callback so that we get * notified if this device goes away. |