summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/scsi.h
diff options
context:
space:
mode:
authorMichael Brown2010-10-16 14:53:38 +0200
committerMichael Brown2010-10-19 20:10:02 +0200
commit57bab0ae4a1fd4241017a4a4a90d933c91d7fda8 (patch)
treecc173ecfb34e5ecefd800bb39a5259b9f8e178bb /src/include/ipxe/scsi.h
parent[fc] Do not use the command reference number in FCP_CMND IUs (diff)
downloadipxe-57bab0ae4a1fd4241017a4a4a90d933c91d7fda8.tar.gz
ipxe-57bab0ae4a1fd4241017a4a4a90d933c91d7fda8.tar.xz
ipxe-57bab0ae4a1fd4241017a4a4a90d933c91d7fda8.zip
[scsi] Wait for a successful TEST UNIT READY command
Some SCSI targets (observed with an EMC CLARiiON Fibre Channel target) will not respond to commands correctly until a TEST UNIT READY has been issued. In particular, a READ CAPACITY (10) command will return with a success status, but no capacity data. Fix by issuing a TEST UNIT READY command automatically, and delaying further SCSI commands until the TEST UNIT READY has succeeded. Reported-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/scsi.h')
-rw-r--r--src/include/ipxe/scsi.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/ipxe/scsi.h b/src/include/ipxe/scsi.h
index 5539b61d..6dfb7f1e 100644
--- a/src/include/ipxe/scsi.h
+++ b/src/include/ipxe/scsi.h
@@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define SCSI_OPCODE_READ_CAPACITY_10 0x25 /**< READ CAPACITY (10) */
#define SCSI_OPCODE_SERVICE_ACTION_IN 0x9e /**< SERVICE ACTION IN */
#define SCSI_SERVICE_ACTION_READ_CAPACITY_16 0x10 /**< READ CAPACITY (16) */
+#define SCSI_OPCODE_TEST_UNIT_READY 0x00 /**< TEST UNIT READY */
/** @} */
@@ -192,6 +193,16 @@ struct scsi_capacity_16 {
uint8_t reserved[20];
} __attribute__ (( packed ));
+/** A SCSI "TEST UNIT READY" CDB */
+struct scsi_cdb_test_unit_ready {
+ /** Opcode (0x00) */
+ uint8_t opcode;
+ /** Reserved */
+ uint8_t reserved[4];
+ /** Control byte */
+ uint8_t control;
+} __attribute__ (( packed ));
+
/** A SCSI Command Data Block */
union scsi_cdb {
struct scsi_cdb_read_10 read10;
@@ -200,6 +211,7 @@ union scsi_cdb {
struct scsi_cdb_write_16 write16;
struct scsi_cdb_read_capacity_10 readcap10;
struct scsi_cdb_read_capacity_16 readcap16;
+ struct scsi_cdb_test_unit_ready testready;
unsigned char bytes[16];
};