* [Qemu-devel] [6211] fix usb-hid SET_IDLE behaviour (Stefano Stabellini)
@ 2009-01-07 16:41 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-01-07 16:41 UTC (permalink / raw)
To: qemu-devel
Revision: 6211
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6211
Author: aliguori
Date: 2009-01-07 16:41:47 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
fix usb-hid SET_IDLE behaviour (Stefano Stabellini)
the usb-hid spec states that the SET_IDLE request has a 16bit value,
where the upper byte specifies the idle rate (currently unimplemented,
we handle only the 0 case, meaning infinite duration) and the lower
byte specifies the report id (0 means all reports).
In our code we do idle = value, while it should be idle = "upper byte",
especially if the guest issues a GET_IDLE, we should return only the
idle rate while we are returning only the report id.
In practice it doesn't make much difference because I have only seen
SET_VALUE with both bytes set to 0 so far, but still it is wrong.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/hw/usb-hid.c
Modified: trunk/hw/usb-hid.c
===================================================================
--- trunk/hw/usb-hid.c 2009-01-07 14:19:38 UTC (rev 6210)
+++ trunk/hw/usb-hid.c 2009-01-07 16:41:47 UTC (rev 6211)
@@ -65,7 +65,7 @@
};
int kind;
int protocol;
- int idle;
+ uint8_t idle;
int changed;
void *datain_opaque;
void (*datain)(void *);
@@ -794,7 +794,7 @@
data[0] = s->idle;
break;
case SET_IDLE:
- s->idle = value;
+ s->idle = (uint8_t) (value >> 8);
ret = 0;
break;
default:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-07 16:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 16:41 [Qemu-devel] [6211] fix usb-hid SET_IDLE behaviour (Stefano Stabellini) Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.