From dd6315d9bdf86a7c1feb3f47b0840d33f4d99cd5 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 24 Mar 2014 14:15:46 +0100 Subject: 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 --- hw/usb/hid-logitech-hidpp20.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'hw') 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) { -- cgit v1.2.1