From nobody Sat Jan 07 19:16:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nq91l2T4lz2sMKP; Sat, 7 Jan 2023 19:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nq91l1k5yz3jcY; Sat, 7 Jan 2023 19:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673119019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59Xu1mB8I0qVEpWUzMgSgK6GOH3N6ukSRiHVkTgOztw=; b=YbEOsBSHWsNONmzXFbDx8OKNxovowbEYMjWlxe34BijWoxA/GTQIAUtIZkR8xiTFb8f0Iv ysf6iYa5OyAfU6lb1s6UwMC2d04vl4lZJVFXy3GvSazlm79PkjQ4TRfnsww7y2EUzvTNUs Gb+AhbDDhDtMnXg/YBoixk1Xo3OHxDlPIzvU/XmHv2XX7CjMvBe6ZzNtZBx2Mb6iQ3sCGx kYBgcCGgCfhCgQDEpOL9E/kIoThoEtrNiTialwEIS03GSATo0tzgX3bjPco2JSiWNmehjS SpFEtwRS1S7b2UrzXvq40HDW2aD8k1d25vxRYvamrb0Xo2GjWND/tW1u9V4WKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673119019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59Xu1mB8I0qVEpWUzMgSgK6GOH3N6ukSRiHVkTgOztw=; b=XxhEx17YoF/3GBwBRvvo585fSK7CUyIG/E/3di5lo37PG3RcIwn0FHDOIzxzdvIDtLyMur I2BxcUxIZHoStgN+9AOd4JjjWen8kue+ufi49JcP+B11Dm98FDTnuJSBGp97RalQ7spE5H n9K5r+IrfxWK4RSOuVb70jJiB105XJGFm+7w2Z2nQGFwExcWWEUmk//UouRPw2EhcqgCfK YdJHXdHYPvqX9e5OK/KCDnsXjjiGcdSu4GZECLVM611z0RxTgqrvOinjTDsBrxgxoSB9WM 73+f+VU/N+up812pZlKsBWgIBjDJW4++PY7Alq9Vp4fbjGjis7k9x4ozpu9fIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673119019; a=rsa-sha256; cv=none; b=uJf2rJyvCGDFqJr98K3YDj2a1dmyddVXKTJzt9GEcYN1Zwq2FNsgyUOV18A7+UaBN18/oO Dr1h/2vf8JveMzPJXuF8LtPY8i/+BT3Wx58p3m/omoqEkuWrApJxDhzuPE0QCgQlxbj5G/ p/xmYx2Ry52LxkqBmWVLW6Z4c9lG4cxul3wxsnF8Dulemku6OhKe4Whxczhgj8Wuq1FTlf hkKPlzhuE2wptRvZ2uGpyFZTwgjFu3yclonytzBO2oyJCbHJ6+NIYoR1vgd2X2vaTw4od9 Zgo2YlEmG8s1ttQbhlghp+Ua0t3tj8tP5YGtyaDPt8ocDbfbg6UfUjz1SxWNzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nq91l0qd4zL9h; Sat, 7 Jan 2023 19:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 307JGxJ1070229; Sat, 7 Jan 2023 19:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 307JGxhl070228; Sat, 7 Jan 2023 19:16:59 GMT (envelope-from git) Date: Sat, 7 Jan 2023 19:16:59 GMT Message-Id: <202301071916.307JGxhl070228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 2ccd40025cca - stable/13 - ums(4): Disable vendor usage page button support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2ccd40025cca6dd3f023a7a8f39451b9dbe53127 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=2ccd40025cca6dd3f023a7a8f39451b9dbe53127 commit 2ccd40025cca6dd3f023a7a8f39451b9dbe53127 Author: Vladimir Kondratyev AuthorDate: 2022-12-24 09:01:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-01-07 19:15:28 +0000 ums(4): Disable vendor usage page button support for all devices except Kensington Slimblade Trackball as it brokes some other devices like Contour Rollermouse Red Add a quirk for it as well. (cherry picked from commit ab4f740bc59e3ba2948bcc4e03bd6125b1dae36f) --- share/man/man4/usb_quirk.4 | 2 ++ sys/dev/usb/input/ums.c | 18 ++++++++++++------ sys/dev/usb/quirk/usb_quirk.c | 3 +++ sys/dev/usb/quirk/usb_quirk.h | 1 + sys/dev/usb/usbdevs | 1 + 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/share/man/man4/usb_quirk.4 b/share/man/man4/usb_quirk.4 index 8751807f9dec..c176993bdbc3 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 ced905609437..5ddba1311762 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 82aa3a5baf7d..f0133e3e4b9b 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), @@ -647,6 +649,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 9b3d0c81ce03..85bec036f84d 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 */ diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 91332a1e470c..6a6ac5cb8434 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2706,6 +2706,7 @@ product KEISOKUGIKEN USBDAQ 0x0068 HKS-0200 USBDAQ /* Kensington products */ product KENSINGTON ORBIT 0x1003 Orbit USB/PS2 trackball product KENSINGTON TURBOBALL 0x1005 TurboBall +product KENSINGTON SLIMBLADE 0x2041 Slimblade Trackball /* Synaptics products */ product SYNAPTICS FPR9A 0x009a Fingerprint Reader