From 3615170bd1ed6f09f878a8b538321044efddd8e0 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 24 Mar 2014 17:16:24 +0100 Subject: unifying: fix mouse report format, DRY Introduce new function to retrieve HID data for a given HIDState (if any) and fix the incompatibility between the HID format for mice as used by QEMU and the format described by the report (it contains an extra field for buttons). Signed-off-by: Peter Wu --- hw/usb/hid-logitech-dj.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw/usb/hid-logitech-dj.h') diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index 785f0d5b56..33c6d4404a 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -275,6 +275,10 @@ typedef struct USBLtunifyState { } USBLtunifyState; +/* poll a HID device for data, returning HID data in buf if any (returns 0 + * if there is no data available) */ +int usb_ltunify_poll_hid(HIDState *hs, uint8_t *buf, size_t bufsz); + /* handle control packets for interface 3 (HID++ / DJ) */ void usb_ltunify_handle_control_hidpp(USBDevice *dev, USBPacket *p, int request, int value, int index, int length, uint8_t *data); -- cgit v1.2.1