From nobody Sat Dec 24 08:37:02 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 4NfHTp42x7z1HSWs; Sat, 24 Dec 2022 08:37:02 +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 4NfHTp3FDYz3P3P; Sat, 24 Dec 2022 08:37:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671871022; 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=18QO4PsImWxaW4grt4b3zFdJxJn8orsYqiPxiKHjWDQ=; b=wID4Kf8HxNoK1BCEqgeZzXxkBBgaIm3Kg4wxBf1g65oCj1gR9mUX4j8hJyYbr7WfM/RhJp eVdVoCiOI6ZGr0EYAnqIHyem/BjqVdMisofVe3bYuYQa8EBjNkSaNhtV1HtdIO0E5mlxGZ ky6H47CjgFHCMFyoXBk+UFw14kagOyhN2K1ieuU6VUd/tcwAda9p+8nwKDvi7qtGxubu/O SSQRkY9Ee+vKmdgyTUlCxPNtxdYmce5KborvIr8dsaZYz30VgYbPr7boeZ5CQQ6XfQA6H9 jfyHPkS6XNIuMSRYln08cImx1M6u2nlSx2CCGBOzypuZpfaxq6l1z6wit11qMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671871022; 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=18QO4PsImWxaW4grt4b3zFdJxJn8orsYqiPxiKHjWDQ=; b=XWQvjWGPBjFZD522hovOENatafxgdpVT2ZkpNvPNChvbM/EcgL+XnyGRcrBkhGcgotgLEw sAwFcFfvh+Ete4KdFhk62x3BzPZcgeEroScoB6nwnvdEELD7ameLA0O31Nkq5x79cOgAND ubitDGy2JzaLJSIV+WVY8wqXabprAn6eENILFCKe26hUdXTBUjcgRaJvBO+xQ6w2DLsUaq 1BJAa03cG92I5YkSLtks3745VYiu6BPm1nv632q5rOPiPRMWz6Gs0zZg5iMQs7s8B8C0Tb gd00usbf57Vn7i8VF7FUjfK7YP/0PdVLJK23tqqrlUN+rQjYleBjBVBhyAMD5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671871022; a=rsa-sha256; cv=none; b=ItfRHUd+8ZYPuiTgsRawAHXchrJmi/GdDtSeF3IK55sr491XPH9ZPRpBsbOtSc5KbvkZ13 y1bvQfwEySfc1GO1idKMeYtaRJw6v7vchVyeFKVWE4givKG5Tb3NIBcfFUDvWP8jy8DJlR E83hWOZR4iGWpcAuzMu47iw1FAQ4dwkBjNcHoynaGqbHGeysoK+lAaSyurZc1+i2+svdGH 0XDYhzp7bWb24Rg68pu7a+MG/NOOBabHrzv/0p8l//PSKJBHZaS0VpABMlGtYecWw+G1gV ABGga4yr3q5KuqmpCLVkWeq/zeI8O/b697rhM6vRqIumTvCsPDeAeal72Oadrg== 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 4NfHTp2Kj9z166k; Sat, 24 Dec 2022 08:37:02 +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 2BO8b2mt083479; Sat, 24 Dec 2022 08:37:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BO8b2kq083478; Sat, 24 Dec 2022 08:37:02 GMT (envelope-from git) Date: Sat, 24 Dec 2022 08:37:02 GMT Message-Id: <202212240837.2BO8b2kq083478@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: 32854484accc - stable/13 - hid: Add hid_ioctl method to HID interface 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: 32854484accc6d93439b1ca4c7eee68d9375c318 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=32854484accc6d93439b1ca4c7eee68d9375c318 commit 32854484accc6d93439b1ca4c7eee68d9375c318 Author: Vladimir Kondratyev AuthorDate: 2022-03-02 23:35:23 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-12-24 08:33:26 +0000 hid: Add hid_ioctl method to HID interface hid_ioctl method executes arbitrary transport backend command. Format of the command is defined by hardware transport driver. It is intended to assist HID device drivers to execute non-HID commands on hybrid devices like Elan and Apple touchpads which can be switched between HID and proprietary modes. (cherry picked from commit 5f47c5a3a35de67546ce74cb01d45e62d414a179) --- sys/dev/hid/hid.c | 6 ++++++ sys/dev/hid/hid.h | 1 + sys/dev/hid/hid_if.m | 10 ++++++++++ sys/dev/hid/hidbus.c | 1 + 4 files changed, 18 insertions(+) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index f201182ac20f..bd5fc79ff0d9 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -1077,4 +1077,10 @@ hid_set_protocol(device_t dev, uint16_t protocol) return (HID_SET_PROTOCOL(device_get_parent(dev), protocol)); } +int +hid_ioctl(device_t dev, unsigned long cmd, uintptr_t data) +{ + return (HID_IOCTL(device_get_parent(dev), cmd, data)); +} + MODULE_VERSION(hid, 1); diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index f0311bae689c..df822fcddffb 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -344,5 +344,6 @@ int hid_get_report(device_t, void *, hid_size_t, hid_size_t *, uint8_t, int hid_set_report(device_t, const void *, hid_size_t, uint8_t, uint8_t); int hid_set_idle(device_t, uint16_t, uint8_t); int hid_set_protocol(device_t, uint16_t); +int hid_ioctl(device_t, unsigned long, uintptr_t); #endif /* _KERNEL || _STANDALONE */ #endif /* _HID_HID_H_ */ diff --git a/sys/dev/hid/hid_if.m b/sys/dev/hid/hid_if.m index 1b9610404c01..38a053b8744e 100644 --- a/sys/dev/hid/hid_if.m +++ b/sys/dev/hid/hid_if.m @@ -164,3 +164,13 @@ METHOD int set_protocol { device_t dev; uint16_t protocol; }; + +# +# Executes arbitrary transport backend command. +# Format of command is defined by hardware transport driver. +# +METHOD int ioctl { + device_t dev; + unsigned long cmd; + uintptr_t data; +}; diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index 8ae7ff4fec9c..9ff00fece820 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -912,6 +912,7 @@ static device_method_t hidbus_methods[] = { DEVMETHOD(hid_set_report, hid_set_report), DEVMETHOD(hid_set_idle, hid_set_idle), DEVMETHOD(hid_set_protocol, hid_set_protocol), + DEVMETHOD(hid_ioctl, hid_ioctl), DEVMETHOD_END };