FreeBSD Bugzilla – Attachment 238469 Details for
Bug 267922
Contour Rollermouse Red not supported by ums(4)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
ums_conditionalize_kensington_support.patch
ums_kensington.patch (text/plain), 3.54 KB, created by
Vladimir Kondratyev
on 2022-12-01 09:54:22 UTC
(
hide
)
Description:
ums_conditionalize_kensington_support.patch
Filename:
MIME Type:
Creator:
Vladimir Kondratyev
Created:
2022-12-01 09:54:22 UTC
Size:
3.54 KB
patch
obsolete
>diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4 >index 8751807f9de..c176993bdbc 100644 >--- a/share/man/man4/usb_quirk.4 >+++ b/share/man/man4/usb_quirk.4 >@@ -78,6 +78,8 @@ does not identify properly > mouse sends an unknown leading byte > .It UQ_MS_REVZ > mouse has Z-axis reversed >+.It UQ_MS_VENDOR_BTN >+mouse has buttons in vendor usage page > .It UQ_NO_STRINGS > string descriptors are broken > .It UQ_POWER_CLAIM >diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c >index 987c4b9d130..2280cdc29e8 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 >diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c >index 856cd3c006f..68e4910202b 100644 >--- a/sys/dev/usb/quirk/usb_quirk.c >+++ b/sys/dev/usb/quirk/usb_quirk.c >@@ -175,6 +175,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { > /* Quirk for Corsair STRAFE Gaming keyboard */ > USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), > USB_QUIRK(CORSAIR, STRAFE2, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), >+ /* Quirk for Kensington Slimblade Trackball */ >+ USB_QUIRK(KENSINGTON, SLIMBLADE, 0x0000, 0xffff, UQ_MS_VENDOR_BTN), > /* umodem(4) device quirks */ > USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), > USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), >@@ -649,6 +651,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = { > [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", > [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", > [UQ_MS_REVZ] = "UQ_MS_REVZ", >+ [UQ_MS_VENDOR_BTN] = "UQ_MS_VENDOR_BTN", > [UQ_NO_STRINGS] = "UQ_NO_STRINGS", > [UQ_POWER_CLAIM] = "UQ_POWER_CLAIM", > [UQ_SPUR_BUT_UP] = "UQ_SPUR_BUT_UP", >diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h >index 9b3d0c81ce0..85bec036f84 100644 >--- a/sys/dev/usb/quirk/usb_quirk.h >+++ b/sys/dev/usb/quirk/usb_quirk.h >@@ -55,6 +55,7 @@ enum { > UQ_MS_BAD_CLASS, /* doesn't identify properly */ > UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ > UQ_MS_REVZ, /* mouse has Z-axis reversed */ >+ UQ_MS_VENDOR_BTN, /* mouse has buttons in vendor usage page */ > UQ_NO_STRINGS, /* string descriptors are broken */ > UQ_POWER_CLAIM, /* hub lies about power status */ > UQ_SPUR_BUT_UP, /* spurious mouse button up events */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 267922
:
238462
|
238464
| 238469