* [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior
@ 2010-05-02 2:38 Kevin O'Connor
2010-05-02 11:04 ` Shahar Havivi
2010-05-03 17:02 ` Anthony Liguori
0 siblings, 2 replies; 4+ messages in thread
From: Kevin O'Connor @ 2010-05-02 2:38 UTC (permalink / raw)
To: qemu-devel, seabios
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
--- 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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior
2010-05-02 2:38 [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior Kevin O'Connor
@ 2010-05-02 11:04 ` Shahar Havivi
2010-05-02 17:39 ` Kevin O'Connor
2010-05-03 17:02 ` Anthony Liguori
1 sibling, 1 reply; 4+ messages in thread
From: Shahar Havivi @ 2010-05-02 11:04 UTC (permalink / raw)
To: Kevin O'Connor; +Cc: seabios, qemu-devel
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;
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior
2010-05-02 11:04 ` Shahar Havivi
@ 2010-05-02 17:39 ` Kevin O'Connor
0 siblings, 0 replies; 4+ messages in thread
From: Kevin O'Connor @ 2010-05-02 17:39 UTC (permalink / raw)
To: Shahar Havivi; +Cc: seabios, qemu-devel
On Sun, May 02, 2010 at 02:04:44PM +0300, Shahar Havivi wrote:
> On Sat, May 01, 2010 at 10:38:51PM -0400, 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.
> >
> Isn't it true for the USB_TABLET as well?
The USB tablet appears to also advertise that it supports the "boot"
protocol. However, its reports aren't "boot" protocol compatible.
So, it really shouldn't claim that. A fix (briefly tested) is below.
-Kevin
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -181,7 +181,7 @@ static const uint8_t qemu_tablet_config_descriptor[] = {
0x00, /* u8 if_bAlternateSetting; */
0x01, /* u8 if_bNumEndpoints; */
0x03, /* u8 if_bInterfaceClass; */
- 0x01, /* u8 if_bInterfaceSubClass; */
+ 0x00, /* u8 if_bInterfaceSubClass; */
0x02, /* u8 if_bInterfaceProtocol; [usb1.1 or single tt] */
0x07, /* u8 if_iInterface; */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior
2010-05-02 2:38 [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior Kevin O'Connor
2010-05-02 11:04 ` Shahar Havivi
@ 2010-05-03 17:02 ` Anthony Liguori
1 sibling, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2010-05-03 17:02 UTC (permalink / raw)
To: Kevin O'Connor; +Cc: seabios, qemu-devel
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;
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-03 17:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-02 2:38 [Qemu-devel] [PATCH] Fix qemu mouse Set_Protocol behavior Kevin O'Connor
2010-05-02 11:04 ` Shahar Havivi
2010-05-02 17:39 ` Kevin O'Connor
2010-05-03 17:02 ` 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).