summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/scsi.h
diff options
context:
space:
mode:
authorMichael Brown2006-12-12 19:54:35 +0100
committerMichael Brown2006-12-12 19:54:35 +0100
commita39b11168442a6437c293fa65e31fff636d6cd9c (patch)
treece831c4eac8353c441b98314283d6b02341fe671 /src/include/gpxe/scsi.h
parentCatch SCSI errors, and work around the start-of-day CHECK CONDITION (diff)
downloadipxe-a39b11168442a6437c293fa65e31fff636d6cd9c.tar.gz
ipxe-a39b11168442a6437c293fa65e31fff636d6cd9c.tar.xz
ipxe-a39b11168442a6437c293fa65e31fff636d6cd9c.zip
Automatically select between the "10" and "16" variants of command set,
based on the device size.
Diffstat (limited to 'src/include/gpxe/scsi.h')
-rw-r--r--src/include/gpxe/scsi.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/include/gpxe/scsi.h b/src/include/gpxe/scsi.h
index 4cc2b86d..9d5952da 100644
--- a/src/include/gpxe/scsi.h
+++ b/src/include/gpxe/scsi.h
@@ -16,7 +16,9 @@
* @{
*/
+#define SCSI_OPCODE_READ_10 0x28 /**< READ (10) */
#define SCSI_OPCODE_READ_16 0x88 /**< READ (16) */
+#define SCSI_OPCODE_WRITE_10 0x2a /**< WRITE (10) */
#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 */
@@ -40,6 +42,28 @@
* @{
*/
+/** A SCSI "READ (10)" CDB */
+struct scsi_cdb_read_10 {
+ /** Opcode (0x28) */
+ uint8_t opcode;
+ /** Flags */
+ uint8_t flags;
+ /** Start address
+ *
+ * This is a logical block number, in big-endian order.
+ */
+ uint32_t lba;
+ /** Group number */
+ uint8_t group;
+ /** Transfer length
+ *
+ * This is a logical block count, in big-endian order.
+ */
+ uint16_t len;
+ /** Control byte */
+ uint8_t control;
+} __attribute__ (( packed ));
+
/** A SCSI "READ (16)" CDB */
struct scsi_cdb_read_16 {
/** Opcode (0x88) */
@@ -62,6 +86,28 @@ struct scsi_cdb_read_16 {
uint8_t control;
} __attribute__ (( packed ));
+/** A SCSI "WRITE (10)" CDB */
+struct scsi_cdb_write_10 {
+ /** Opcode (0x2a) */
+ uint8_t opcode;
+ /** Flags */
+ uint8_t flags;
+ /** Start address
+ *
+ * This is a logical block number, in big-endian order.
+ */
+ uint32_t lba;
+ /** Group number */
+ uint8_t group;
+ /** Transfer length
+ *
+ * This is a logical block count, in big-endian order.
+ */
+ uint16_t len;
+ /** Control byte */
+ uint8_t control;
+} __attribute__ (( packed ));
+
/** A SCSI "WRITE (16)" CDB */
struct scsi_cdb_write_16 {
/** Opcode (0x8a) */
@@ -143,7 +189,9 @@ struct scsi_capacity_16 {
/** A SCSI Command Data Block */
union scsi_cdb {
+ struct scsi_cdb_read_10 read10;
struct scsi_cdb_read_16 read16;
+ struct scsi_cdb_write_10 write10;
struct scsi_cdb_write_16 write16;
struct scsi_cdb_read_capacity_10 readcap10;
struct scsi_cdb_read_capacity_16 readcap16;