[RESEND,1/2] Fix USB mouse Set_Protocol behavior

Submitted by Kevin O'Connor on May 28, 2011, 3:47 p.m.

Details

Message ID 20110528154715.GA27635@morn.localdomain
State New
Headers show

Commit Message

Kevin O'Connor May 28, 2011, 3:47 p.m.
The QEMU USB mouse claims to support the "boot" protocol
(bInterfaceSubClass is 1).  However, the mouse rejects the
Set_Protocol command.

The qemu mouse does support the "boot" protocol specification, so a
simple fix is to enable the Set_Protocol request.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---
 hw/usb-hid.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Gerd Hoffmann May 30, 2011, 6:55 a.m.
On 05/28/11 17:47, Kevin O'Connor wrote:
> The QEMU USB mouse claims to support the "boot" protocol
> (bInterfaceSubClass is 1).  However, the mouse rejects the
> Set_Protocol command.
>
> The qemu mouse does support the "boot" protocol specification, so a
> simple fix is to enable the Set_Protocol request.

Added to the usb patch queue (both).

thanks,
   Gerd

Patch hide | download patch | download mbox

diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index 89c293c..268669b 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -779,13 +779,13 @@  static int usb_hid_handle_control(USBDevice *dev, int request, int value,
             goto fail;
         break;
     case GET_PROTOCOL:
-        if (s->kind != USB_KEYBOARD)
+        if (s->kind != USB_KEYBOARD && s->kind != USB_MOUSE)
             goto fail;
         ret = 1;
         data[0] = s->protocol;
         break;
     case SET_PROTOCOL:
-        if (s->kind != USB_KEYBOARD)
+        if (s->kind != USB_KEYBOARD && s->kind != USB_MOUSE)
             goto fail;
         ret = 0;
         s->protocol = value;