Skip to contentSkip to conversation

[5292] scsi-generic: correct 6-bytes commands transfer length ( Laurent Vivier)

Qemu-devel Anthony Liguori 1 participant 1 message Sep 22, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5292

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5292
Author:   aliguori
Date:     2008-09-22 15:30:26 +0000 (Mon, 22 Sep 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
trunk/hw/scsi-generic.c

Modified: trunk/hw/scsi-generic.c
===================================================================

hw/scsi-generic.c +3 -0
@@ -352,6 +352,9 @@
     case 0:
         *len = cmd[4];
         *cmdlen = 6;
+        /* length 0 means 256 blocks */
+        if (*len == 0)
+            *len = 256;
         break;
     case 1:
     case 2: