Attachment 'usb_hid_setprotocol-13.3-RELEASE.diff'
Download 1 diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4
2 index 15f5a9718c8f..f199ad56a758 100644
3 --- a/share/man/man4/usb_quirk.4
4 +++ b/share/man/man4/usb_quirk.4
5 @@ -74,6 +74,8 @@ device should be ignored by ums class
6 does not identify properly
7 .It UQ_MS_LEADING_BYTE
8 mouse sends an unknown leading byte
9 +.It UQ_MS_NO_SETPROTO
10 +device should not receive "SetProtocol" requests
11 .It UQ_MS_REVZ
12 mouse has Z-axis reversed
13 .It UQ_MS_VENDOR_BTN
14 diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c
15 index 4eac1b546b4d..88c95ad04ef5 100644
16 --- a/sys/dev/usb/input/ukbd.c
17 +++ b/sys/dev/usb/input/ukbd.c
18 @@ -962,7 +962,8 @@ ukbd_probe(device_t dev)
19 return (ENXIO);
20
21 if (hid_is_keyboard(d_ptr, d_len)) {
22 - if (hid_is_mouse(d_ptr, d_len)) {
23 + if (hid_is_mouse(d_ptr, d_len) &&
24 + !usb_test_quirk(uaa, UQ_UMS_IGNORE)) {
25 /*
26 * NOTE: We currently don't support USB mouse
27 * and USB keyboard on the same USB endpoint.
28 diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c
29 index d8dc2e8f19c3..1dbf4446b14f 100644
30 --- a/sys/dev/usb/input/ums.c
31 +++ b/sys/dev/usb/input/ums.c
32 @@ -590,13 +590,15 @@ ums_attach(device_t dev)
33 usb_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0);
34
35 /*
36 - * Force the report (non-boot) protocol.
37 + * Force the report (non-boot) protocol unless
38 + * UQ_MS_NO_SETPROTO is set.
39 *
40 * Mice without boot protocol support may choose not to implement
41 * Set_Protocol at all; Ignore any error.
42 */
43 - err = usbd_req_set_protocol(uaa->device, NULL,
44 - uaa->info.bIfaceIndex, 1);
45 + if (!usb_test_quirk(uaa, UQ_MS_NO_SETPROTO))
46 + err = usbd_req_set_protocol(uaa->device, NULL,
47 + uaa->info.bIfaceIndex, 1);
48
49 err = usbd_transfer_setup(uaa->device,
50 &uaa->info.bIfaceIndex, sc->sc_xfer, ums_config,
51 diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c
52 index 91d47935221f..d3075466dbb3 100644
53 --- a/sys/dev/usb/quirk/usb_quirk.c
54 +++ b/sys/dev/usb/quirk/usb_quirk.c
55 @@ -654,6 +654,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = {
56 [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE",
57 [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS",
58 [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE",
59 + [UQ_MS_NO_SETPROTO] = "UQ_MS_NO_SETPROTO",
60 [UQ_MS_REVZ] = "UQ_MS_REVZ",
61 [UQ_MS_VENDOR_BTN] = "UQ_MS_VENDOR_BTN",
62 [UQ_NO_STRINGS] = "UQ_NO_STRINGS",
63 diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h
64 index 8e8bfd152eb8..e5dd0c950785 100644
65 --- a/sys/dev/usb/quirk/usb_quirk.h
66 +++ b/sys/dev/usb/quirk/usb_quirk.h
67 @@ -53,6 +53,7 @@ enum {
68 UQ_UMS_IGNORE, /* device should be ignored by ums class */
69 UQ_MS_BAD_CLASS, /* doesn't identify properly */
70 UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */
71 + UQ_MS_NO_SETPROTO, /* device should not receive SetProtocol requests */
72 UQ_MS_REVZ, /* mouse has Z-axis reversed */
73 UQ_MS_VENDOR_BTN, /* mouse has buttons in vendor usage page */
74 UQ_NO_STRINGS, /* string descriptors are broken */
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.