* [Qemu-devel] [4253] Fix USB and HID report descriptors for mouse and tablet.
@ 2008-04-26 1:43 Andrzej Zaborowski
2008-05-17 12:48 ` Alexander Graf
0 siblings, 1 reply; 4+ messages in thread
From: Andrzej Zaborowski @ 2008-04-26 1:43 UTC (permalink / raw)
To: qemu-devel
Revision: 4253
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4253
Author: balrog
Date: 2008-04-26 01:43:07 +0000 (Sat, 26 Apr 2008)
Log Message:
-----------
Fix USB and HID report descriptors for mouse and tablet.
Modified Paths:
--------------
trunk/hw/usb-hid.c
Modified: trunk/hw/usb-hid.c
===================================================================
--- trunk/hw/usb-hid.c 2008-04-25 00:59:43 UTC (rev 4252)
+++ trunk/hw/usb-hid.c 2008-04-26 01:43:07 UTC (rev 4253)
@@ -134,14 +134,14 @@
0x00, /* u8 country_code */
0x01, /* u8 num_descriptors */
0x22, /* u8 type; Report */
- 50, 0, /* u16 len */
+ 52, 0, /* u16 len */
/* one endpoint (status change endpoint) */
0x07, /* u8 ep_bLength; */
0x05, /* u8 ep_bDescriptorType; Endpoint */
0x81, /* u8 ep_bEndpointAddress; IN Endpoint 1 */
0x03, /* u8 ep_bmAttributes; Interrupt */
- 0x03, 0x00, /* u16 ep_wMaxPacketSize; */
+ 0x04, 0x00, /* u16 ep_wMaxPacketSize; */
0x0a, /* u8 ep_bInterval; (255ms -- usb 2.0 spec) */
};
@@ -260,16 +260,14 @@
0xA1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03,
0x15, 0x00, 0x25, 0x01, 0x95, 0x03, 0x75, 0x01,
0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x01,
- 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81,
- 0x25, 0x7F, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06,
- 0x05, 0x01, 0x09, 0x38, 0x15, 0x81, 0x25, 0x7F,
- 0x35, 0x00, 0x45, 0x00, 0x75, 0x08, 0x95, 0x01,
- 0x81, 0x02, 0xC0, 0xC0,
+ 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x09, 0x38,
+ 0x15, 0x81, 0x25, 0x7F, 0x75, 0x08, 0x95, 0x03,
+ 0x81, 0x06, 0xC0, 0xC0,
};
static const uint8_t qemu_tablet_hid_report_descriptor[] = {
0x05, 0x01, /* Usage Page Generic Desktop */
- 0x09, 0x01, /* Usage Mouse */
+ 0x09, 0x01, /* Usage Pointer */
0xA1, 0x01, /* Collection Application */
0x09, 0x01, /* Usage Pointer */
0xA1, 0x00, /* Collection Physical */
@@ -283,7 +281,7 @@
0x81, 0x02, /* Input (Data, Var, Abs) */
0x95, 0x01, /* Report Count 1 */
0x75, 0x05, /* Report Size 5 */
- 0x81, 0x01, /* Input (Cnst, Var, Abs) */
+ 0x81, 0x01, /* Input (Cnst, Array, Abs) */
0x05, 0x01, /* Usage Page Generic Desktop */
0x09, 0x30, /* Usage X */
0x09, 0x31, /* Usage Y */
@@ -302,7 +300,7 @@
0x45, 0x00, /* Physical Maximum 0 (same as logical) */
0x75, 0x08, /* Report Size 8 */
0x95, 0x01, /* Report Count 1 */
- 0x81, 0x02, /* Input (Data, Var, Rel) */
+ 0x81, 0x06, /* Input (Data, Var, Rel) */
0xC0, /* End Collection */
0xC0, /* End Collection */
};
@@ -495,14 +493,15 @@
if (s->buttons_state & MOUSE_EVENT_MBUTTON)
b |= 0x04;
- buf[0] = b;
- buf[1] = dx;
- buf[2] = dy;
- l = 3;
- if (len >= 4) {
- buf[3] = dz;
- l = 4;
- }
+ l = 0;
+ if (len > l)
+ buf[l ++] = b;
+ if (len > l)
+ buf[l ++] = dx;
+ if (len > l)
+ buf[l ++] = dy;
+ if (len > l)
+ buf[l ++] = dz;
return l;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [4253] Fix USB and HID report descriptors for mouse and tablet.
2008-04-26 1:43 [Qemu-devel] [4253] Fix USB and HID report descriptors for mouse and tablet Andrzej Zaborowski
@ 2008-05-17 12:48 ` Alexander Graf
2008-05-17 19:59 ` andrzej zaborowski
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2008-05-17 12:48 UTC (permalink / raw)
To: qemu-devel
As of this commit the USB mouse wheel works, but is inverted.
I'm also having trouble understanding the hex descriptor blobs. Is
there any chance someone who just "knows" what these mean could
comment them in the source? That would be very helpful.
Thank you,
Alex
On Apr 26, 2008, at 3:43 AM, Andrzej Zaborowski wrote:
> Revision: 4253
> http://svn.sv.gnu.org/viewvc/?
> view=rev&root=qemu&revision=4253
> Author: balrog
> Date: 2008-04-26 01:43:07 +0000 (Sat, 26 Apr 2008)
>
> Log Message:
> -----------
> Fix USB and HID report descriptors for mouse and tablet.
>
> Modified Paths:
> --------------
> trunk/hw/usb-hid.c
>
> Modified: trunk/hw/usb-hid.c
> ===================================================================
> --- trunk/hw/usb-hid.c 2008-04-25 00:59:43 UTC (rev 4252)
> +++ trunk/hw/usb-hid.c 2008-04-26 01:43:07 UTC (rev 4253)
> @@ -134,14 +134,14 @@
> 0x00, /* u8 country_code */
> 0x01, /* u8 num_descriptors */
> 0x22, /* u8 type; Report */
> - 50, 0, /* u16 len */
> + 52, 0, /* u16 len */
>
> /* one endpoint (status change endpoint) */
> 0x07, /* u8 ep_bLength; */
> 0x05, /* u8 ep_bDescriptorType; Endpoint */
> 0x81, /* u8 ep_bEndpointAddress; IN Endpoint 1 */
> 0x03, /* u8 ep_bmAttributes; Interrupt */
> - 0x03, 0x00, /* u16 ep_wMaxPacketSize; */
> + 0x04, 0x00, /* u16 ep_wMaxPacketSize; */
> 0x0a, /* u8 ep_bInterval; (255ms -- usb 2.0 spec) */
> };
>
> @@ -260,16 +260,14 @@
> 0xA1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03,
> 0x15, 0x00, 0x25, 0x01, 0x95, 0x03, 0x75, 0x01,
> 0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x01,
> - 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81,
> - 0x25, 0x7F, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06,
> - 0x05, 0x01, 0x09, 0x38, 0x15, 0x81, 0x25, 0x7F,
> - 0x35, 0x00, 0x45, 0x00, 0x75, 0x08, 0x95, 0x01,
> - 0x81, 0x02, 0xC0, 0xC0,
> + 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x09, 0x38,
> + 0x15, 0x81, 0x25, 0x7F, 0x75, 0x08, 0x95, 0x03,
> + 0x81, 0x06, 0xC0, 0xC0,
> };
>
> static const uint8_t qemu_tablet_hid_report_descriptor[] = {
> 0x05, 0x01, /* Usage Page Generic Desktop */
> - 0x09, 0x01, /* Usage Mouse */
> + 0x09, 0x01, /* Usage Pointer */
> 0xA1, 0x01, /* Collection Application */
> 0x09, 0x01, /* Usage Pointer */
> 0xA1, 0x00, /* Collection Physical */
> @@ -283,7 +281,7 @@
> 0x81, 0x02, /* Input (Data, Var, Abs) */
> 0x95, 0x01, /* Report Count 1 */
> 0x75, 0x05, /* Report Size 5 */
> - 0x81, 0x01, /* Input (Cnst, Var, Abs) */
> + 0x81, 0x01, /* Input (Cnst, Array, Abs) */
> 0x05, 0x01, /* Usage Page Generic Desktop */
> 0x09, 0x30, /* Usage X */
> 0x09, 0x31, /* Usage Y */
> @@ -302,7 +300,7 @@
> 0x45, 0x00, /* Physical Maximum 0 (same as logical) */
> 0x75, 0x08, /* Report Size 8 */
> 0x95, 0x01, /* Report Count 1 */
> - 0x81, 0x02, /* Input (Data, Var, Rel) */
> + 0x81, 0x06, /* Input (Data, Var, Rel) */
> 0xC0, /* End Collection */
> 0xC0, /* End Collection */
> };
> @@ -495,14 +493,15 @@
> if (s->buttons_state & MOUSE_EVENT_MBUTTON)
> b |= 0x04;
>
> - buf[0] = b;
> - buf[1] = dx;
> - buf[2] = dy;
> - l = 3;
> - if (len >= 4) {
> - buf[3] = dz;
> - l = 4;
> - }
> + l = 0;
> + if (len > l)
> + buf[l ++] = b;
> + if (len > l)
> + buf[l ++] = dx;
> + if (len > l)
> + buf[l ++] = dy;
> + if (len > l)
> + buf[l ++] = dz;
> return l;
> }
>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [4253] Fix USB and HID report descriptors for mouse and tablet.
2008-05-17 12:48 ` Alexander Graf
@ 2008-05-17 19:59 ` andrzej zaborowski
2008-05-18 2:31 ` Alexander Graf
0 siblings, 1 reply; 4+ messages in thread
From: andrzej zaborowski @ 2008-05-17 19:59 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel
On 17/05/2008, Alexander Graf <agraf@suse.de> wrote:
> As of this commit the USB mouse wheel works, but is inverted.
I now inverted the wheel to get un-inverted values, but as previously
I only tested using cat /dev/input/eventX, so please test.
--
Please do not print this email unless absolutely necessary. Spread
environmental awareness.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [4253] Fix USB and HID report descriptors for mouse and tablet.
2008-05-17 19:59 ` andrzej zaborowski
@ 2008-05-18 2:31 ` Alexander Graf
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2008-05-18 2:31 UTC (permalink / raw)
To: qemu-devel
On May 17, 2008, at 9:59 PM, Andrzej Zaborowski wrote:
> On 17/05/2008, Alexander Graf <agraf@suse.de> wrote:
>> As of this commit the USB mouse wheel works, but is inverted.
>
> I now inverted the wheel to get un-inverted values, but as previously
> I only tested using cat /dev/input/eventX, so please test.
Works fine for me. Thanks a lot!
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-18 2:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-26 1:43 [Qemu-devel] [4253] Fix USB and HID report descriptors for mouse and tablet Andrzej Zaborowski
2008-05-17 12:48 ` Alexander Graf
2008-05-17 19:59 ` andrzej zaborowski
2008-05-18 2:31 ` Alexander Graf
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).