aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-22 15:30:26 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-22 15:30:26 +0000
commit72ecb8d9dd339d8c7f3227b25b98b726e3933ebd (patch)
tree40ca935ebf2d717b46c9fb36cd8b73c511ffab32
parent4f26a4867cf09fc486cd68a1e05a018767290260 (diff)
scsi-generic: correct 6-bytes commands transfer length (Laurent Vivier)
According to SCSI documentation, for 6 bytes commands (READ(6), WRITE(6)), if transfer length is 0 it specifies 256 blocks. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5292 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--hw/scsi-generic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 88147b5df0..e23276f90c 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -352,6 +352,9 @@ static int scsi_length(uint8_t *cmd, int blocksize, int *cmdlen, uint32_t *len)
case 0:
*len = cmd[4];
*cmdlen = 6;
+ /* length 0 means 256 blocks */
+ if (*len == 0)
+ *len = 256;
break;
case 1:
case 2: