2010-03-04 22:06:57 +00:00
|
|
|
.\" Copyright (c) 1997, 1998 Nick Hibma <n_hibma@FreeBSD.org>
|
2009-05-21 17:26:20 +00:00
|
|
|
.\" Copyright (c) 2008 Hans Petter Selasky. 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.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1999-02-21 16:56:33 +00:00
|
|
|
.\"
|
2018-04-24 17:46:33 +00:00
|
|
|
.Dd April 24, 2018
|
1999-11-15 23:14:32 +00:00
|
|
|
.Dt USB 4
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1999-02-21 16:56:33 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm usb
|
|
|
|
.Nd Universal Serial Bus
|
|
|
|
.Sh SYNOPSIS
|
2006-11-22 21:30:02 +00:00
|
|
|
To compile this driver into the kernel,
|
|
|
|
place the following line in your
|
|
|
|
kernel configuration file:
|
|
|
|
.Bd -ragged -offset indent
|
2000-01-23 16:13:26 +00:00
|
|
|
.Cd "device usb"
|
2006-11-22 21:30:02 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Alternatively, to load the driver as a
|
|
|
|
module at boot time, place the following line in
|
|
|
|
.Xr loader.conf 5 :
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
usb_load="YES"
|
|
|
|
.Ed
|
2009-05-21 17:26:20 +00:00
|
|
|
.Sh USERLAND PROGRAMMING
|
|
|
|
USB functions can be accessed from userland through the libusb library.
|
|
|
|
See
|
|
|
|
.Xr libusb 3
|
|
|
|
for more information.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Sh DESCRIPTION
|
1999-09-03 13:47:58 +00:00
|
|
|
.Fx
|
1999-02-21 16:56:33 +00:00
|
|
|
provides machine-independent bus support and drivers for
|
|
|
|
.Tn USB
|
2009-05-21 17:26:20 +00:00
|
|
|
devices in host and device side mode.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
2009-05-21 17:26:20 +00:00
|
|
|
driver has three layers:
|
2012-06-02 11:03:14 +00:00
|
|
|
.Bl -tag -width 6n -offset indent
|
2009-05-21 17:26:20 +00:00
|
|
|
.It USB Controller (Bus)
|
|
|
|
.It USB Device
|
|
|
|
.It USB Driver
|
|
|
|
.El
|
|
|
|
.Pp
|
2000-03-01 14:50:24 +00:00
|
|
|
The controller attaches to a physical bus
|
2009-05-21 17:26:20 +00:00
|
|
|
like
|
|
|
|
.Xr pci 4 .
|
1999-02-21 16:56:33 +00:00
|
|
|
The
|
|
|
|
.Tn USB
|
2002-03-18 14:35:22 +00:00
|
|
|
bus attaches to the controller, and the root hub attaches
|
1999-02-21 16:56:33 +00:00
|
|
|
to the controller.
|
|
|
|
Any devices attached to the bus will attach to the root hub
|
2002-03-18 14:35:22 +00:00
|
|
|
or another hub attached to the
|
|
|
|
.Tn USB
|
|
|
|
bus.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm uhub
|
2017-04-29 16:44:36 +00:00
|
|
|
device will always be present as it is needed for the root hub.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Sh INTRODUCTION TO USB
|
|
|
|
The
|
|
|
|
.Tn USB
|
2009-05-21 17:26:20 +00:00
|
|
|
is a system where external devices can be connected to a PC.
|
|
|
|
The most common USB speeds are:
|
2012-06-02 11:03:14 +00:00
|
|
|
.Bl -tag -width 6n -offset indent
|
2009-05-21 17:26:20 +00:00
|
|
|
.It Low Speed (1.5MBit/sec)
|
|
|
|
.It Full Speed (12MBit/sec)
|
|
|
|
.It High Speed (480MBit/sec)
|
|
|
|
.El
|
|
|
|
.Pp
|
1999-02-21 16:56:33 +00:00
|
|
|
Each
|
|
|
|
.Tn USB
|
2009-05-21 17:26:20 +00:00
|
|
|
has a USB controller that is the master of the bus.
|
2017-04-29 16:44:36 +00:00
|
|
|
The physical communication is simplex which means the host controller only
|
|
|
|
communicates with one USB device at a time.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
2009-05-21 17:26:20 +00:00
|
|
|
There can be up to 127 devices connected to an USB HUB tree.
|
2017-04-29 16:44:36 +00:00
|
|
|
The addresses are assigned dynamically by the host when each device is
|
|
|
|
attached to the bus.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
|
|
|
Within each device there can be up to 16 endpoints.
|
2017-04-29 16:44:36 +00:00
|
|
|
Each endpoint is individually addressed and the addresses are static.
|
1999-02-21 16:56:33 +00:00
|
|
|
Each of these endpoints will communicate in one of four different modes:
|
2002-03-18 14:35:22 +00:00
|
|
|
.Em control , isochronous , bulk ,
|
|
|
|
or
|
|
|
|
.Em interrupt .
|
1999-02-21 16:56:33 +00:00
|
|
|
A device always has at least one endpoint.
|
2017-04-29 16:44:36 +00:00
|
|
|
This endpoint has address 0 and is a control endpoint and is used to give
|
|
|
|
commands to and extract basic data, such as descriptors, from the device.
|
1999-02-21 16:56:33 +00:00
|
|
|
Each endpoint, except the control endpoint, is unidirectional.
|
|
|
|
.Pp
|
|
|
|
The endpoints in a device are grouped into interfaces.
|
2017-04-29 16:44:36 +00:00
|
|
|
An interface is a logical unit within a device, e.g., a compound device with
|
|
|
|
both a keyboard and a trackball, would present one interface for each.
|
|
|
|
An interface can sometimes be set into different modes, called alternate
|
|
|
|
settings, which affects how it operates.
|
|
|
|
Different alternate settings can have different endpoints within it.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
|
|
|
A device may operate in different configurations.
|
2017-04-29 16:44:36 +00:00
|
|
|
Depending on the configuration, the device may present different sets of
|
|
|
|
endpoints and interfaces.
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
|
|
|
The bus enumeration of the
|
|
|
|
.Tn USB
|
|
|
|
bus proceeds in several steps:
|
|
|
|
.Bl -enum
|
|
|
|
.It
|
2009-05-21 17:26:20 +00:00
|
|
|
Any interface specific driver can attach to the device.
|
1999-02-21 16:56:33 +00:00
|
|
|
.It
|
2009-05-21 17:26:20 +00:00
|
|
|
If none is found, generic interface class drivers can attach.
|
1999-02-21 16:56:33 +00:00
|
|
|
.El
|
2018-04-24 17:46:33 +00:00
|
|
|
.Sh SYSCTL VARIABLES
|
|
|
|
The following variables are available as both
|
|
|
|
.Xr sysctl 8
|
|
|
|
variables and
|
|
|
|
.Xr loader 8
|
|
|
|
tunables:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Va hw.usb.debug
|
2017-08-04 08:56:31 +00:00
|
|
|
Debug output level, where 0 is debugging disabled and larger values increase
|
|
|
|
debug message verbosity.
|
|
|
|
Default is 0.
|
2019-02-23 09:34:57 +00:00
|
|
|
.El
|
1999-02-21 16:56:33 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
The
|
|
|
|
.Tn USB
|
2002-01-28 00:48:28 +00:00
|
|
|
specifications can be found at:
|
2002-03-18 14:35:22 +00:00
|
|
|
.Pp
|
2003-05-24 18:28:18 +00:00
|
|
|
.D1 Pa http://www.usb.org/developers/docs/
|
1999-02-21 16:56:33 +00:00
|
|
|
.Pp
|
2009-05-21 17:26:20 +00:00
|
|
|
.Xr libusb 3 ,
|
2002-01-28 00:48:28 +00:00
|
|
|
.Xr aue 4 ,
|
2007-07-24 14:51:21 +00:00
|
|
|
.Xr axe 4 ,
|
2013-11-26 07:52:40 +00:00
|
|
|
.Xr axge 4 ,
|
2002-01-28 00:48:28 +00:00
|
|
|
.Xr cue 4 ,
|
2005-04-20 07:33:09 +00:00
|
|
|
.Xr ehci 4 ,
|
2002-01-28 00:48:28 +00:00
|
|
|
.Xr kue 4 ,
|
2012-02-28 15:47:39 +00:00
|
|
|
.Xr mos 4 ,
|
1999-02-21 16:56:33 +00:00
|
|
|
.Xr ohci 4 ,
|
2001-07-06 16:46:48 +00:00
|
|
|
.Xr pci 4 ,
|
2007-07-24 14:51:21 +00:00
|
|
|
.Xr rue 4 ,
|
2002-12-09 00:22:14 +00:00
|
|
|
.Xr ucom 4 ,
|
2007-07-24 14:51:21 +00:00
|
|
|
.Xr udav 4 ,
|
1999-08-15 10:48:36 +00:00
|
|
|
.Xr uhci 4 ,
|
1999-02-21 16:56:33 +00:00
|
|
|
.Xr uhid 4 ,
|
|
|
|
.Xr ukbd 4 ,
|
2002-12-19 19:00:51 +00:00
|
|
|
.Xr ulpt 4 ,
|
2002-01-28 00:48:28 +00:00
|
|
|
.Xr umass 4 ,
|
1999-02-21 16:56:33 +00:00
|
|
|
.Xr ums 4 ,
|
2003-02-15 19:17:30 +00:00
|
|
|
.Xr uplcom 4 ,
|
2002-01-28 00:48:28 +00:00
|
|
|
.Xr urio 4 ,
|
2003-02-15 19:17:30 +00:00
|
|
|
.Xr uvscom 4 ,
|
2011-02-24 18:08:23 +00:00
|
|
|
.Xr xhci 4
|
2017-04-29 16:44:36 +00:00
|
|
|
.Xr usbconfig 8 ,
|
2019-02-23 09:34:57 +00:00
|
|
|
.Xr usbdi 9
|
2009-05-21 17:26:20 +00:00
|
|
|
.Sh STANDARDS
|
1999-02-21 16:56:33 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2009-05-21 17:26:20 +00:00
|
|
|
module complies with the USB 2.0 standard.
|
|
|
|
.Sh HISTORY
|
1999-02-21 16:56:33 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2014-06-26 21:46:14 +00:00
|
|
|
module has been inspired by the
|
|
|
|
.Nx
|
|
|
|
USB stack initially written by
|
|
|
|
.An Lennart Augustsson .
|
|
|
|
The
|
2009-05-21 17:26:20 +00:00
|
|
|
.Nm
|
|
|
|
module was written by
|
2014-06-26 21:46:14 +00:00
|
|
|
.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .
|