summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/scsi.h
diff options
context:
space:
mode:
authorMichael Brown2006-05-19 20:54:38 +0200
committerMichael Brown2006-05-19 20:54:38 +0200
commit402ba15c6449f8dc7d5a31a04a9d7eb2eef330a3 (patch)
tree8c0f8e9ba74254f3a798539a3214bd23ecd6b897 /src/include/gpxe/scsi.h
parentAdd EOVERFLOW==ERANGE (diff)
downloadipxe-402ba15c6449f8dc7d5a31a04a9d7eb2eef330a3.tar.gz
ipxe-402ba15c6449f8dc7d5a31a04a9d7eb2eef330a3.tar.xz
ipxe-402ba15c6449f8dc7d5a31a04a9d7eb2eef330a3.zip
READ CAPACITY (16) turns out to be an optional command (even though
READ(16) is mandatory); we must use READ CAPACITY (10) first and then use READ CAPACITY (16) if the READ CAPACITY (10) returns "out of range".
Diffstat (limited to 'src/include/gpxe/scsi.h')
-rw-r--r--src/include/gpxe/scsi.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/gpxe/scsi.h b/src/include/gpxe/scsi.h
index d7da1255..d5620ef8 100644
--- a/src/include/gpxe/scsi.h
+++ b/src/include/gpxe/scsi.h
@@ -12,6 +12,7 @@
#define SCSI_OPCODE_READ_16 0x88 /**< READ (16) */
#define SCSI_OPCODE_WRITE_16 0x8a /**< WRITE (16) */
+#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) */
@@ -77,6 +78,31 @@ struct scsi_cdb_write_16 {
uint8_t control;
} __attribute__ (( packed ));
+/** A SCSI "READ CAPACITY (10)" CDB */
+struct scsi_cdb_read_capacity_10 {
+ /** Opcode (0x25) */
+ uint8_t opcode;
+ /** Reserved */
+ uint8_t reserved_a;
+ /** Logical block address
+ *
+ * Applicable only if the PMI bit is set.
+ */
+ uint32_t lba;
+ /** Reserved */
+ uint8_t reserved_b[3];
+ /** Control byte */
+ uint8_t control;
+} __attribute__ (( packed ));
+
+/** SCSI "READ CAPACITY (10)" parameter data */
+struct scsi_capacity_10 {
+ /** Maximum logical block number */
+ uint32_t lba;
+ /** Block length in bytes */
+ uint32_t blksize;
+} __attribute__ (( packed ));
+
/** A SCSI "READ CAPACITY (16)" CDB */
struct scsi_cdb_read_capacity_16 {
/** Opcode (0x9e) */
@@ -113,6 +139,7 @@ struct scsi_capacity_16 {
union scsi_cdb {
struct scsi_cdb_read_16 read16;
struct scsi_cdb_write_16 write16;
+ struct scsi_cdb_read_capacity_10 readcap10;
struct scsi_cdb_read_capacity_16 readcap16;
char bytes[16];
};