diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb/dev-unifying.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/usb/dev-unifying.c b/hw/usb/dev-unifying.c index c525ddb29c..8c3e7335fd 100644 --- a/hw/usb/dev-unifying.c +++ b/hw/usb/dev-unifying.c @@ -401,16 +401,20 @@ static void usb_ltunify_handle_control_hid(USBDevice *dev, USBPacket *p, switch (request) { case HID_GET_REPORT: - // report_type = (uint8_t) (value >> 8); - // report_id = (uint8_t) value; - // length - // data + 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); + } break; case HID_SET_REPORT: - // report_type = (uint8_t) (value >> 8); - // report_id = (uint8_t) value; - // length - // data + if (hs->kind == HID_KEYBOARD) { + /* for toggling LEDs */ + p->actual_length = hid_keyboard_write(hs, data, length); + } else { + /* not applicable for mice */ + goto fail; + } break; case HID_GET_IDLE: /* Idle rates for specific Report IDs should be implemented by checking @@ -435,6 +439,7 @@ static void usb_ltunify_handle_control_hid(USBDevice *dev, USBPacket *p, hs->protocol = data[0]; break; default: + fail: p->status = USB_RET_STALL; break; } |