diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-03-24 11:54:01 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-12-12 17:44:09 +0100 |
commit | e870951b9bf626976cd8d78ee51578bac35a23fc (patch) | |
tree | abad838746ea82e0a8686ddbfa960cc9ced80a4d /hw | |
parent | de246fe060a46ee19b6adb72fa2c3708cfda0b0a (diff) | |
download | qemu-e870951b9bf626976cd8d78ee51578bac35a23fc.tar.gz |
unifying: fix report ID for HID++ 2.0 responses
The input report ID can be 0x10 or 0x11, the responses are always 0x11.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb/hid-logitech-dj.c | 8 | ||||
-rw-r--r-- | hw/usb/hid-logitech-dj.h | 8 | ||||
-rw-r--r-- | hw/usb/hid-logitech-hidpp20.c | 1 |
3 files changed, 9 insertions, 8 deletions
diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c index 51be0e2410..196b430c43 100644 --- a/hw/usb/hid-logitech-dj.c +++ b/hw/usb/hid-logitech-dj.c @@ -30,14 +30,6 @@ #define COMPILE_ASSERT(cond) typedef char _compile_assert[1 - 2 * !(cond)] -/* Report IDs */ -enum { - HIDPP_SHORT = 0x10, /* 7 bytes */ - HIDPP_LONG = 0x11, /* 20 bytes */ - DJ_SHORT = 0x20, /* 15 bytes */ - DJ_LONG = 0x21, /* 32 bytes */ -}; - /* helpers to handle the HID++ register queries */ #define SET_REG(reg) (0x108000 | (reg)) #define GET_REG(reg) (0x108100 | (reg)) diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index 83cb33b8aa..3e7fab9fa1 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -44,6 +44,14 @@ enum { #define MAX_DEVICES 6 +/* Report IDs */ +enum { + HIDPP_SHORT = 0x10, /* 7 bytes */ + HIDPP_LONG = 0x11, /* 20 bytes */ + DJ_SHORT = 0x20, /* 15 bytes */ + DJ_LONG = 0x21, /* 32 bytes */ +}; + /* report formats */ typedef struct { uint8_t report_id; diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c index 95393050a5..9248f31bd1 100644 --- a/hw/usb/hid-logitech-hidpp20.c +++ b/hw/usb/hid-logitech-hidpp20.c @@ -130,6 +130,7 @@ int hidpp20_feature_call(LHidDevice *hd, Hidpp20Msg *func) feat = &hd->info.features[func->feat_index - 1]; r = feat->callback(hd, func, fn, func->params); } + func->report_id = HIDPP_LONG; if (r > 0) { // r are the parameters that must be kept, the others are cleared. assert(r <= sizeof(func->params)); |