From nobody Sat Dec 24 09:02:17 2022 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 4NfJ2y0T9Wz1HWyS; Sat, 24 Dec 2022 09:02:18 +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 4NfJ2x71dPz3m1Q; Sat, 24 Dec 2022 09:02:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671872538; 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=VLdCkqRfEUQnLEYE8A1uUBOmlVLqaz5D2xk/4AQhzGw=; b=CzwpwHRU5rntygTfuLTbwZ1XowOtMDNVG/zTe/FgrnMrtqcObBErlePyWW54wnMvAmNiol i8pp3WG7UOqp4XX43ywJ540H3/v7c8+dmHDcuArMtYuQtvvsts1aCkgjM1FR+yGgjVjHkN DB6woSg5ivihxJrODV5TA4m7mzpUIupFFbf99Uzr9em1flGf8Q/QT0D1kB50JB+i93IpvG MzkYa6EzHjxKVh0YF8B16yi7BNzkLzzcYZALhU+LSVY+9HfalO6OQmoFXxgDSl01MKt/nF UOlgyYX9EopEDdFT2lCMoRXGSlguLcMvB3QJJxmKBna6DlOkZus1Bx0U3c5Ykg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671872538; 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=VLdCkqRfEUQnLEYE8A1uUBOmlVLqaz5D2xk/4AQhzGw=; b=toVsDmvftsiz4XGq1lk7JR1dTH6sPqHgCtu0y8p47yfbaspSqcvcUq7TIekNgFCSg/pgaS SNBh1LZg+IBj8SVoarCXhqr9+e7/FRzrjiEZlfoDgUc57fc9EnVtyAD4Y8p8thGOiTnR6I 0yPPVqlhiUWTMu1DKFK3UmVTYdLEa822ioHj4G+4XANR/k6O7EFw8MTUggolwn56KEbcsz FKF6cqWeCZ9N4/BAgKYcanSwbznLCi2dgz3xvYt6S1PJbPRAhKxJKYJAOYTa5GP4UMy9Zi fQKr66o5u/2JOljlWjbrzJdJJcJuVzsqmLga3JkDBVcW27lgfn9WJhhf9E1Ghw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671872538; a=rsa-sha256; cv=none; b=UP/yzLMvi7LC4gAeQxfEKl0PZUKCBNZxzmNFzIPqxCHxnzcyW/jcp+OtVXWiI0M4+CHEif FhF0wtSelKq5aa9qFH+V2RMxzezG00KpXfLdjSPMjQ74CUmwffCInBSFxovtTt+78PP1T+ mD84Ecltzo2pd3BRaA6UKzv+0iuMX62Nru04zY5N2ypWGkrIayunM0GO7miqVK4T6omqu8 BTiT95B1o/jf7oQD73DhUEboHrRXfJ42gR6ws9qex2RtS4odVFuHyWfUnIn5F2uVt/ZndR O3mBeYTp8ctWrqjiFDbNeLklaYxx20PPejtJl2K4Ohteq2bFNLorcsEn32PBjg== 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 4NfJ2x5zHSz17CS; Sat, 24 Dec 2022 09:02:17 +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 2BO92H7q026015; Sat, 24 Dec 2022 09:02:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BO92HWL026014; Sat, 24 Dec 2022 09:02:17 GMT (envelope-from git) Date: Sat, 24 Dec 2022 09:02:17 GMT Message-Id: <202212240902.2BO92HWL026014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 0661cf74e6e5 - main - hms(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/main X-Git-Reftype: branch X-Git-Commit: 0661cf74e6e5dbd585c4a5a3e621d915bb6787d3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0661cf74e6e5dbd585c4a5a3e621d915bb6787d3 commit 0661cf74e6e5dbd585c4a5a3e621d915bb6787d3 Author: Vladimir Kondratyev AuthorDate: 2022-12-24 09:01:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-12-24 09:01:20 +0000 hms(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. Reported by: Atte Peltomäki PR: 267922 MFC after: 2 weeks --- share/man/man4/hidquirk.4 | 2 ++ sys/dev/hid/hidquirk.c | 2 ++ sys/dev/hid/hidquirk.h | 1 + sys/dev/hid/hms.c | 12 ++++++++---- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/share/man/man4/hidquirk.4 b/share/man/man4/hidquirk.4 index aa78e189765c..cbe0e33c934c 100644 --- a/share/man/man4/hidquirk.4 +++ b/share/man/man4/hidquirk.4 @@ -53,6 +53,8 @@ doesn't identify properly mouse sends an unknown leading byte .It HQ_MS_REVZ mouse has Z-axis reversed +.It HQ_MS_VENDOR_BTN +mouse has buttons in vendor usage page .It HQ_SPUR_BUT_UP spurious mouse button up events .It HQ_MT_TIMESTAMP diff --git a/sys/dev/hid/hidquirk.c b/sys/dev/hid/hidquirk.c index 7c28e240582b..dfb97a3e5597 100644 --- a/sys/dev/hid/hidquirk.c +++ b/sys/dev/hid/hidquirk.c @@ -151,6 +151,8 @@ static struct hidquirk_entry hidquirks[HID_DEV_QUIRKS_MAX] = { USB_QUIRK(CORSAIR, STRAFE2, 0x0000, 0xffff, HQ_KBD_BOOTPROTO), /* Holtek USB gaming keyboard */ USB_QUIRK(HOLTEK, F85, 0x0000, 0xffff, HQ_KBD_BOOTPROTO), + /* Quirk for Kensington Slimblade Trackball */ + USB_QUIRK(KENSINGTON, SLIMBLADE, 0x0000, 0xffff, HQ_MS_VENDOR_BTN), }; #undef HID_QUIRK_VP #undef USB_QUIRK diff --git a/sys/dev/hid/hidquirk.h b/sys/dev/hid/hidquirk.h index 0201f2f0746c..5f0dafb8a8a2 100644 --- a/sys/dev/hid/hidquirk.h +++ b/sys/dev/hid/hidquirk.h @@ -59,6 +59,7 @@ HQ(MS_BAD_CLASS), /* doesn't identify properly */ \ HQ(MS_LEADING_BYTE), /* mouse sends an unknown leading byte */ \ HQ(MS_REVZ), /* mouse has Z-axis reversed */ \ + HQ(MS_VENDOR_BTN), /* mouse has buttons in vendor usage page */ \ HQ(SPUR_BUT_UP), /* spurious mouse button up events */ \ HQ(MT_TIMESTAMP) /* Multitouch device exports HW timestamps */ diff --git a/sys/dev/hid/hms.c b/sys/dev/hid/hms.c index b1580c3db358..87d207cc3f6b 100644 --- a/sys/dev/hid/hms.c +++ b/sys/dev/hid/hms.c @@ -61,8 +61,6 @@ enum { HMS_ABS_Z, HMS_HWHEEL, HMS_BTN, - HMS_BTN_MS1, - HMS_BTN_MS2, HMS_FINAL_CB, }; @@ -95,8 +93,6 @@ static const struct hidmap_item hms_map[] = { [HMS_ABS_Z] = HMS_MAP_ABS(HUG_Z, ABS_Z), [HMS_HWHEEL] = HMS_MAP_REL_CN(HUC_AC_PAN, REL_HWHEEL), [HMS_BTN] = HMS_MAP_BUT_RG(1, 16, BTN_MOUSE), - [HMS_BTN_MS1] = HMS_MAP_BUT_MS(1, BTN_RIGHT), - [HMS_BTN_MS2] = HMS_MAP_BUT_MS(2, BTN_MIDDLE), [HMS_FINAL_CB] = HMS_FINAL_CB(hms_final_cb), }; @@ -107,6 +103,11 @@ static const struct hidmap_item hms_map_wheel_rev[] = { HMS_MAP_REL_REV(HUG_WHEEL, REL_WHEEL), }; +static const struct hidmap_item hms_map_kensington_slimblade[] = { + HMS_MAP_BUT_MS(1, BTN_RIGHT), + HMS_MAP_BUT_MS(2, BTN_MIDDLE), +}; + /* A match on these entries will load hms */ static const struct hid_device_id hms_devs[] = { { HID_TLC(HUP_GENERIC_DESKTOP, HUG_POINTER) }, @@ -261,6 +262,9 @@ hms_attach(device_t dev) else HIDMAP_ADD_MAP(&sc->hm, hms_map_wheel, cap_wheel); + if (hid_test_quirk(hw, HQ_MS_VENDOR_BTN)) + HIDMAP_ADD_MAP(&sc->hm, hms_map_kensington_slimblade, NULL); + #ifdef IICHID_SAMPLING if (hid_test_quirk(hw, HQ_IICHID_SAMPLING) && hidmap_test_cap(sc->caps, HMS_REL_X) &&