summaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-03-24 17:20:54 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-03-24 17:20:54 +0100
commit2382e2c43c3386dab0a44f4cd90a351a91329a5c (patch)
treed0946b4d8b75a35184d40231f36efb9fa6507506 /hw/usb
parent3615170bd1ed6f09f878a8b538321044efddd8e0 (diff)
downloadqemu-2382e2c43c3386dab0a44f4cd90a351a91329a5c.tar.gz
unifying: make Get_Report provide sane mouse reports
...and ignore Get_Report for HID++ queries. 0x20 and 0x21 already return EPIPE on real hw, but even querying 0x10 and 0x11 does not make sense as the device index is not known. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/dev-unifying.c6
-rw-r--r--hw/usb/hid-logitech-dj.c7
2 files changed, 4 insertions, 9 deletions
diff --git a/hw/usb/dev-unifying.c b/hw/usb/dev-unifying.c
index 36ffdb3f55..c9364f089c 100644
--- a/hw/usb/dev-unifying.c
+++ b/hw/usb/dev-unifying.c
@@ -379,11 +379,7 @@ static void usb_ltunify_handle_control_hid(USBDevice *dev, USBPacket *p,
switch (request) {
case HID_GET_REPORT:
- if (hs->kind == HID_KEYBOARD) {
- p->actual_length = hid_keyboard_poll(hs, data, length);
- } else if (hs->kind == HID_MOUSE) {
- p->actual_length = hid_pointer_poll(hs, data, length);
- }
+ p->actual_length = usb_ltunify_poll_hid(hs, data, length);
break;
case HID_SET_REPORT:
if (hs->kind == HID_KEYBOARD) {
diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c
index 91277b00fe..5eea52fe81 100644
--- a/hw/usb/hid-logitech-dj.c
+++ b/hw/usb/hid-logitech-dj.c
@@ -457,16 +457,15 @@ fail:
void usb_ltunify_handle_control_hidpp(USBDevice *dev, USBPacket *p,
int request, int value, int index, int length, uint8_t *data)
{
- //USBLtunifyState *s = (USBLtunifyState *) dev;
-
switch (request) {
case HID_GET_REPORT:
- /* FIXME */
- break;
+ /* not implemented, please use the interrupt endpoint */
+ goto fail;
case HID_SET_REPORT:
hidpp_set_report(dev, p, data, length);
break;
default:
+ fail:
p->status = USB_RET_STALL;
break;
}