From 9a1faf7fc88fbd728d94845f53cb8f2b5e3f317b Mon Sep 17 00:00:00 2001 From: mjacob Date: Sun, 21 Nov 1999 19:17:47 +0000 Subject: Add make_dev functions. Tested with only one changer (sigh- all my others are broken). Submitted by: ken@freebsd.org --- sys/cam/scsi/scsi_ch.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/cam') diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index cc1bdb7..c8bf8a3 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. -- cgit v1.1