Correct the use of the .Dx/.Fx macro.
[dragonfly.git] / share / man / man4 / uhid.4
1 .\" $NetBSD: uhid.4,v 1.13 2001/12/29 14:41:59 augustss Exp $
2 .\" $FreeBSD: src/share/man/man4/uhid.4,v 1.1.2.3 2002/08/16 05:02:25 trhodes Exp $
3 .\" $DragonFly: src/share/man/man4/uhid.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
4 .\"
5 .\" Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
6 .\" All rights reserved.
7 .\"
8 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" by Lennart Augustsson.
10 .\"
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
13 .\" are met:
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\"    notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\"    notice, this list of conditions and the following disclaimer in the
18 .\"    documentation and/or other materials provided with the distribution.
19 .\" 3. All advertising materials mentioning features or use of this software
20 .\"    must display the following acknowledgment:
21 .\"        This product includes software developed by the NetBSD
22 .\"        Foundation, Inc. and its contributors.
23 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
24 .\"    contributors may be used to endorse or promote products derived
25 .\"    from this software without specific prior written permission.
26 .\"
27 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 .\" POSSIBILITY OF SUCH DAMAGE.
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 "uhid* at uhidev? reportid ?"
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 .Pp
57 .Bl -tag -width indent -compact
58 .It Dv USB_GET_REPORT_ID (int)
59 Get the report identifier used by this HID report.
60 .It Dv USB_GET_REPORT_DESC (struct usb_ctl_report_desc)
61 Get the HID report descriptor.  Using
62 this descriptor the exact layout and meaning of data to/from
63 the device can be found.  The report descriptor is delivered
64 without any processing.
65 .Bd -literal
66 struct usb_ctl_report_desc {
67     int     size;
68     u_char  data[1024]; /* filled data size will vary */
69 };
70 .Ed
71 .It Dv USB_SET_IMMED (int)
72 Sets the device in a mode where each
73 .Xr read 2
74 will return the current value of the input report.  Normally
75 a
76 .Xr read 2
77 will only return the data that the device reports on its
78 interrupt pipe.  This call may fail if the device does not support
79 this feature.
80 .It Dv USB_GET_REPORT (struct usb_ctl_report)
81 Get a report from the device without waiting for data on
82 the interrupt pipe.  The
83 .Dv report
84 field indicates which report is requested.  It should be
85 .Dv UHID_INPUT_REPORT ,
86 .Dv UHID_OUTPUT_REPORT ,
87 or
88 .Dv UHID_FEATURE_REPORT .
89 This call may fail if the device does not support this feature.
90 .Bd -literal
91 struct usb_ctl_report {
92         int report;
93         u_char  data[1024];     /* used data size will vary */
94 };
95 .It Dv USB_SET_REPORT (struct usb_ctl_report)
96 Set a report in the device.  The
97 .Dv report
98 field indicates which report is to be set.  It should be
99 .Dv UHID_INPUT_REPORT ,
100 .Dv UHID_OUTPUT_REPORT ,
101 or
102 .Dv UHID_FEATURE_REPORT .
103 This call may fail if the device does not support this feature.
104 .Ed
105 .El
106 .Pp
107 Use
108 .Xr read 2
109 to get data from the device.  Data should be read in chunks of the
110 size prescribed by the report descriptor.
111 .Pp
112 Use
113 .Xr write 2
114 send data to the device.  Data should be written in chunks of the
115 size prescribed by the report descriptor.
116 .Sh FILES
117 .Bl -tag -width Pa
118 .It Pa /dev/uhid?
119 .El
120 .Sh SEE ALSO
121 .Xr usbhidctl 1 ,
122 .Xr usb 3 ,
123 .Xr uhidev 4 ,
124 .Xr usb 4
125 .Sh HISTORY
126 The
127 .Nm
128 driver
129 appeared in
130 .Nx 1.4 .
131 This manual page was adopted from
132 .Nx
133 by
134 .An Tom Rhodes Aq trhodes@FreeBSD.org
135 in April 2002.