diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2012-09-18 18:19:30 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-11-14 06:11:31 +0100 |
commit | 3c6bdaeab4fda6c9fdd5f3f5c610dea97bddf7d6 (patch) | |
tree | 85fad84ab7a257e1da2465711e6af8569934cf7c /include | |
parent | [SCSI] isci: copy fis 0x34 response into proper buffer (diff) | |
download | linux-3c6bdaeab4fda6c9fdd5f3f5c610dea97bddf7d6.tar.xz linux-3c6bdaeab4fda6c9fdd5f3f5c610dea97bddf7d6.zip |
[SCSI] Add a report opcode helper
The REPORT SUPPORTED OPERATION CODES command can be used to query
whether a given opcode is supported by a device. Add a helper function
that allows us to look up commands.
We only issue RSOC if the device reports compliance with SPC-3 or
later. But to err on the side of caution we disable the command for ATA,
FireWire and USB.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/scsi_device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 88fae8d20154..379d465e8070 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -135,6 +135,7 @@ struct scsi_device { * because we did a bus reset. */ unsigned use_10_for_rw:1; /* first try 10-byte read / write */ unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ + unsigned no_report_opcodes:1; /* no REPORT SUPPORTED OPERATION CODES */ unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ unsigned skip_vpd_pages:1; /* do not read VPD pages */ @@ -362,6 +363,8 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, struct scsi_sense_hdr *sshdr); extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, int buf_len); +extern int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, + unsigned int len, unsigned char opcode); extern int scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state); extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, |