summaryrefslogtreecommitdiff
path: root/hw/usb/dev-unifying.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-03-18 21:21:51 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-03-18 21:21:51 +0100
commit3a5922cc11f73269bfcd762997efc2c029a3b585 (patch)
tree04f129f72b655e1976b0a9456a17b4f93fe9fe7c /hw/usb/dev-unifying.c
parent0bb8d924cbcd02069eb64893a2c2d48a20631866 (diff)
downloadqemu-3a5922cc11f73269bfcd762997efc2c029a3b585.tar.gz
unifying: WIP for HID++ support
Error queue is implemented, possible receiver and device properties are filled in (in the header). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb/dev-unifying.c')
-rw-r--r--hw/usb/dev-unifying.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/hw/usb/dev-unifying.c b/hw/usb/dev-unifying.c
index 25f1fe920e..e60a472ba7 100644
--- a/hw/usb/dev-unifying.c
+++ b/hw/usb/dev-unifying.c
@@ -36,15 +36,6 @@
#include "hw/input/hid.h"
#include "hw/usb/hid-logitech-dj.h"
-/* HID requests ((bmRequestType << 8) | bRequest) */
-#define HID_GET_REPORT 0xa101
-#define HID_GET_IDLE 0xa102
-#define HID_GET_PROTOCOL 0xa103
-/* 0x04-0x08 Reserved */
-#define HID_SET_REPORT 0x2109
-#define HID_SET_IDLE 0x210a
-#define HID_SET_PROTOCOL 0x210b
-
/* descriptors are retrieved with usbhid-dump (need to unbind interfaces from
* usbhid) and prettified with hidrd 0.2 */
@@ -479,6 +470,9 @@ static void usb_ltunify_handle_control(USBDevice *dev, USBPacket *p,
if (index == IFACE_KBD || index == IFACE_KBD) {
/* HID interface for mouse and keyboard */
usb_ltunify_handle_control_hid(dev, p, request, value, index, length, data);
+ } else if (index == IFACE_HIDPP) {
+ /* Logitech Proprietary HID++ interface */
+ usb_ltunify_handle_control_hidpp(dev, p, request, value, index, length, data);
} else {
p->status = USB_RET_STALL;
}
@@ -529,7 +523,8 @@ static void usb_ltunify_handle_data(USBDevice *dev, USBPacket *p)
usb_ltunify_handle_datain_hid(dev, p);
return;
} else if (p->ep->nr == 3) {
- /* TODO: handle DJ mode */
+ usb_ltunify_handle_datain_hidpp(dev, p);
+ return;
} else {
abort();
}
@@ -567,7 +562,7 @@ static int usb_ltunify_initfn(USBDevice *dev)
/* retrieve interrupt endpoints for each interface */
s->intr[IFACE_KBD] = usb_ep_get(dev, USB_TOKEN_IN, 1);
s->intr[IFACE_MSE] = usb_ep_get(dev, USB_TOKEN_IN, 2);
- s->intr[IFACE_DJ] = usb_ep_get(dev, USB_TOKEN_IN, 3);
+ s->intr[IFACE_HIDPP] = usb_ep_get(dev, USB_TOKEN_IN, 3);
/* the receiver supports multiple HID devices. Let's load some even if not
* all of them are paired. */