2012-11-28 00:06:36 +04:00
|
|
|
.\" $NetBSD: ugen.4,v 1.31 2012/11/27 20:06:36 jkunz Exp $
|
1999-04-14 00:25:28 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
|
1998-07-12 23:51:55 +04:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
1999-04-14 00:25:28 +04:00
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Lennart Augustsson.
|
|
|
|
.\"
|
1998-07-12 23:51:55 +04:00
|
|
|
.\" 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.
|
|
|
|
.\"
|
|
|
|
.\" 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
|
1999-04-14 00:25:28 +04:00
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
1998-07-12 23:51:55 +04:00
|
|
|
.\" 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.
|
|
|
|
.\"
|
2009-12-23 12:10:07 +03:00
|
|
|
.Dd December 23, 2009
|
1998-07-12 23:51:55 +04:00
|
|
|
.Dt UGEN 4
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm ugen
|
|
|
|
.Nd USB generic device support
|
|
|
|
.Sh SYNOPSIS
|
2005-11-23 11:56:08 +03:00
|
|
|
.Cd "ugen* at uhub? flags N"
|
1998-07-12 23:51:55 +04:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver provides support for all USB devices that do not have
|
2006-07-24 21:00:52 +04:00
|
|
|
a special driver.
|
|
|
|
It supports access to all parts of the device,
|
1998-07-12 23:51:55 +04:00
|
|
|
but not in a way that is as convenient as a special purpose driver.
|
|
|
|
.Pp
|
2005-11-23 11:56:08 +03:00
|
|
|
Normally the
|
|
|
|
.Nm
|
|
|
|
driver is used when no other driver attaches to a device.
|
|
|
|
If
|
|
|
|
.Dq flags 1
|
|
|
|
is specified, the
|
|
|
|
.Nm
|
|
|
|
will instead attach with a very high priority and always be used.
|
|
|
|
Together with the
|
|
|
|
.Cd vendor
|
|
|
|
and
|
|
|
|
.Cd product
|
|
|
|
locators this can be used to force the
|
|
|
|
.Nm
|
|
|
|
driver to be used for a certain
|
|
|
|
device.
|
|
|
|
.Pp
|
1998-07-12 23:51:55 +04:00
|
|
|
There can be up to 127 USB devices connected to a USB bus.
|
2006-07-24 21:00:52 +04:00
|
|
|
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 node.
|
|
|
|
The four least significant bits in the minor device
|
1998-12-09 13:21:21 +03:00
|
|
|
number determines which endpoint the device accesses and the rest
|
|
|
|
of the bits determines which USB device.
|
1998-07-12 23:51:55 +04:00
|
|
|
.Pp
|
1998-12-08 17:18:27 +03:00
|
|
|
If an endpoint address is used both for input and output the device
|
1999-12-23 02:21:21 +03:00
|
|
|
can be opened for both read or write.
|
1998-12-08 17:18:27 +03:00
|
|
|
.Pp
|
2006-07-24 18:24:48 +04:00
|
|
|
To find out what endpoints exist there are a series of
|
1998-07-12 23:51:55 +04:00
|
|
|
.Xr ioctl 2
|
2006-07-24 18:24:48 +04:00
|
|
|
operations on the control endpoint that return the USB descriptors
|
1998-12-08 17:18:27 +03:00
|
|
|
of the device, configurations, interfaces, and endpoints.
|
1998-07-12 23:51:55 +04:00
|
|
|
.Pp
|
|
|
|
The control transfer mode can only happen on the control endpoint
|
2006-07-24 21:00:52 +04:00
|
|
|
which is always endpoint 0.
|
|
|
|
The control endpoint accepts requests
|
|
|
|
and may respond with an answer to such requests.
|
|
|
|
Control requests are issued by
|
1998-07-12 23:51:55 +04:00
|
|
|
.Xr ioctl 2
|
2001-09-12 02:52:52 +04:00
|
|
|
calls.
|
1998-12-08 17:18:27 +03:00
|
|
|
.\" .Pp
|
|
|
|
.\" The isochronous transfer mode can be in or out depending on the
|
2006-07-24 21:00:52 +04:00
|
|
|
.\" endpoint.
|
|
|
|
.\" To perform IO on an isochronous endpoint
|
1998-12-08 17:18:27 +03:00
|
|
|
.\" .Xr read 2
|
|
|
|
.\" and
|
|
|
|
.\" .Xr write 2
|
|
|
|
.\" should be used.
|
|
|
|
.\" Before any IO operations can take place the transfer rate in
|
2006-07-24 21:00:52 +04:00
|
|
|
.\" bytes/second has to be set.
|
|
|
|
.\" This is done with
|
1998-12-08 17:18:27 +03:00
|
|
|
.\" .Xr ioctl 2
|
|
|
|
.\" .Dv USB_SET_ISO_RATE .
|
|
|
|
.\" Performing this call sets up a buffer corresponding to
|
|
|
|
.\" about 1 second of data.
|
1998-07-12 23:51:55 +04:00
|
|
|
.Pp
|
|
|
|
The bulk transfer mode can be in or out depending on the
|
2006-07-24 21:00:52 +04:00
|
|
|
endpoint.
|
|
|
|
To perform IO on a bulk endpoint
|
1998-07-12 23:51:55 +04:00
|
|
|
.Xr read 2
|
|
|
|
and
|
|
|
|
.Xr write 2
|
|
|
|
should be used.
|
2006-07-24 18:24:48 +04:00
|
|
|
All IO operations on a bulk endpoint are normally unbuffered.
|
2009-12-23 04:04:45 +03:00
|
|
|
The
|
2006-07-24 18:24:48 +04:00
|
|
|
.Dv USB_SET_BULK_RA
|
2006-07-24 22:13:42 +04:00
|
|
|
and
|
2006-07-24 18:24:48 +04:00
|
|
|
.Dv USB_SET_BULK_WB
|
|
|
|
.Xr ioctl 2
|
2009-12-23 04:04:45 +03:00
|
|
|
calls enable read-ahead and write-behind buffering, respectively.
|
2009-12-21 22:04:36 +03:00
|
|
|
This buffering supports fixed-sized USB transfers and is intended for
|
|
|
|
devices with regular and continuing data transfers.
|
2006-07-24 21:00:52 +04:00
|
|
|
When read-ahead or write-behind are enabled, the file descriptor
|
|
|
|
may be set to use non-blocking IO.
|
1998-07-12 23:51:55 +04:00
|
|
|
.Pp
|
2009-12-23 04:04:45 +03:00
|
|
|
When in a read-ahead/writeback mode,
|
2006-07-24 22:13:42 +04:00
|
|
|
.Xr select 2
|
|
|
|
for read and write operates normally, returning true if there is data
|
|
|
|
in the read buffer and space in the write buffer, respectively.
|
2009-12-23 04:04:45 +03:00
|
|
|
When not,
|
2006-07-24 22:13:42 +04:00
|
|
|
.Xr select 2
|
|
|
|
always returns true, because there is no way to predict how the device
|
|
|
|
will respond to a read or write request.
|
|
|
|
.Pp
|
2005-04-29 23:16:17 +04:00
|
|
|
The interrupt transfer mode can be in or out depending on the
|
|
|
|
endpoint.
|
|
|
|
To perform IO on an interrupt endpoint
|
1998-07-12 23:51:55 +04:00
|
|
|
.Xr read 2
|
2005-04-29 23:16:17 +04:00
|
|
|
and
|
|
|
|
.Xr write 2
|
|
|
|
should be used.
|
|
|
|
A moderate amount of buffering is done
|
1998-07-12 23:51:55 +04:00
|
|
|
by the driver.
|
|
|
|
.Pp
|
1999-12-23 12:23:48 +03:00
|
|
|
All endpoints handle the following
|
1998-12-08 17:18:27 +03:00
|
|
|
.Xr ioctl 2
|
|
|
|
calls:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width indent -compact
|
1999-07-30 05:32:05 +04:00
|
|
|
.It Dv USB_SET_SHORT_XFER (int)
|
2006-07-24 21:00:52 +04:00
|
|
|
Allow short read transfer.
|
|
|
|
Normally a transfer from the device which is shorter than the
|
|
|
|
request specified is reported as an error.
|
1999-08-23 16:32:19 +04:00
|
|
|
.It Dv USB_SET_TIMEOUT (int)
|
|
|
|
Set the timeout on the device operations, the time is specified
|
2006-07-24 21:00:52 +04:00
|
|
|
in milliseconds.
|
|
|
|
The value 0 is used to indicate that there is no timeout.
|
1999-12-23 12:23:48 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The control endpoint (endpoint 0) handles the following
|
|
|
|
.Xr ioctl 2
|
|
|
|
calls:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width indent -compact
|
1998-12-11 02:43:32 +03:00
|
|
|
.It Dv USB_GET_CONFIG (int)
|
1998-12-08 17:18:27 +03:00
|
|
|
Get the device configuration number.
|
|
|
|
.It Dv USB_SET_CONFIG (int)
|
|
|
|
Set the device into the given configuration number.
|
2009-04-10 19:07:08 +04:00
|
|
|
.Pp
|
1998-12-11 02:43:32 +03:00
|
|
|
This operation can only be performed when the control endpoint
|
1998-12-08 17:18:27 +03:00
|
|
|
is the sole open endpoint.
|
|
|
|
.It Dv USB_GET_ALTINTERFACE (struct usb_alt_interface)
|
|
|
|
Get the alternative setting number for the interface with the given
|
|
|
|
index.
|
2001-09-12 02:52:52 +04:00
|
|
|
The
|
1998-12-09 13:21:21 +03:00
|
|
|
.Dv config_index
|
|
|
|
is ignored in this call.
|
1998-12-08 17:18:27 +03:00
|
|
|
.Bd -literal
|
|
|
|
struct usb_alt_interface {
|
2003-12-15 00:12:26 +03:00
|
|
|
int uai_config_index;
|
2008-01-19 12:58:38 +03:00
|
|
|
int uai_interface_index;
|
2003-12-15 00:12:26 +03:00
|
|
|
int uai_alt_no;
|
1998-12-08 17:18:27 +03:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.It Dv USB_SET_ALTINTERFACE (struct usb_alt_interface)
|
|
|
|
Set the alternative setting to the given number in the interface with the
|
|
|
|
given index.
|
2001-09-12 02:52:52 +04:00
|
|
|
The
|
2003-12-15 00:12:26 +03:00
|
|
|
.Dv uai_config_index
|
1998-12-09 13:21:21 +03:00
|
|
|
is ignored in this call.
|
2009-04-10 19:07:08 +04:00
|
|
|
.Pp
|
1998-12-11 02:43:32 +03:00
|
|
|
This operation can only be performed when no endpoints for the interface
|
1998-12-08 17:18:27 +03:00
|
|
|
are open.
|
|
|
|
.It Dv USB_GET_NO_ALT (struct usb_alt_interface)
|
|
|
|
Return the number of different alternate settings in the
|
2012-11-28 00:06:36 +04:00
|
|
|
.Dv uai_alt_no
|
1998-12-08 17:18:27 +03:00
|
|
|
field.
|
|
|
|
.It Dv USB_GET_DEVICE_DESC (usb_device_descriptor_t)
|
|
|
|
Return the device descriptor.
|
|
|
|
.It Dv USB_GET_CONFIG_DESC (struct usb_config_desc)
|
|
|
|
Return the descriptor for the configuration with the given index.
|
|
|
|
For convenience the current configuration can be specified by
|
|
|
|
.Dv USB_CURRENT_CONFIG_INDEX .
|
|
|
|
.Bd -literal
|
|
|
|
struct usb_config_desc {
|
2003-12-15 00:12:26 +03:00
|
|
|
int ucd_config_index;
|
|
|
|
usb_config_descriptor_t ucd_desc;
|
1998-12-08 17:18:27 +03:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.It Dv USB_GET_INTERFACE_DESC (struct usb_interface_desc)
|
|
|
|
Return the interface descriptor for an interface specified by its
|
|
|
|
configuration index, interface index, and alternative index.
|
|
|
|
For convenience the current alternative can be specified by
|
|
|
|
.Dv USB_CURRENT_ALT_INDEX .
|
|
|
|
.Bd -literal
|
|
|
|
struct usb_interface_desc {
|
2003-12-15 00:12:26 +03:00
|
|
|
int uid_config_index;
|
|
|
|
int uid_interface_index;
|
|
|
|
int uid_alt_index;
|
|
|
|
usb_interface_descriptor_t uid_desc;
|
1998-12-08 17:18:27 +03:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.It Dv USB_GET_ENDPOINT_DESC (struct usb_endpoint_desc)
|
|
|
|
Return the endpoint descriptor for the endpoint specified by its
|
|
|
|
configuration index, interface index, alternative index, and
|
|
|
|
endpoint index.
|
|
|
|
.Bd -literal
|
|
|
|
struct usb_endpoint_desc {
|
2003-12-15 00:12:26 +03:00
|
|
|
int ued_config_index;
|
|
|
|
int ued_interface_index;
|
|
|
|
int ued_alt_index;
|
|
|
|
int ued_endpoint_index;
|
|
|
|
usb_endpoint_descriptor_t ued_desc;
|
1998-12-08 17:18:27 +03:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.It Dv USB_GET_FULL_DESC (struct usb_full_desc)
|
|
|
|
Return all the descriptors for the given configuration.
|
|
|
|
.Bd -literal
|
|
|
|
struct usb_full_desc {
|
2003-12-15 00:12:26 +03:00
|
|
|
int ufd_config_index;
|
|
|
|
u_int ufd_size;
|
|
|
|
u_char *ufd_data;
|
1998-12-08 17:18:27 +03:00
|
|
|
};
|
|
|
|
.Ed
|
2001-09-12 02:52:52 +04:00
|
|
|
The
|
2003-12-15 00:12:26 +03:00
|
|
|
.Dv ufd_data
|
2004-10-04 23:12:52 +04:00
|
|
|
field should point to a memory area of the size given in the
|
2003-12-15 00:12:26 +03:00
|
|
|
.Dv ufd_size
|
2006-07-24 21:00:52 +04:00
|
|
|
field.
|
|
|
|
The proper size can be determined by first issuing a
|
1998-12-08 17:18:27 +03:00
|
|
|
.Dv USB_GET_CONFIG_DESC
|
|
|
|
and inspecting the
|
|
|
|
.Dv wTotalLength
|
|
|
|
field.
|
1998-12-09 13:21:21 +03:00
|
|
|
.It Dv USB_GET_STRING_DESC (struct usb_string_desc)
|
|
|
|
Get a string descriptor for the given language id and
|
|
|
|
string index.
|
|
|
|
.Bd -literal
|
|
|
|
struct usb_string_desc {
|
2003-12-15 00:12:26 +03:00
|
|
|
int usd_string_index;
|
|
|
|
int usd_language_id;
|
|
|
|
usb_string_descriptor_t usd_desc;
|
1998-12-09 13:21:21 +03:00
|
|
|
};
|
|
|
|
.Ed
|
1998-12-08 17:18:27 +03:00
|
|
|
.It Dv USB_DO_REQUEST
|
|
|
|
Send a USB request to the device on the control endpoint.
|
|
|
|
Any data sent to/from the device is located at
|
|
|
|
.Dv data .
|
1998-12-09 13:21:21 +03:00
|
|
|
The size of the transferred data is determined from the
|
|
|
|
.Dv request .
|
2001-09-12 02:52:52 +04:00
|
|
|
The
|
2003-12-15 00:12:26 +03:00
|
|
|
.Dv ucr_addr
|
1998-12-09 13:21:21 +03:00
|
|
|
field is ignored in this call.
|
2000-04-14 18:55:46 +04:00
|
|
|
The
|
2003-12-15 00:12:26 +03:00
|
|
|
.Dv ucr_flags
|
2000-04-14 18:55:46 +04:00
|
|
|
field can be used to flag that the request is allowed to
|
|
|
|
be shorter than the requested size, and the
|
2003-12-15 00:12:26 +03:00
|
|
|
.Dv ucr_actlen
|
|
|
|
field will contain the actual size on completion.
|
1998-12-08 17:18:27 +03:00
|
|
|
.Bd -literal
|
|
|
|
struct usb_ctl_request {
|
2003-12-15 00:12:26 +03:00
|
|
|
int ucr_addr;
|
|
|
|
usb_device_request_t ucr_request;
|
|
|
|
void *ucr_data;
|
|
|
|
int ucr_flags;
|
2000-04-14 18:55:46 +04:00
|
|
|
#define USBD_SHORT_XFER_OK 0x04 /* allow short reads */
|
2003-12-15 00:12:26 +03:00
|
|
|
int ucr_actlen; /* actual length transferred */
|
1998-12-08 17:18:27 +03:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
This is a dangerous operation in that it can perform arbitrary operations
|
2006-07-24 21:00:52 +04:00
|
|
|
on the device.
|
|
|
|
Some of the most dangerous (e.g., changing the device
|
1998-12-09 13:21:21 +03:00
|
|
|
address) are not allowed.
|
|
|
|
.It Dv USB_GET_DEVICEINFO (struct usb_device_info)
|
2006-07-24 21:00:52 +04:00
|
|
|
Get an information summary for the device.
|
|
|
|
This call will not issue any USB transactions.
|
1998-12-08 17:18:27 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
2006-07-24 18:24:48 +04:00
|
|
|
Bulk endpoints handle the following
|
|
|
|
.Xr ioctl 2
|
|
|
|
calls:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width indent -compact
|
|
|
|
.It Dv USB_SET_BULK_RA (int)
|
2006-07-24 21:00:52 +04:00
|
|
|
Enable or disable bulk read-ahead.
|
2006-07-24 22:13:42 +04:00
|
|
|
When enabled, the driver will begin to read data from the device into
|
|
|
|
a buffer, and will perform reads from the device whenever there is
|
|
|
|
room in the buffer.
|
2006-07-24 21:00:52 +04:00
|
|
|
The
|
2006-07-24 18:24:48 +04:00
|
|
|
.Xr read 2
|
|
|
|
call will read data from this buffer, blocking if necessary until
|
2006-07-24 21:00:52 +04:00
|
|
|
there is enough data to read the length of data requested.
|
|
|
|
The buffer size and the read request length can be set by the
|
2006-07-24 18:24:48 +04:00
|
|
|
.Dv USB_SET_BULK_RA_OPT
|
|
|
|
.Xr ioctl 2
|
|
|
|
call.
|
|
|
|
.It Dv USB_SET_BULK_WB (int)
|
2006-07-24 21:00:52 +04:00
|
|
|
Enable or disable bulk write-behind.
|
|
|
|
When enabled, the driver will buffer data from the
|
2006-07-24 18:24:48 +04:00
|
|
|
.Xr write 2
|
2006-07-24 22:13:42 +04:00
|
|
|
call before writing it to the device, enabling the
|
|
|
|
.Xr write 2
|
|
|
|
call to return immediately.
|
2006-07-24 18:24:48 +04:00
|
|
|
.Xr write 2
|
|
|
|
will block if there is not enough room in the buffer for all
|
2006-07-24 21:00:52 +04:00
|
|
|
the data.
|
|
|
|
The buffer size and the write request length can be set by the
|
2006-07-24 18:24:48 +04:00
|
|
|
.Dv USB_SET_BULK_WB_OPT
|
|
|
|
.Xr ioctl 2
|
|
|
|
call.
|
|
|
|
.It Dv USB_SET_BULK_RA_OPT (struct usb_bulk_ra_wb_opt)
|
|
|
|
Set the size of the buffer and the length of the read requests used by
|
2006-07-24 21:00:52 +04:00
|
|
|
the driver when bulk read-ahead is enabled.
|
|
|
|
The changes do not take
|
|
|
|
effect until the next time bulk read-ahead is enabled.
|
|
|
|
Read requests
|
2006-07-24 18:24:48 +04:00
|
|
|
are made for the length specified, and the host controller driver
|
|
|
|
(i.e.,
|
|
|
|
.Xr ehci 4 ,
|
2006-07-24 21:00:52 +04:00
|
|
|
.Xr ohci 4 ,
|
|
|
|
and
|
|
|
|
.Xr uhci 4 )
|
|
|
|
will perform as many bus transfers as required.
|
|
|
|
If transfers from the device should be smaller than the maximum length,
|
2006-07-24 18:24:48 +04:00
|
|
|
.Dv ra_wb_request_size
|
|
|
|
must be set to the required length.
|
|
|
|
.Bd -literal
|
|
|
|
struct usb_bulk_ra_wb_opt {
|
|
|
|
u_int ra_wb_buffer_size;
|
|
|
|
u_int ra_wb_request_size;
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.It Dv USB_SET_BULK_WB_OPT (struct usb_bulk_ra_wb_opt)
|
|
|
|
Set the size of the buffer and the length of the write requests used
|
2006-07-24 21:00:52 +04:00
|
|
|
by the driver when bulk write-behind is enabled.
|
|
|
|
The changes do not
|
2006-07-24 18:24:48 +04:00
|
|
|
take effect until the next time bulk write-behind is enabled.
|
|
|
|
.El
|
|
|
|
.Pp
|
2001-09-12 02:52:52 +04:00
|
|
|
Note that there are two different ways of addressing configurations, interfaces,
|
1998-12-08 17:18:27 +03:00
|
|
|
alternatives, and endpoints: by index or by number.
|
|
|
|
The index is the ordinal number (starting from 0) of the descriptor
|
2006-07-24 21:00:52 +04:00
|
|
|
as presented by the device.
|
|
|
|
The number is the respective number of
|
|
|
|
the entity as found in its descriptor.
|
|
|
|
Enumeration of descriptors
|
1998-12-08 17:18:27 +03:00
|
|
|
use the index, getting and setting typically uses numbers.
|
|
|
|
.Pp
|
1998-12-09 13:21:21 +03:00
|
|
|
Example:
|
1998-12-08 17:18:27 +03:00
|
|
|
All endpoints (except the control endpoint) for the current configuration
|
|
|
|
can be found by iterating the
|
|
|
|
.Dv interface_index
|
|
|
|
from 0 to
|
2002-02-13 11:17:26 +03:00
|
|
|
.Dv config_desc-\*[Gt]bNumInterface-1
|
1998-12-08 17:18:27 +03:00
|
|
|
and for each of these iterating the
|
|
|
|
.Dv endpoint_index
|
|
|
|
from 0 to
|
2002-02-13 11:17:26 +03:00
|
|
|
.Dv interface_desc-\*[Gt]bNumEndpoints .
|
2001-09-12 02:52:52 +04:00
|
|
|
The
|
1998-12-08 17:18:27 +03:00
|
|
|
.Dv config_index
|
|
|
|
should set to
|
|
|
|
.Dv USB_CURRENT_CONFIG_INDEX
|
|
|
|
and
|
|
|
|
.Dv alt_index
|
|
|
|
should be set to
|
|
|
|
.Dv USB_CURRENT_ALT_INDEX .
|
1999-08-23 16:32:19 +04:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width Pa
|
|
|
|
.It Pa /dev/ugenN.EE
|
|
|
|
Endpoint
|
|
|
|
.Pa EE
|
|
|
|
of device
|
|
|
|
.Pa N .
|
|
|
|
.El
|
1998-07-12 23:51:55 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr usb 4
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver
|
|
|
|
appeared in
|
|
|
|
.Nx 1.4 .
|
2000-09-08 05:11:15 +04:00
|
|
|
.\" .Sh BUGS
|
|
|
|
.\" The driver is not yet finished; there is no access to isochronous endpoints.
|