From 3a5922cc11f73269bfcd762997efc2c029a3b585 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 18 Mar 2014 21:21:51 +0100 Subject: 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 --- hw/usb/dev-unifying.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'hw/usb/dev-unifying.c') 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. */ -- cgit v1.2.1