1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH HID 7D "June 19, 2021"
.SH NAME
hid \- Human interface device (HID) class driver
.SH SYNOPSIS
.nf
\fBkeyboard@unit-address\fR
\fBmouse@unit-address\fR
\fBinput@unit-address:consumer_control\fR
\fB#include <sys/usb/clients/hid/hid.h>\fR
\fBint ioctl(int fildes, int command, ... /*arg*/);\fR
.fi
.SH DESCRIPTION
The \fBhid\fR driver is a USBA (Solaris USB Architecture) compliant client
driver that supports the \fIHuman Interface Device Class (HID) 1.0\fR
specification. The Human Interface Device (HID) class encompasses devices
controlled by humans to operate computer systems. Typical examples of HID
devices include keyboards, mice, trackballs, and joysticks. HID also covers
front-panel controls such as knobs, switches, and buttons. A USB device with
multiple interfaces may have one interface for audio and a HID interface to
define the buttons that control the audio.
.sp
.LP
The \fBhid\fR driver is general and primarily handles the USB functionality of
the device and generic HID functionality. For example, HID interfaces are
required to have an interrupt pipe for the device to send data packets, and the
\fBhid\fR driver opens the pipe to the interrupt endpoint and starts polling.
The \fBhid\fR driver is also responsible for managing the device through the
default control pipe. In addition to being a USB client driver, the \fBhid\fR
driver is also a STREAMS driver so that modules may be pushed on top of it.
.sp
.LP
The HID specification is flexible, and HID devices dynamically describe their
packets and other parameters through a HID report descriptor. The HID parser is
a misc module that parses the HID report descriptor and creates a database of
information about the device. The \fBhid\fR driver queries the HID parser to
find out the type and characteristics of the HID device. The HID specification
predefines packet formats for the boot protocol keyboard and mouse.
.SH IOCTLS
.ne 2
.na
\fB\fBHIDIOCKMGDIRECT\fR\fR
.ad
.RS 19n
This ioctl should only be addressed to a USB keyboard or mouse device. The
\fBhid\fR driver maintains two streams for each USB keyboard/mouse instance: an
internal one for the use of the kernel and an external one for the use of user
applications. This ioctl returns the information of which stream gets the input
for the moment.
.sp
\fIarg\fR must point to a variable of \fBint\fR type. Upon return, \fB0\fR
means the internal stream gets the input, \fB1\fR means the external stream
gets the input.
.RE
.sp
.ne 2
.na
\fB\fBHIDIOCKMSDIRECT\fR\fR
.ad
.RS 19n
This ioctl should only be addressed to a USB keyboard or mouse device. The hid
driver maintains two streams for each USB keyboard/mouse instance: an internal
one for the use of the kernel and an external one for the use of user
applications. This ioctl sets which stream should get the input for the moment.
.sp
\fIarg\fR must point to a variable of \fBint\fR type. The argument \fB0\fR
means the internal stream gets the input, \fB1\fR means the external stream
gets the input.
.RE
.SH FILES
.ne 2
.na
\fB\fB/kernel/drv/amd64/hid\fR\fR
.ad
.sp .6
.RS 4n
64-bit x86 ELF kernel hid module
.RE
.sp
.ne 2
.na
\fB\fB/kernel/drv/sparcv9/hid\fR\fR
.ad
.sp .6
.RS 4n
64-bit SPARC ELF kernel hid module
.RE
.sp
.ne 2
.na
\fB\fB/kernel/misc/amd64/hidparser\fR\fR
.ad
.sp .6
.RS 4n
64-bit x86 ELF kernel hidparser module
.RE
.sp
.ne 2
.na
\fB\fB/kernel/misc/sparcv9/hidparser\fR\fR
.ad
.sp .6
.RS 4n
64-bit SPARC ELF kernel hidparser module
.RE
.SH ATTRIBUTES
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Architecture SPARC, x86, PCI-based systems
.TE
.SH SEE ALSO
\fBcfgadm_usb\fR(1M), \fBattributes\fR(5), \fBusba\fR(7D), \fBvirtualkm\fR(7D)
.sp
.LP
\fIWriting Device Drivers\fR
.sp
.LP
\fISTREAMS Programming Guide\fR
.sp
.LP
\fIUniversal Serial Bus Specification 1.0 and 1.1\fR
.sp
.LP
\fIDevice Class Definition for Human Interface Devices (HID) 1.1\fR
.sp
.LP
\fISystem Administration Guide: Basic Administration\fR
.SH DIAGNOSTICS
.ne 2
.na
\fBhid_attach: Unsupported HID device.\fR
.ad
.sp .6
.RS 4n
The device requires a protocol not supported by the hid driver.
.RE
.sp
.ne 2
.na
\fBParsing of hid descriptor failed.\fR
.ad
.sp .6
.RS 4n
The HID report descriptor cannot be parsed correctly. The device cannot be
supported by the hid driver.
.RE
.sp
.ne 2
.na
\fBInvalid report descriptor.\fR
.ad
.sp .6
.RS 4n
The HID report descriptor is invalid. The device cannot be supported by the hid
driver.
.RE
.sp
.LP
The following messages may be logged into the system log. They are formatted in
the following manner:
.sp
.in +2
.nf
<device path><hid<instance number>): message...
.fi
.in -2
.sp
.sp
.ne 2
.na
\fBhid_attach: Unsupported HID device.\fR
.ad
.sp .6
.RS 4n
The device cannot be supported by this version of the HID driver.
.RE
.sp
.ne 2
.na
\fBParsing of HID descriptor failed.\fR
.ad
.sp .6
.RS 4n
The device cannot be supported by this version of the HID driver.
.RE
.sp
.ne 2
.na
\fBInvalid report descriptor.\fR
.ad
.sp .6
.RS 4n
The device cannot be supported by this version of the HID driver.
.RE
.SH NOTES
The hid driver currently supports only keyboard, mouse and audio HID control
devices.
.sp
.LP
Normally a mouse is not power managed and consequently, screen darkening can be
undone with a mouse movement. If power management of the mouse is required, add
the following line to \fBhid.conf\fR then reboot the system:
.sp
.in +2
.nf
hid-mouse-pm-enable;
.fi
.in -2
.sp
.LP
Modern mice that are power managed require a 'click' to wake up. Occasionally,
this may cause unexpected results.
|