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: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f62d059460
commit
065c25996b
@ -891,6 +891,16 @@ static int scsi_req_stream_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *bu
|
||||
cmd->xfer *= dev->blocksize;
|
||||
}
|
||||
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 START_STOP:
|
||||
cmd->len = 6;
|
||||
|
@ -92,6 +92,7 @@
|
||||
#define PERSISTENT_RESERVE_OUT 0x5f
|
||||
#define VARLENGTH_CDB 0x7f
|
||||
#define WRITE_FILEMARKS_16 0x80
|
||||
#define READ_REVERSE_16 0x81
|
||||
#define ALLOW_OVERWRITE 0x82
|
||||
#define EXTENDED_COPY 0x83
|
||||
#define ATA_PASSTHROUGH 0x85
|
||||
|
Loading…
Reference in New Issue
Block a user