Re: [hatari-devel] Patch for INQUIRY command (ACSI emulation) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Patch for INQUIRY command (ACSI emulation)
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Fri, 11 Oct 2013 17:26:42 +0200
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1381505202; l=1977; s=domk; d=seimet.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=IH3F3p7P1eEWqWWioB/Z7iNYivk=; b=ldGfhsNJsyiV6PyzjS82qFU8vkoVn42BrpA1/FKnW/Y2h2nqetFJFpyxfjdplzGHfEy qRca/M0MVcysOhhtIncsWIiF+DvgGepp+u9rDI8vHt1g1ut9Vms2U8scLLIsLO7ag5kdL m6nRK9HjA1Ct6LDe2eUZ1CqO0KZrJwYLbUk=
Hi again,
> The attached patch fixes a small problem with the ACSI drive emulation.
I also noticed that the format of the INQUIRY data returned is a bit
strange. The attached patch contains update INQUIRY data and also
includes the previous change regarding the handling of unsupported LUNs.
Take care
Uwe
diff -r 558497b06d63 src/hdc.c
--- a/src/hdc.c Mon Oct 07 23:58:34 2013 +0200
+++ b/src/hdc.c Fri Oct 11 17:23:14 2013 +0200
@@ -89,12 +89,12 @@
0, /* device type qualifier (nonremovable) */
1, /* ANSI version */
0, /* reserved */
- 26, /* length of the following data */
- ' ', ' ', ' ', /* Vendor specific data */
+ 31, /* length of the following data */
+ 0,0,0, /* Vendor specific data */
'H','a','t','a','r','i',' ',' ', /* Vendor */
'E','m','u','l','a','t','e','d', /* Model */
- ' ',' ',' ',' ', /* Revision */
- 0,0,0,0,0,0,0,0,0,0 /* ?? */
+ ' ',' ',' ',' ',' ',' ',' ',' ',
+ ' ',' ',' ',' ' /* Revision */
};
@@ -192,6 +192,10 @@
if (count > (int)sizeof(inquiry_bytes))
count = sizeof(inquiry_bytes);
+ /* For unsupported LUNs set the Peripheral Qualifier and the
+ Peripheral Device Type according to the SCSI standard */
+ inquiry_bytes[0] = HDC_GetDevice() == 0 ? 0 : 0x7F;
+
inquiry_bytes[4] = count - 8;
if (STMemory_SafeCopy(nDmaAddr, inquiry_bytes, count, "HDC DMA inquiry"))
@@ -907,8 +911,9 @@
#ifdef HDC_REALLY_VERBOSE
HDC_DebugCommandPacket(stderr);
#endif
- /* If it's aimed for our drive, emulate it! */
- if (HDC_GetDevice() == 0)
+ /* If it's aimed for our drive, emulate it!
+ INQUIRY must always be handled, see SCSI standard */
+ if (HDC_GetDevice() == 0 || HDCCommand.opcode == 0x12)
{
HDC_EmulateCommandPacket();
}