diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-03-24 14:15:46 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-03-24 14:15:46 +0100 |
commit | dd6315d9bdf86a7c1feb3f47b0840d33f4d99cd5 (patch) | |
tree | 5b47f29f5c179fe4f8f04ba98c342c801a021287 | |
parent | 0f78eb6ce67962a4147dce37cc4f8538d44b36d7 (diff) | |
download | qemu-dd6315d9bdf86a7c1feb3f47b0840d33f4d99cd5.tar.gz |
unifying: add WirelessDeviceStatus and unknown features
Features 1DF3, 1DF0 and 1F03 are not documented, its functionality is
unknown. WirelessDeviceStatus has no functions, it only exists for
broadcast events.
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | hw/usb/hid-logitech-hidpp20.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/hw/usb/hid-logitech-hidpp20.c b/hw/usb/hid-logitech-hidpp20.c index 026dd587be..4bebe0af44 100644 --- a/hw/usb/hid-logitech-hidpp20.c +++ b/hw/usb/hid-logitech-hidpp20.c @@ -232,12 +232,22 @@ static HIDPP20_FEATURE(feat_batterystatus) } } +static HIDPP20_FEATURE(feat_unknown) +{ + /* Undocumented feature */ + return -HIDPP20_ERR_CODE_UNSUPPORTED; +} + /* root feature not included! */ static const HidppFeature features_m525[] = { { 0x0001, 0, feat_featureset }, { 0x0003, 0, feat_devicefwversion }, { 0x0005, 0, feat_devicename }, { 0x1000, 0, feat_batterystatus }, + { 0x1D4B, 0, NULL }, /* WirelessDeviceStatus events */ + { 0x1DF3, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, + { 0x1DF0, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, + { 0x1F03, HIDPP20_FEAT_TYPE_HIDDEN, feat_unknown }, }; void hidpp20_init_features(LHidDevice *hd) { @@ -265,7 +275,12 @@ int hidpp20_feature_call(LHidDevice *hd, Hidpp20Msg *func) r = feat_iroot(hd, func, fn, func->params); } else { /* other features */ feat = &hd->info.features[func->feat_index - 1]; - r = feat->callback(hd, func, fn, func->params); + if (feat->callback) { + r = feat->callback(hd, func, fn, func->params); + } else { + /* No callback, either unimplemented or feature has events only */ + r = -HIDPP20_ERR_CODE_INVALID_FUNCTION_ID; + } } func->report_id = HIDPP_LONG; if (r > 0) { |