Skip to contentSkip to conversation

scsi-generic: correct 6-bytes commands transfer length

PATCH Applied Laurent Vivier 2 participants 2 messages Sep 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi-generic: correct 6-bytes commands transfer length

According to SCSI documentation, for 6 bytes commands (READ(6), WRITE(6)), if transfer length is 0 it specifies 256 blocks.

---
 hw/scsi-generic.c |    3 +++
 1 file changed, 3 insertions(+)
hw/scsi-generic.c +3 -0
Index: qemu/hw/scsi-generic.c
===================================================================
@@ -352,6 +352,9 @@ static int scsi_length(uint8_t *cmd, int
     case 0:
         *len = cmd[4];
         *cmdlen = 6;
+        /* length 0 means 256 blocks */
+        if (*len == 0)
+            *len = 256;
         break;
     case 1:
     case 2:
Signature · 3 lines
----------------- [email protected]  ------------------
  "La perfection est atteinte non quand il ne reste rien à
ajouter mais quand il ne reste rien à enlever." Saint Exupéry
#1 lore raw
Quoted 5 lines · Laurent Vivier

According to SCSI documentation, for 6 bytes commands (READ(6), WRITE(6)), if transfer length is 0 it specifies 256 blocks.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 19 lines
---
 hw/scsi-generic.c |    3 +++
 1 file changed, 3 insertions(+)

Index: qemu/hw/scsi-generic.c
===================================================================

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