From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JA5pu-0005Gm-Jz for qemu-devel@nongnu.org; Wed, 02 Jan 2008 10:48:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JA5ps-0005EU-3W for qemu-devel@nongnu.org; Wed, 02 Jan 2008 10:48:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JA5ps-0005EO-0p for qemu-devel@nongnu.org; Wed, 02 Jan 2008 10:48:52 -0500 Received: from wa-out-1112.google.com ([209.85.146.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JA5pr-0006Ki-Hm for qemu-devel@nongnu.org; Wed, 02 Jan 2008 10:48:51 -0500 Received: by wa-out-1112.google.com with SMTP id k22so9768327waf.18 for ; Wed, 02 Jan 2008 07:48:49 -0800 (PST) Message-ID: Date: Wed, 2 Jan 2008 16:48:47 +0100 From: "=?ISO-8859-1?Q?Daniel_God=E1s?=" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3032_14393205.1199288927093" Subject: [Qemu-devel] Usb mouse fix Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_3032_14393205.1199288927093 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, i think ive found a little bug on the usb mouse emulation (only with the mouse, not the tablet), the wheel doesnt seem to work (it just doesnt do anything). Ive tracked the problem down to usb-hid.c: static const uint8_t qemu_mouse_hid_report_descriptor[] = { 0x05, 0x01, 0x09, 0x02, 0xA1, 0x01, 0x09, 0x01, 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, 0xC0, 0xC0, }; That descriptor doesnt contain a 'wheel' section so when the virtualized OS gives me the TD it only has space for dx and dy and not for the wheel delta (its got a maximum length of 3). To fix the problem i just modified the descriptor, here is the new one: static const uint8_t qemu_mouse_hid_report_descriptor[] = { 0x05, 0x01, 0x09, 0x02, 0xA1, 0x01, 0x09, 0x01, 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, }; Now the virtualized OS gives me a TD with a maximum length of 4 and the wheel works just fine. Cheers, Daniel ------=_Part_3032_14393205.1199288927093 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,

i think ive found a little bug on the usb mouse emulation (only with the mouse, not the tablet), the wheel doesnt seem to work (it just doesnt do anything). Ive tracked the problem down to usb-hid.c:

static const uint8_t qemu_mouse_hid_report_descriptor[] = {
    0x05, 0x01, 0x09, 0x02, 0xA1, 0x01, 0x09, 0x01,
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,
0xC0, 0xC0,
};
That descriptor doesnt contain a 'wheel' section so when the virtualized OS gives me the TD it only has space for dx and dy and not for the wheel delta (its got a maximum length of 3). To fix the problem i just modified the descriptor, here is the new one:

static const uint8_t qemu_mouse_hid_report_descriptor[] = {
    0x05, 0x01, 0x09, 0x02, 0xA1, 0x01, 0x09, 0x01,
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,
};
Now the virtualized OS gives me a TD with a maximum length of 4 and the wheel works just fine.

Cheers,
Daniel
------=_Part_3032_14393205.1199288927093--