summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi/scsi_all.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/scsi/scsi_all.c')
-rw-r--r--sys/cam/scsi/scsi_all.c54
1 files changed, 39 insertions, 15 deletions
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index df23ff9..d2c8fbb 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -2582,6 +2582,34 @@ scsi_log_select(struct ccb_scsiio *csio, u_int32_t retries,
timeout);
}
+/*
+ * Prevent or allow the user to remove the media
+ */
+void
+scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ u_int8_t tag_action, u_int8_t action,
+ u_int8_t sense_len, u_int32_t timeout)
+{
+ struct scsi_prevent *scsi_cmd;
+
+ cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ /*flags*/CAM_DIR_NONE,
+ tag_action,
+ /*data_ptr*/NULL,
+ /*dxfer_len*/0,
+ sense_len,
+ sizeof(*scsi_cmd),
+ timeout);
+
+ scsi_cmd = (struct scsi_prevent *)&csio->cdb_io.cdb_bytes;
+ bzero(scsi_cmd, sizeof(*scsi_cmd));
+ scsi_cmd->opcode = PREVENT_ALLOW;
+ scsi_cmd->how = action;
+}
+
/* XXX allow specification of address and PMI bit and LBA */
void
scsi_read_capacity(struct ccb_scsiio *csio, u_int32_t retries,
@@ -2608,32 +2636,28 @@ scsi_read_capacity(struct ccb_scsiio *csio, u_int32_t retries,
scsi_cmd->opcode = READ_CAPACITY;
}
-/*
- * Prevent or allow the user to remove the media
- */
void
-scsi_prevent(struct ccb_scsiio *csio, u_int32_t retries,
- void (*cbfcnp)(struct cam_periph *, union ccb *),
- u_int8_t tag_action, u_int8_t action,
- u_int8_t sense_len, u_int32_t timeout)
+scsi_report_luns(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ u_int8_t tag_action, struct scsi_report_luns_data *rpl_buf,
+ u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout)
{
- struct scsi_prevent *scsi_cmd;
+ struct scsi_report_luns *scsi_cmd;
cam_fill_csio(csio,
retries,
cbfcnp,
- /*flags*/CAM_DIR_NONE,
+ /*flags*/CAM_DIR_IN,
tag_action,
- /*data_ptr*/NULL,
- /*dxfer_len*/0,
+ /*data_ptr*/(u_int8_t *)rpl_buf,
+ /*dxfer_len*/alloc_len,
sense_len,
sizeof(*scsi_cmd),
timeout);
-
- scsi_cmd = (struct scsi_prevent *)&csio->cdb_io.cdb_bytes;
+ scsi_cmd = (struct scsi_report_luns *)&csio->cdb_io.cdb_bytes;
bzero(scsi_cmd, sizeof(*scsi_cmd));
- scsi_cmd->opcode = PREVENT_ALLOW;
- scsi_cmd->how = action;
+ scsi_cmd->opcode = REPORT_LUNS;
+ scsi_ulto4b(alloc_len, scsi_cmd->addr);
}
/*
OpenPOWER on IntegriCloud