From nobody Wed Mar 02 23:36:37 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 1DB2819F8413; Wed, 2 Mar 2022 23:36:38 +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 4K89Vs6lP2z3wLM; Wed, 2 Mar 2022 23:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646264198; 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=aabaLVlhbvDqcZND8JdZidcTDyGC0wNTMOJZlHtpkm0=; b=OZFq1d1biDq4tCIICV2A7PixgFodd0W/DwNmugDqTojjCW4wGrZGH6cuRE2l/087pWpW4R 7iw1mC7X40fzv3gtonAd06RNpgJhlrKKzj/06UxlfV4bRb43f4zcqb0Fk2np6jDF0KFw8s JEwVBWzcfrPO7k4PZH2+CHT/a15xY1KTSF1XJ24Vci/kDJPLm90uFTd5y4H1c2IqM9Usd/ eK6Foi/nal5Ag1isZn9YuKzgdzhZVOCtAQDy7QZVaJJhdQkhyNcrJptYE0NauEy+QukhT1 zg290BHAtDmIpchSUAM9KYTRJeQUfmJSqS3Eiws7iC0deOtdpn7FqcnJxnQHFw== 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 98CC0520B; Wed, 2 Mar 2022 23:36:37 +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 222Nab0b001547; Wed, 2 Mar 2022 23:36:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 222NabR4001546; Wed, 2 Mar 2022 23:36:37 GMT (envelope-from git) Date: Wed, 2 Mar 2022 23:36:37 GMT Message-Id: <202203022336.222NabR4001546@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: 5f47c5a3a35d - main - 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/main X-Git-Reftype: branch X-Git-Commit: 5f47c5a3a35de67546ce74cb01d45e62d414a179 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646264198; 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=aabaLVlhbvDqcZND8JdZidcTDyGC0wNTMOJZlHtpkm0=; b=sVYYC/cYAfPxlbJhoRcaKalb/8cEnMUNUoBb7WDfNzejGOO95x1EkDGzR2zD4dvIo58NyT u3+18+ZP+24tyot9OTLjpaFonByNGUkx+ZGbM7BrUXXOQKHiOOtw5B7pka4Z1juSJIQl1E gv89d77FRLqzHHcdNCLcBTFIBuDkIhOL2OuTyLG5SpuCrl2UMarCtlvfpQGzNPttK5jYsv Dxz4R9yiydcJoejLPcQQwfC+1xuqoiz8OihMuF5lP0EeSqEGiy5FKAz7ZCaPMCxUP0Wn60 QYY48pdewEMQ8H7TFrl2UZr7jXqFJ7CMqzKxznStyGUbAWyGGW1cAOl469cyLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646264198; a=rsa-sha256; cv=none; b=At2sfZDy7TZl/ong2bUzI/zFGEYjcF/rWz3LJjl7vLUtcOqGqBMQAplXiYHP2BpJpe0x1T 1zLp1QZOKMnUFDn6bxcM4XfWK/DyuTqLK8uwYwluu6qBKAZF6A9ypaIGjx/CiOu05KgvpJ 8y2gYtm/jMBHnUeYW9nLG6PlZs0xvUd9/vNv+bRtVhInBh++8/26aX3OtpXRTLWojq+KCw yO4riYK2z7DuxLmx4bl4CzL5iGc+l1vJxoSjwWMZH55e5reBAd/Ptzw1vpqez7y/a+qSwi iNpUIIfgjLvBuaAiZuXD/Qwt4KnB5qqn5ka65VZjMRKmGxpoGHD1N+Bfzt97AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5f47c5a3a35de67546ce74cb01d45e62d414a179 commit 5f47c5a3a35de67546ce74cb01d45e62d414a179 Author: Vladimir Kondratyev AuthorDate: 2022-03-02 23:35:23 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-03-02 23:35:23 +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. MFC after: 2 month --- 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 896308fccd17..9f920e4dd4b1 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 4a3a3e21bf03..a635ca3de026 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -911,6 +911,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 };