Patchwork Fix qemu mouse Set_Protocol behavior

login
register
mail settings
Submitter Kevin O'Connor
Date May 2, 2010, 2:38 a.m.
Message ID <20100502023851.GA16268@morn.localdomain>
Download mbox | patch
Permalink /patch/51459/
State New
Headers show

Comments

Kevin O'Connor - May 2, 2010, 2:38 a.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 just enable the Set_Portocol request.

-Kevin
Shahar Havivi - May 2, 2010, 11:04 a.m.
On Sat, May 01, 2010 at 10:38:51PM -0400, Kevin O'Connor wrote:
> Date: Sat, 1 May 2010 22:38:51 -0400
> From: Kevin O'Connor <kevin@koconnor.net>
> To: qemu-devel@nongnu.org, seabios@seabios.org
> Cc: 
> Subject: [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior
> 
> 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 just enable the Set_Portocol request.
> 
> -Kevin
Isn't it true for the USB_TABLET as well?

Shahar.
> 
> 
> --- a/hw/usb-hid.c
> +++ b/hw/usb-hid.c
> @@ -790,13 +790,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;
> 
>
Anthony Liguori - May 3, 2010, 5:02 p.m.
On 05/01/2010 09:38 PM, 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 just enable the Set_Portocol request.
>
> -Kevin
>    

Could you included a Signed-of-by: and resubmit both patches?

Thanks,

Anthony Liguori

> --- a/hw/usb-hid.c
> +++ b/hw/usb-hid.c
> @@ -790,13 +790,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;
>
>
>
>

Patch

--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -790,13 +790,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;