summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1999-11-21 19:17:47 +0000
committermjacob <mjacob@FreeBSD.org>1999-11-21 19:17:47 +0000
commit9a1faf7fc88fbd728d94845f53cb8f2b5e3f317b (patch)
treef8c46f07277e9bec8a5cfda2f61b34ae2c0f8307 /sys/cam
parent613bde8bedddb80aae835e154cc7458e3a93f36e (diff)
downloadFreeBSD-src-9a1faf7fc88fbd728d94845f53cb8f2b5e3f317b.zip
FreeBSD-src-9a1faf7fc88fbd728d94845f53cb8f2b5e3f317b.tar.gz
Add make_dev functions. Tested with only one changer (sigh- all my others
are broken). Submitted by: ken@freebsd.org
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_ch.c10
1 files changed, 7 insertions, 3 deletions
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.
OpenPOWER on IntegriCloud