]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - share/man/man4/uhid.4
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / share / man / man4 / uhid.4
1 .\" $NetBSD: uhid.4,v 1.13 2001/12/29 14:41:59 augustss Exp $
2 .\"
3 .\" Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Lennart Augustsson.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\"    must display the following acknowledgment:
19 .\"        This product includes software developed by the NetBSD
20 .\"        Foundation, Inc. and its contributors.
21 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
22 .\"    contributors may be used to endorse or promote products derived
23 .\"    from this software without specific prior written permission.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 .\" POSSIBILITY OF SUCH DAMAGE.
36 .\"
37 .\" $FreeBSD$
38 .\"
39 .Dd November 22, 2006
40 .Dt UHID 4
41 .Os
42 .Sh NAME
43 .Nm uhid
44 .Nd USB generic HID support
45 .Sh SYNOPSIS
46 To compile this driver into the kernel,
47 place the following line in your
48 kernel configuration file:
49 .Bd -ragged -offset indent
50 .Cd "device uhid"
51 .Ed
52 .Pp
53 Alternatively, to load the driver as a
54 module at boot time, place the following line in
55 .Xr loader.conf 5 :
56 .Bd -literal -offset indent
57 uhid_load="YES"
58 .Ed
59 .Sh DESCRIPTION
60 The
61 .Nm
62 driver provides support for all HID (Human Interface Device) interfaces
63 in USB devices that do not have a special driver.
64 .Pp
65 The device handles the following
66 .Xr ioctl 2
67 calls:
68 .Bl -tag -width indent
69 .It Dv USB_GET_REPORT_ID Pq Vt int
70 Get the report identifier used by this HID report.
71 .It Dv USB_GET_REPORT_DESC Pq Vt "struct usb_ctl_report_desc"
72 Get the HID report descriptor.
73 Using
74 this descriptor the exact layout and meaning of data to/from
75 the device can be found.
76 The report descriptor is delivered
77 without any processing.
78 .Bd -literal
79 struct usb_ctl_report_desc {
80     int     ucrd_size;
81     u_char  ucrd_data[1024];    /* filled data size will vary */
82 };
83 .Ed
84 .It Dv USB_SET_IMMED Pq Vt int
85 Sets the device in a mode where each
86 .Xr read 2
87 will return the current value of the input report.
88 Normally
89 a
90 .Xr read 2
91 will only return the data that the device reports on its
92 interrupt pipe.
93 This call may fail if the device does not support
94 this feature.
95 .It Dv USB_GET_REPORT Pq Vt "struct usb_ctl_report"
96 Get a report from the device without waiting for data on
97 the interrupt pipe.
98 The
99 .Va report
100 field indicates which report is requested.
101 It should be
102 .Dv UHID_INPUT_REPORT ,
103 .Dv UHID_OUTPUT_REPORT ,
104 or
105 .Dv UHID_FEATURE_REPORT .
106 This call may fail if the device does not support this feature.
107 .Bd -literal
108 struct usb_ctl_report {
109         int ucr_report;
110         u_char  ucr_data[1024]; /* used data size will vary */
111 };
112 .Ed
113 .It Dv USB_SET_REPORT Pq Vt "struct usb_ctl_report"
114 Set a report in the device.
115 The
116 .Va report
117 field indicates which report is to be set.
118 It should be
119 .Dv UHID_INPUT_REPORT ,
120 .Dv UHID_OUTPUT_REPORT ,
121 or
122 .Dv UHID_FEATURE_REPORT .
123 This call may fail if the device does not support this feature.
124 .El
125 .Pp
126 Use
127 .Xr read 2
128 to get data from the device.
129 Data should be read in chunks of the
130 size prescribed by the report descriptor.
131 .Pp
132 Use
133 .Xr write 2
134 to send data to the device.
135 Data should be written in chunks of the
136 size prescribed by the report descriptor.
137 .Sh FILES
138 .Bl -tag -width ".Pa /dev/uhid?"
139 .It Pa /dev/uhid?
140 .El
141 .Sh SEE ALSO
142 .Xr usbhidctl 1 ,
143 .Xr usb 4
144 .Sh HISTORY
145 The
146 .Nm
147 driver
148 appeared in
149 .Nx 1.4 .
150 This manual page was adopted from
151 .Nx
152 by
153 .An Tom Rhodes Aq trhodes@FreeBSD.org
154 in April 2002.