diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-03-23 17:00:54 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-03-23 17:00:54 +0100 |
commit | 7c530e39d3f61761f4f5b97b4f61c83773151413 (patch) | |
tree | 5774564715981c24f2a594ea1310044777ac8eb0 /hw/usb/hid-logitech-dj.c | |
parent | 7692e3db0ac2d2790b85c494da31fec7f4c59ab6 (diff) | |
download | qemu-7c530e39d3f61761f4f5b97b4f61c83773151413.tar.gz |
unifying: interface with HID++ 2.0 features
Prepare for adding more HID++ 2.0 features.
Diffstat (limited to 'hw/usb/hid-logitech-dj.c')
-rw-r--r-- | hw/usb/hid-logitech-dj.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c index caa0383bc9..6de5fa4ba1 100644 --- a/hw/usb/hid-logitech-dj.c +++ b/hw/usb/hid-logitech-dj.c @@ -400,6 +400,7 @@ static void hidpp_process_device_hidpp20(USBLtunifyState *s, HidppMsg *msg) LHidDevice *hd = &s->devices[msg->device_index - 1]; Hidpp20Msg *func = (Hidpp20Msg *) msg; uint8_t fn = func->func >> 4; + int r; if (func->feat_index == 0) { /* IRoot */ if (fn == 1) { /* GetProtocolVersion */ @@ -411,7 +412,14 @@ static void hidpp_process_device_hidpp20(USBLtunifyState *s, HidppMsg *msg) } return; } - /* TODO: implement features and more functions */ + + r = hidpp20_feature_call(hd, func); + /* note: if r == 0, then the function is void and there is no output */ + if (r > 0) { + hidpp_queue_output_report(s, msg); + } else if (r < 0) { + hidpp20_queue_error(s, func, -r); + } } @@ -622,6 +630,7 @@ static void hidpp_init_device(USBLtunifyState *s, int device_index, int devtype) hd->report_interval = 8; break; } + hidpp20_init_features(hd); hd->info.protocol_version = 0x0200; /* HID++ 2.0 */ hd->mode = LTUNIFY_MODE_HID; hd->powered_on = true; |