diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-03-19 15:18:50 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-03-19 15:18:50 +0100 |
commit | 198529586fff48da10e4c5d56c9a44db2b6a0a1d (patch) | |
tree | 573ee7ae04f3f96b0a24e666396ffef75eb0839a /hw/usb/hid-logitech-dj.h | |
parent | 4e6cc45456993307d605dfe50b5e370ba93fac9d (diff) | |
download | qemu-198529586fff48da10e4c5d56c9a44db2b6a0a1d.tar.gz |
unifying: move mode to LHIdDevice, init/reset functionality
WIP (partially untested).
Handle input reports, respond with HID events if there are no queued
output reports. Implemented input report processing for receiver:
0x80 (Switch and Keep-Alive), 0x81 (Get Paired Devices).
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw/usb/hid-logitech-dj.h')
-rw-r--r-- | hw/usb/hid-logitech-dj.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index bc4a044382..bcfe17cc7e 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -137,7 +137,7 @@ typedef struct { } LHidReceiver; typedef struct { - const struct { + struct { enum { DEVTYPE_KEYBOARD = 1, DEVTYPE_MOUSE, @@ -157,10 +157,17 @@ typedef struct { uint32_t serial; const char name[15]; uint8_t usability_info; /* bits 0..3 power switch location */ + uint32_t report_types; /* supported report types (e.g. mouse) */ /* TODO: feature set */ /* TODO: special mouse and key button mappings */ } info; /* static information */ + HIDState *hid; + + enum { + LTUNIFY_MODE_HID = 1, + LTUNIFY_MODE_DJ = 2 + } mode; bool powered_on; uint8_t report_interval; #define REPORTING_FLAG_BATTERY_STATUS (1 << 4) @@ -185,10 +192,6 @@ typedef struct USBLtunifyState { USBDevice dev; USBEndpoint *intr[3]; /* interfaces (keyboard, mouse, DJ) */ UsbDumpState *usb_dump_state; - enum { - LTUNIFY_MODE_HID = 1, - LTUNIFY_MODE_DJ = 2 - } mode; HIDState hid[2]; /* HID devices (keyboard, mouse) */ /* queue for HID++ requests and responses */ @@ -219,4 +222,7 @@ void usb_ltunify_handle_control_hidpp(USBDevice *dev, USBPacket *p, /* handle control packets for interface 3 (HID++ / DJ) */ void usb_ltunify_handle_datain_hidpp(USBDevice *dev, USBPacket *p); + +void hidpp_reset(USBLtunifyState *s); +void hidpp_init(USBLtunifyState *s); #endif |