commit | b80eb88b80d26ded9a0b07c161b8d3dca5dc7455 | [log] [tgz] |
---|---|---|
author | Tom Thorogood <me+google@tomthorogood.co.uk> | Wed Feb 03 21:19:46 2021 +1030 |
committer | Tobias Klauser <tobias.klauser@gmail.com> | Tue Feb 23 08:53:22 2021 +0000 |
tree | 8fd3f38e042b3b2b048012dc7cb40f1ba330ec74 | |
parent | d8cc79f4ae2403a1ab3b5b087f0881d28f1c9001 [diff] |
unix: add HIDRAW ioctls This change adds (most) of the ioctl API for the Linux HIDRAW interface. Reading and writing non-numbered HID reports is done using the read and write system calls respectively. Some of the HIDIOC* request numbers are exported directly while others are kept unexported. This is because some of the #defines require a len attribute that doesn't have a specific well defined value. Wrapper types are added for most of the request numbers as is standard. No wrapper is added for HIDIOCGRDESCSIZE as it would just be IoctlGetUint32. The HIDIOC[GS]FEATURE, HIDIOC[GS]INPUT and HIDIOC[GS]OUTPUT request numbers, which are required for numbered HID reports, are entirely ommitted as the len attribute has to be a runtime variable. These could be added later by doing something like `HIDIOCGFEATURE(0) | (len << _IOC_SIZESHIFT)`, with care taken that len doesn't overflow _IOC_XSIZEMASK. Outdated documentation for the HIDRAW interface is available at: https://www.kernel.org/doc/Documentation/hid/hidraw.txt. Change-Id: I2ae5060f0f46150f6fb52959c2e55f50927c1f69 Reviewed-on: https://go-review.googlesource.com/c/sys/+/289169 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
This repository holds supplemental Go packages for low-level interactions with the operating system.
The easiest way to install is to run go get -u golang.org/x/sys
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/sys
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the sys repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/sys:” in the subject line, so it is easy to find.