111 lines
4.0 KiB
Groff
111 lines
4.0 KiB
Groff
.\" $NetBSD: ugen.4,v 1.2 1998/10/22 10:46:43 augustss Exp $
|
|
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
|
|
.\" All rights reserved.
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the NetBSD
|
|
.\" Foundation, Inc. and its contributors.
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
.\" contributors may be used to endorse or promote products derived
|
|
.\" from this software without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
.\"
|
|
.Dd July 12, 1998
|
|
.Dt UGEN 4
|
|
.Os
|
|
.Sh NAME
|
|
.Nm ugen
|
|
.Nd USB generic device support
|
|
.Sh SYNOPSIS
|
|
.Cd "ugen* at uhub? port ?"
|
|
.Pp
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nm
|
|
driver provides support for all USB devices that do not have
|
|
a special driver. It supports access to all parts of the device,
|
|
but not in a way that is as convenient as a special purpose driver.
|
|
.Pp
|
|
There can be up to 127 USB devices connected to a USB bus.
|
|
Each USB device can have up to 16 endpoints. Each of these endpoints
|
|
will communicate in one of four different modes: control, isochronous,
|
|
bulk, or interrupt. Each of the endpoints will have a different
|
|
device. The four least significant bits in the minor device
|
|
number determines which endpoint the device access and the rest
|
|
of the bits determines the device.
|
|
.Pp
|
|
To find out what endpoints that exist there are a series of
|
|
.Xr ioctl 2
|
|
operation on the control endpoint that returns the USB descriptors
|
|
of the device, configuration, interface, etc.
|
|
.Pp
|
|
The control transfer mode can only happen on the control endpoint
|
|
which is always endpoint 0. The control endpoint accepts request
|
|
and may respond with an answer to such request. Control request
|
|
are issued by
|
|
.Xr ioctl 2
|
|
calls.
|
|
.Pp
|
|
The isochronous transfer mode can be in or out depending on the
|
|
endpoint. To perform IO on an isochronous endpoint
|
|
.Xr read 2
|
|
and
|
|
.Xr write 2
|
|
should be used.
|
|
Before any IO operations can take place the transfer rate in
|
|
bytes/second has to be set. This is done with
|
|
.Xr ioctl 2
|
|
.Dv USB_SET_ISO_RATE .
|
|
Performing this call sets up a buffer corresponding to
|
|
about 1 second of data.
|
|
.Pp
|
|
The bulk transfer mode can be in or out depending on the
|
|
endpoint. To perform IO on a bulk endpoint
|
|
.Xr read 2
|
|
and
|
|
.Xr write 2
|
|
should be used.
|
|
All IO operations on a bulk endpoint are unbuffered.
|
|
.Pp
|
|
The interrupt transfer mode can only be in.
|
|
To perform input from an interrupt endpoint
|
|
.Xr read 2
|
|
should be used. A certain moderate amount of buffering is done
|
|
by the driver.
|
|
.Pp
|
|
The
|
|
.Xr select 2
|
|
call can be used on all endpoint except the control
|
|
endpoint.
|
|
.Sh SEE ALSO
|
|
.Xr usb 4
|
|
.Sh HISTORY
|
|
The
|
|
.Nm
|
|
driver
|
|
appeared in
|
|
.Nx 1.4 .
|
|
.Sh BUGS
|
|
The driver is not yet completed.
|