]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
ahci: SATA FIS is 20 bytes, not 0x20
authorDaniel Verkamp <daniel@drv.nu>
Tue, 22 May 2012 23:26:42 +0000 (16:26 -0700)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 25 Jun 2012 15:58:24 +0000 (10:58 -0500)
As in the SATA and AHCI specifications, a FIS is 5 Dwords of 4 bytes
each, which comes to 20 bytes (decimal), not 0x20.

Signed-off-by: Daniel Verkamp <daniel@drv.nu>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 4bb9c939a57103898f5a51aa6a7336eb3320d923)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ide/ahci.c

index a883a920be16c8420fa009c049a3bca430e381ba..2d7d03d7724c8746a069bc535e655113dce2157d 100644 (file)
@@ -462,7 +462,7 @@ static void ahci_check_cmd_bh(void *opaque)
 
 static void ahci_init_d2h(AHCIDevice *ad)
 {
-    uint8_t init_fis[0x20];
+    uint8_t init_fis[20];
     IDEState *ide_state = &ad->port.ifs[0];
 
     memset(init_fis, 0, sizeof(init_fis));
@@ -619,7 +619,7 @@ static void ahci_write_fis_d2h(AHCIDevice *ad, uint8_t *cmd_fis)
     d2h_fis[11] = cmd_fis[11];
     d2h_fis[12] = cmd_fis[12];
     d2h_fis[13] = cmd_fis[13];
-    for (i = 14; i < 0x20; i++) {
+    for (i = 14; i < 20; i++) {
         d2h_fis[i] = 0;
     }