[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function |
Date: |
Wed, 21 May 2008 16:34:40 +0200 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20071114) |
The current implementation of GET_CONFIGURATION in the ATAPI stack of
qemu replies a different length depending on the buffer, the data should
be written into.
On the other hand the SCSI spec defines that length information has to
be consistent and independent of return buffer lengths.
This patch makes the ATAPI emulation behave according to the spec and
fixes the Darwin DVD driver.
Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
diff --git a/qemu/hw/ide.c b/qemu/hw/ide.c
index a2a8299..6e585e1 100644
--- a/qemu/hw/ide.c
+++ b/qemu/hw/ide.c
@@ -1717,6 +1717,7 @@ static void ide_atapi_cmd(IDEState *s)
case GPCMD_GET_CONFIGURATION:
{
uint32_t len;
+ uint8_t index = 0;
/* only feature 0 is supported */
if (packet[2] != 0 || packet[3] != 0) {
@@ -1753,14 +1754,11 @@ static void ide_atapi_cmd(IDEState *s)
}
len = 8; /* header completed */
- if (max_len > len) {
- uint8_t index = 0;
- buf[10] = 0x02 | 0x01; /* persistent and current */
- len += 4; /* header */
- len += ide_atapi_set_profile(buf, &index, MMC_PROFILE_DVD_ROM);
- len += ide_atapi_set_profile(buf, &index, MMC_PROFILE_CD_ROM);
- }
+ buf[10] = 0x02 | 0x01; /* persistent and current */
+ len += 4; /* header */
+ len += ide_atapi_set_profile(buf, &index, MMC_PROFILE_DVD_ROM);
+ len += ide_atapi_set_profile(buf, &index, MMC_PROFILE_CD_ROM);
cpu_to_ube32(buf, len - 4); /* data length */
ide_atapi_cmd_reply(s, len, max_len);
- [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function,
Alexander Graf <=
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Alexander Graf, 2008/05/24
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Alexander Graf, 2008/05/24
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Carlo Marcelo Arenas Belon, 2008/05/25
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Alexander Graf, 2008/05/25
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Carlo Marcelo Arenas Belon, 2008/05/25
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Alexander Graf, 2008/05/26
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Alexander Graf, 2008/05/26
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Carlo Marcelo Arenas Belon, 2008/05/27
- Re: [Qemu-devel] [PATCH] Fix ATAPI GET_CONFIGURATION function, Alexander Graf, 2008/05/29