summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1999-12-29 22:55:01 +0000
committermjacob <mjacob@FreeBSD.org>1999-12-29 22:55:01 +0000
commitb0a78551fe3da818b9df1314f76dfd98d172c6c9 (patch)
tree16ef095e18f5dcc5df9372777f766d186fee31c1 /sys/cam/scsi
parent36e5c7784524c12c8d07ac02f6dbb115e4e26832 (diff)
downloadFreeBSD-src-b0a78551fe3da818b9df1314f76dfd98d172c6c9.zip
FreeBSD-src-b0a78551fe3da818b9df1314f76dfd98d172c6c9.tar.gz
Restore this driver to a working state. The control device has
to be created at init time. The unit devices are created at ctor when new instances are created and bound and destroyed when that instance is closed. As such, there is just s single static control dev_t for this driver (the per-unit dev_t's are still in the softc). When we have decommissionable periph drivers, a destroy_device on the control device will have to called.
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_target.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index d594260..f5f577f 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -133,7 +133,6 @@ struct targ_softc {
struct buf_queue_head rcv_buf_queue;
struct devstat device_stats;
dev_t targ_dev;
- dev_t ctl_dev;
struct selinfo snd_select;
struct selinfo rcv_select;
targ_state state;
@@ -232,11 +231,11 @@ static struct periph_driver targdriver =
DATA_SET(periphdriver_set, targdriver);
static struct extend_array *targperiphs;
+static dev_t targ_ctl_dev;
static void
targinit(void)
{
-
/*
* Create our extend array for storing the devices we attach to.
*/
@@ -245,6 +244,11 @@ targinit(void)
printf("targ: Failed to alloc extend array!\n");
return;
}
+ targ_ctl_dev = make_dev(&targ_cdevsw, TARG_CONTROL_UNIT, UID_ROOT,
+ GID_OPERATOR, 0600, "%s.ctl", "targ");
+ if (targ_ctl_dev == (dev_t) 0) {
+ printf("targ: failed to create control dev\n");
+ }
}
static void
@@ -491,10 +495,6 @@ targctor(struct cam_periph *periph, void *arg)
softc->targ_dev = make_dev(&targ_cdevsw, periph->unit_number, UID_ROOT,
GID_OPERATOR, 0600, "%s%d",
periph->periph_name, periph->unit_number);
- softc->ctl_dev = make_dev(&targ_cdevsw, TARG_CONTROL_UNIT, UID_ROOT,
- GID_OPERATOR, 0600, "%s%d.ctl",
- periph->periph_name, periph->unit_number);
-
softc->init_level++;
return (CAM_REQ_CMP);
}
@@ -518,7 +518,6 @@ targdtor(struct cam_periph *periph)
case 2:
free(softc->inq_data, M_DEVBUF);
destroy_dev(softc->targ_dev);
- destroy_dev(softc->ctl_dev);
/* FALLTHROUGH */
case 1:
free(softc, M_DEVBUF);
OpenPOWER on IntegriCloud