提交 065c2599 编写于 作者: P Paolo Bonzini

scsi: parse 16-byte tape CDBs

The transfer length for these commands is different from the transfer
length of the corresponding disk commands, so parse it specially.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 f62d0594
...@@ -891,6 +891,16 @@ static int scsi_req_stream_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *bu ...@@ -891,6 +891,16 @@ static int scsi_req_stream_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *bu
cmd->xfer *= dev->blocksize; cmd->xfer *= dev->blocksize;
} }
break; break;
case READ_16:
case READ_REVERSE_16:
case VERIFY_16:
case WRITE_16:
cmd->len = 16;
cmd->xfer = buf[14] | (buf[13] << 8) | (buf[12] << 16);
if (buf[1] & 0x01) { /* fixed */
cmd->xfer *= dev->blocksize;
}
break;
case REWIND: case REWIND:
case START_STOP: case START_STOP:
cmd->len = 6; cmd->len = 6;
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
#define PERSISTENT_RESERVE_OUT 0x5f #define PERSISTENT_RESERVE_OUT 0x5f
#define VARLENGTH_CDB 0x7f #define VARLENGTH_CDB 0x7f
#define WRITE_FILEMARKS_16 0x80 #define WRITE_FILEMARKS_16 0x80
#define READ_REVERSE_16 0x81
#define ALLOW_OVERWRITE 0x82 #define ALLOW_OVERWRITE 0x82
#define EXTENDED_COPY 0x83 #define EXTENDED_COPY 0x83
#define ATA_PASSTHROUGH 0x85 #define ATA_PASSTHROUGH 0x85
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册