qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/usb-msd: fix some usb requests
@ 2010-03-10  9:45 Arnaud Patard
  2010-03-10 19:40 ` David S. Ahern
  2010-03-17 16:58 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaud Patard @ 2010-03-10  9:45 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]


The usb-msd device emulation needs some small tweaks in the requests
emulations. For instance, the reset/maxlun requests are class/interface
specific so requests for them with the type class and recipient interface
bits sets have to be handled.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
---

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: usb-msd-request-fixes.patch --]
[-- Type: text/x-diff, Size: 940 bytes --]

diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index bb39b62..bec82f9 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -321,17 +321,19 @@ static int usb_msd_handle_control(USBDevice *dev, int request, int value,
         ret = 0;
         break;
     case EndpointOutRequest | USB_REQ_CLEAR_FEATURE:
-        if (value == 0 && index != 0x81) { /* clear ep halt */
-            goto fail;
-        }
+        ret = 0;
+        break;
+    case InterfaceOutRequest | USB_REQ_SET_INTERFACE:
         ret = 0;
         break;
         /* Class specific requests.  */
+    case (((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | MassStorageReset):
     case MassStorageReset:
         /* Reset state ready for the next CBW.  */
         s->mode = USB_MSDM_CBW;
         ret = 0;
         break;
+    case (((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | GetMaxLun):
     case GetMaxLun:
         data[0] = 0;
         ret = 1;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-17 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-10  9:45 [Qemu-devel] [PATCH] hw/usb-msd: fix some usb requests Arnaud Patard
2010-03-10 19:40 ` David S. Ahern
2010-03-17 16:58 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).