aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/input
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2022-12-24 09:01:20 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2022-12-24 09:01:20 +0000
commitab4f740bc59e3ba2948bcc4e03bd6125b1dae36f (patch)
treeab8aecf0135cad2b633ee7061b900f147ce38130 /sys/dev/usb/input
parent860399eb86cc431412bfbce0ab76c6652e5b6c07 (diff)
Diffstat (limited to 'sys/dev/usb/input')
-rw-r--r--sys/dev/usb/input/ums.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c
index 987c4b9d1309..2280cdc29e8d 100644
--- a/sys/dev/usb/input/ums.c
+++ b/sys/dev/usb/input/ums.c
@@ -122,6 +122,7 @@ struct ums_info {
#define UMS_FLAG_SBU 0x0010 /* spurious button up events */
#define UMS_FLAG_REVZ 0x0020 /* Z-axis is reversed */
#define UMS_FLAG_W_AXIS 0x0040
+#define UMS_FLAG_VBTN 0x0080 /* Buttons in vendor usage page */
uint8_t sc_iid_w;
uint8_t sc_iid_x;
@@ -538,12 +539,13 @@ ums_hid_parse(struct ums_softc *sc, device_t dev, const uint8_t *buf,
}
/* detect other buttons */
-
- for (j = 0; (i < UMS_BUTTON_MAX) && (j < 2); i++, j++) {
- if (!hid_locate(buf, len, HID_USAGE2(HUP_MICROSOFT, (j + 1)),
- hid_input, index, &info->sc_loc_btn[i], NULL,
- &info->sc_iid_btn[i])) {
- break;
+ if (info->sc_flags & UMS_FLAG_VBTN) {
+ for (j = 0; (i < UMS_BUTTON_MAX) && (j < 2); i++, j++) {
+ if (!hid_locate(buf, len, HID_USAGE2(HUP_MICROSOFT,
+ (j + 1)), hid_input, index, &info->sc_loc_btn[i],
+ NULL, &info->sc_iid_btn[i])) {
+ break;
+ }
}
}
@@ -618,6 +620,10 @@ ums_attach(device_t dev)
isize = hid_report_size_max(d_ptr, d_len, hid_input, &sc->sc_iid);
+ if (usb_test_quirk(uaa, UQ_MS_VENDOR_BTN))
+ for (i = 0; i < UMS_INFO_MAX; i++)
+ sc->sc_info[i].sc_flags |= UMS_FLAG_VBTN;
+
/*
* The Microsoft Wireless Notebook Optical Mouse seems to be in worse
* shape than the Wireless Intellimouse 2.0, as its X, Y, wheel, and