summaryrefslogtreecommitdiff
path: root/hw/usb/hid-logitech-hidpp20.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/hid-logitech-hidpp20.c')
-rw-r--r--hw/usb/hid-logitech-hidpp20.c17
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) {