]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/uhid.4
This commit was generated by cvs2svn to compensate for changes in r161561,
[FreeBSD/FreeBSD.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 July 12, 1998
40 .Dt UHID 4
41 .Os
42 .Sh NAME
43 .Nm uhid
44 .Nd USB generic HID support
45 .Sh SYNOPSIS
46 .Cd "device uhid"
47 .Sh DESCRIPTION
48 The
49 .Nm
50 driver provides support for all HID (Human Interface Device) interfaces
51 in USB devices that do not have a special driver.
52 .Pp
53 The device handles the following
54 .Xr ioctl 2
55 calls:
56 .Bl -tag -width indent
57 .It Dv USB_GET_REPORT_ID Pq Vt int
58 Get the report identifier used by this HID report.
59 .It Dv USB_GET_REPORT_DESC Pq Vt "struct usb_ctl_report_desc"
60 Get the HID report descriptor.
61 Using
62 this descriptor the exact layout and meaning of data to/from
63 the device can be found.
64 The report descriptor is delivered
65 without any processing.
66 .Bd -literal
67 struct usb_ctl_report_desc {
68     int     size;
69     u_char  data[1024]; /* filled data size will vary */
70 };
71 .Ed
72 .It Dv USB_SET_IMMED Pq Vt int
73 Sets the device in a mode where each
74 .Xr read 2
75 will return the current value of the input report.
76 Normally
77 a
78 .Xr read 2
79 will only return the data that the device reports on its
80 interrupt pipe.
81 This call may fail if the device does not support
82 this feature.
83 .It Dv USB_GET_REPORT Pq Vt "struct usb_ctl_report"
84 Get a report from the device without waiting for data on
85 the interrupt pipe.
86 The
87 .Va report
88 field indicates which report is requested.
89 It should be
90 .Dv UHID_INPUT_REPORT ,
91 .Dv UHID_OUTPUT_REPORT ,
92 or
93 .Dv UHID_FEATURE_REPORT .
94 This call may fail if the device does not support this feature.
95 .Bd -literal
96 struct usb_ctl_report {
97         int report;
98         u_char  data[1024];     /* used data size will vary */
99 };
100 .Ed
101 .It Dv USB_SET_REPORT Pq Vt "struct usb_ctl_report"
102 Set a report in the device.
103 The
104 .Va report
105 field indicates which report is to be set.
106 It should be
107 .Dv UHID_INPUT_REPORT ,
108 .Dv UHID_OUTPUT_REPORT ,
109 or
110 .Dv UHID_FEATURE_REPORT .
111 This call may fail if the device does not support this feature.
112 .El
113 .Pp
114 Use
115 .Xr read 2
116 to get data from the device.
117 Data should be read in chunks of the
118 size prescribed by the report descriptor.
119 .Pp
120 Use
121 .Xr write 2
122 to send data to the device.
123 Data should be written in chunks of the
124 size prescribed by the report descriptor.
125 .Sh FILES
126 .Bl -tag -width ".Pa /dev/uhid?"
127 .It Pa /dev/uhid?
128 .El
129 .Sh SEE ALSO
130 .Xr usbhidctl 1 ,
131 .Xr uhidev 4 ,
132 .Xr usb 4
133 .Sh HISTORY
134 The
135 .Nm
136 driver
137 appeared in
138 .Nx 1.4 .
139 This manual page was adopted from
140 .Nx
141 by
142 .An Tom Rhodes Aq trhodes@FreeBSD.org
143 in April 2002.