summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_cd.c7
-rw-r--r--sys/cam/scsi/scsi_ch.c4
-rw-r--r--sys/cam/scsi/scsi_da.c5
-rw-r--r--sys/cam/scsi/scsi_pass.c4
-rw-r--r--sys/cam/scsi/scsi_pt.c4
-rw-r--r--sys/cam/scsi/scsi_sa.c6
6 files changed, 16 insertions, 14 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 7513f4e..c2e2e25 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -498,7 +498,8 @@ cdasync(void *callback_arg, u_int32_t code,
cgd = (struct ccb_getdev *)arg;
- if ((cgd->pd_type != T_CDROM) && (cgd->pd_type != T_WORM))
+ if (SID_TYPE(&cgd->inq_data) != T_CDROM
+ && SID_TYPE(&cgd->inq_data) != T_WORM)
break;
/*
@@ -604,7 +605,7 @@ cdregister(struct cam_periph *periph, void *arg)
* the structure and indicate that we don't have the blocksize
* yet. Unlike other SCSI peripheral drivers, we explicitly set
* the device type here to be CDROM, rather than just ORing in
- * cgd->pd_type. This is because this driver can attach to either
+ * the device type. This is because this driver can attach to either
* CDROM or WORM devices, and we want this peripheral driver to
* show up in the devstat list as a CD peripheral driver, not a
* WORM peripheral driver. WORM drives will also have the WORM
@@ -1689,7 +1690,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
scsi_sense_key_text[sense_key],
scsi_sense_desc(asc,ascq,
&cgd.inq_data));
- else if (cgd.pd_type == T_CDROM) {
+ else if (SID_TYPE(&cgd.inq_data) == T_CDROM) {
/*
* We only print out an error for
* CDROM type devices. For WORM
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index c8bf8a3..8c9e445 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -330,7 +330,7 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
cgd = (struct ccb_getdev *)arg;
- if (cgd->pd_type != T_CHANGER)
+ if (SID_TYPE(&cgd->inq_data)!= T_CHANGER)
break;
/*
@@ -396,7 +396,7 @@ chregister(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "ch",
periph->unit_number, 0,
DEVSTAT_NO_BLOCKSIZE | DEVSTAT_NO_ORDERED_TAGS,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ SID_TYPE(&cgd->inq_data)| DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_OTHER);
/* Register the device */
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 470832f..d8ad703 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -836,7 +836,8 @@ daasync(void *callback_arg, u_int32_t code,
cgd = (struct ccb_getdev *)arg;
- if ((cgd->pd_type != T_DIRECT) && (cgd->pd_type != T_OPTICAL))
+ if (SID_TYPE(&cgd->inq_data) != T_DIRECT
+ && SID_TYPE(&cgd->inq_data) != T_OPTICAL)
break;
/*
@@ -960,7 +961,7 @@ daregister(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "da",
periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ SID_TYPE(&cgd->inq_data) | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_DISK);
/*
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 5922f5d..c8f5124 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -314,7 +314,7 @@ passregister(struct cam_periph *periph, void *arg)
bzero(softc, sizeof(*softc));
softc->state = PASS_STATE_NORMAL;
- softc->pd_type = cgd->pd_type;
+ softc->pd_type = SID_TYPE(&cgd->inq_data);
bufq_init(&softc->buf_queue);
periph->softc = softc;
@@ -327,7 +327,7 @@ passregister(struct cam_periph *periph, void *arg)
*/
devstat_add_entry(&softc->device_stats, "pass", periph->unit_number,
0, DEVSTAT_NO_BLOCKSIZE | DEVSTAT_NO_ORDERED_TAGS,
- cgd->pd_type |
+ softc->pd_type |
DEVSTAT_TYPE_IF_SCSI |
DEVSTAT_TYPE_PASS,
DEVSTAT_PRIORITY_PASS);
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index ceb6fbc..4f7b8e0 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -350,7 +350,7 @@ ptctor(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "pt",
periph->unit_number, 0,
DEVSTAT_NO_BLOCKSIZE,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ SID_TYPE(&cgd->inq_data) | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_OTHER);
softc->dev = make_dev(&pt_cdevsw, periph->unit_number, UID_ROOT,
@@ -457,7 +457,7 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
cgd = (struct ccb_getdev *)arg;
- if (cgd->pd_type != T_PROCESSOR)
+ if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR)
break;
/*
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 10f0884..e04be0c 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -1309,7 +1309,7 @@ saasync(void *callback_arg, u_int32_t code,
cgd = (struct ccb_getdev *)arg;
- if (cgd->pd_type != T_SEQUENTIAL)
+ if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL)
break;
/*
@@ -1397,8 +1397,8 @@ saregister(struct cam_periph *periph, void *arg)
* indicate that the blocksize is unavailable right now.
*/
devstat_add_entry(&softc->device_stats, "sa", periph->unit_number, 0,
- DEVSTAT_BS_UNAVAILABLE, cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
- DEVSTAT_PRIORITY_TAPE);
+ DEVSTAT_BS_UNAVAILABLE, SID_TYPE(&cgd->inq_data) |
+ DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_TAPE);
softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV,
periph->unit_number, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
OpenPOWER on IntegriCloud