diff options
author | ken <ken@FreeBSD.org> | 1999-11-17 04:59:09 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 1999-11-17 04:59:09 +0000 |
commit | 14a15966c5f7192bb612a331a2ef1676644cf864 (patch) | |
tree | 61cfe0d4b52fcaca77724bd95a5d2db18f441123 /sys/cam/scsi/scsi_pt.c | |
parent | bf227e92603cc9a64762a4466805ae399af01617 (diff) | |
download | FreeBSD-src-14a15966c5f7192bb612a331a2ef1676644cf864.zip FreeBSD-src-14a15966c5f7192bb612a331a2ef1676644cf864.tar.gz |
Convert the xpt, pass, pt and target drivers to use the new
make_dev()/destroy_dev() interface.
Diffstat (limited to 'sys/cam/scsi/scsi_pt.c')
-rw-r--r-- | sys/cam/scsi/scsi_pt.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c index efb019b..ceb6fbc 100644 --- a/sys/cam/scsi/scsi_pt.c +++ b/sys/cam/scsi/scsi_pt.c @@ -83,6 +83,7 @@ struct pt_softc { pt_flags flags; union ccb saved_ccb; int io_timeout; + dev_t dev; }; static d_open_t ptopen; @@ -306,9 +307,6 @@ ptinit(void) if (status != CAM_REQ_CMP) { printf("pt: Failed to attach master async callback " "due to status 0x%x!\n", status); - } else { - /* If we were successfull, register our devsw */ - cdevsw_add(&pt_cdevsw); } } @@ -349,20 +347,15 @@ ptctor(struct cam_periph *periph, void *arg) cam_extend_set(ptperiphs, periph->unit_number, periph); - /* - * The DA driver supports a blocksize, but - * we don't know the blocksize until we do - * a read capacity. So, set a flag to - * indicate that the blocksize is - * unavailable right now. We'll clear the - * flag as soon as we've done a read capacity. - */ devstat_add_entry(&softc->device_stats, "pt", periph->unit_number, 0, DEVSTAT_NO_BLOCKSIZE, cgd->pd_type | DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_OTHER); + softc->dev = make_dev(&pt_cdevsw, periph->unit_number, UID_ROOT, + GID_OPERATOR, 0600, "%s%d", periph->periph_name, + periph->unit_number); /* * Add async callbacks for bus reset and * bus device reset calls. I don't bother @@ -442,6 +435,8 @@ ptdtor(struct cam_periph *periph) devstat_remove_entry(&softc->device_stats); + destroy_dev(softc->dev); + cam_extend_release(ptperiphs, periph->unit_number); xpt_print_path(periph->path); printf("removing device entry\n"); |