1b2c1f437SNick Hibma.\" Copyright (c) 1997, 1998 2eddc45e7SJeroen Ruigrok van der Werven.\" Nick Hibma <n_hibma@FreeBSD.org>. All rights reserved. 3b2c1f437SNick Hibma.\" 4b2c1f437SNick Hibma.\" Redistribution and use in source and binary forms, with or without 5b2c1f437SNick Hibma.\" modification, are permitted provided that the following conditions 6b2c1f437SNick Hibma.\" are met: 7b2c1f437SNick Hibma.\" 1. Redistributions of source code must retain the above copyright 8b2c1f437SNick Hibma.\" notice, this list of conditions and the following disclaimer. 9b2c1f437SNick Hibma.\" 2. Redistributions in binary form must reproduce the above copyright 10b2c1f437SNick Hibma.\" notice, this list of conditions and the following disclaimer in the 11b2c1f437SNick Hibma.\" documentation and/or other materials provided with the distribution. 1217b1e1dfSThomas Quinot.\" 3. Neither the name of the author nor the names of any co-contributors 13b2c1f437SNick Hibma.\" may be used to endorse or promote products derived from this software 14b2c1f437SNick Hibma.\" without specific prior written permission. 15b2c1f437SNick Hibma.\" 16b2c1f437SNick Hibma.\" THIS SOFTWARE IS PROVIDED BY NICK HIBMA AND CONTRIBUTORS ``AS IS'' AND 17b2c1f437SNick Hibma.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18b2c1f437SNick Hibma.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19b2c1f437SNick Hibma.\" ARE DISCLAIMED. IN NO EVENT SHALL NICK HIBMA OR THE VOICES IN HIS HEAD 20b2c1f437SNick Hibma.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21b2c1f437SNick Hibma.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22b2c1f437SNick Hibma.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23b2c1f437SNick Hibma.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24b2c1f437SNick Hibma.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25b2c1f437SNick Hibma.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 26b2c1f437SNick Hibma.\" THE POSSIBILITY OF SUCH DAMAGE. 27b2c1f437SNick Hibma.\" 287f3dea24SPeter Wemm.\" $FreeBSD$ 29b2c1f437SNick Hibma.\" 30ad787bb4SSimon L. B. Nielsen.Dd April 20, 2005 31474fc32bSAlexey Zelkin.Dt USB 4 323d45e180SRuslan Ermilov.Os 33b2c1f437SNick Hibma.Sh NAME 34b2c1f437SNick Hibma.Nm usb 35b2c1f437SNick Hibma.Nd Universal Serial Bus 36b2c1f437SNick Hibma.Sh SYNOPSIS 37b9781e20SJeroen Ruigrok van der Werven.Cd "device usb" 38a31999caSJosef Karthauser.Pp 3990305461SRuslan Ermilov.In dev/usb/usb.h 4090305461SRuslan Ermilov.In dev/usb/usbhid.h 41b2c1f437SNick Hibma.Sh DESCRIPTION 42d4be94a1SChris Costello.Fx 43b2c1f437SNick Hibmaprovides machine-independent bus support and drivers for 44b2c1f437SNick Hibma.Tn USB 45b2c1f437SNick Hibmadevices. 46b2c1f437SNick Hibma.Pp 47b2c1f437SNick HibmaThe 48b2c1f437SNick Hibma.Nm 49b2c1f437SNick Hibmadriver has three layers: the controller, the bus, and the 506d249eeeSSheldon Hearndevice layer. 516d249eeeSSheldon HearnThe controller attaches to a physical bus 52b2c1f437SNick Hibma(like 53b2c1f437SNick Hibma.Xr pci 4 ) . 54b2c1f437SNick HibmaThe 55b2c1f437SNick Hibma.Tn USB 5690305461SRuslan Ermilovbus attaches to the controller, and the root hub attaches 57b2c1f437SNick Hibmato the controller. 58b2c1f437SNick HibmaAny devices attached to the bus will attach to the root hub 5990305461SRuslan Ermilovor another hub attached to the 6090305461SRuslan Ermilov.Tn USB 6190305461SRuslan Ermilovbus. 62b2c1f437SNick Hibma.Pp 63b2c1f437SNick HibmaThe 64b2c1f437SNick Hibma.Nm uhub 65b2c1f437SNick Hibmadevice will always be present as it is needed for the 66b2c1f437SNick Hibmaroot hub. 67b2c1f437SNick Hibma.Sh INTRODUCTION TO USB 68b2c1f437SNick HibmaThe 69b2c1f437SNick Hibma.Tn USB 70b2c1f437SNick Hibmais a 12 Mb/s serial bus (1.5 Mb/s for low speed devices). 71b2c1f437SNick HibmaEach 72b2c1f437SNick Hibma.Tn USB 73b2c1f437SNick Hibmahas a host controller that is the master of the bus; 74b2c1f437SNick Hibmaall other devices on the bus only speak when spoken to. 75b2c1f437SNick Hibma.Pp 76b2c1f437SNick HibmaThere can be up to 127 devices (apart from the host controller) 77b2c1f437SNick Hibmaon a bus, each with its own address. 78b2c1f437SNick HibmaThe addresses are assigned 79b2c1f437SNick Hibmadynamically by the host when each device is attached to the bus. 80b2c1f437SNick Hibma.Pp 81b2c1f437SNick HibmaWithin each device there can be up to 16 endpoints. 82b2c1f437SNick HibmaEach endpoint 83b2c1f437SNick Hibmais individually addressed and the addresses are static. 84b2c1f437SNick HibmaEach of these endpoints will communicate in one of four different modes: 8590305461SRuslan Ermilov.Em control , isochronous , bulk , 8690305461SRuslan Ermilovor 8790305461SRuslan Ermilov.Em interrupt . 88b2c1f437SNick HibmaA device always has at least one endpoint. 89b2c1f437SNick HibmaThis endpoint has address 0 and is a control 90b2c1f437SNick Hibmaendpoint and is used to give commands to and extract basic data, 91b2c1f437SNick Hibmasuch as descriptors, from the device. 92b2c1f437SNick HibmaEach endpoint, except the control endpoint, is unidirectional. 93b2c1f437SNick Hibma.Pp 94b2c1f437SNick HibmaThe endpoints in a device are grouped into interfaces. 9557e4378bSRuslan ErmilovAn interface is a logical unit within a device; e.g.\& 96b2c1f437SNick Hibmaa compound device with both a keyboard and a trackball would present 97b2c1f437SNick Hibmaone interface for each. 98b2c1f437SNick HibmaAn interface can sometimes be set into different modes, 99b2c1f437SNick Hibmacalled alternate settings, which affects how it operates. 100b2c1f437SNick HibmaDifferent alternate settings can have different endpoints 101b2c1f437SNick Hibmawithin it. 102b2c1f437SNick Hibma.Pp 103b2c1f437SNick HibmaA device may operate in different configurations. 104b2c1f437SNick HibmaDepending on the 10590305461SRuslan Ermilovconfiguration, the device may present different sets of endpoints 106b2c1f437SNick Hibmaand interfaces. 107d962d52aSRuslan Ermilov.\" .Pp 108d962d52aSRuslan Ermilov.\" Each device located on a hub has several 109d962d52aSRuslan Ermilov.\" .Xr config 8 110d962d52aSRuslan Ermilov.\" locators: 111d962d52aSRuslan Ermilov.\" .Bl -tag -compact -width xxxxxx 112d962d52aSRuslan Ermilov.\" .It Cd port 113d962d52aSRuslan Ermilov.\" this is the number of the port on the closest upstream hub. 114d962d52aSRuslan Ermilov.\" .It Cd configuration 115d962d52aSRuslan Ermilov.\" this is the configuration the device must be in for this driver to attach. 116d962d52aSRuslan Ermilov.\" This locator does not set the configuration; it is iterated by the bus 117d962d52aSRuslan Ermilov.\" enumeration. 118d962d52aSRuslan Ermilov.\" .It Cd interface 119d962d52aSRuslan Ermilov.\" this is the interface number within a device that an interface driver 120d962d52aSRuslan Ermilov.\" attaches to. 121d962d52aSRuslan Ermilov.\" .It Cd vendor 122d962d52aSRuslan Ermilov.\" this is the 16 bit vendor id of the device. 123d962d52aSRuslan Ermilov.\" .It Cd product 124d962d52aSRuslan Ermilov.\" this is the 16 bit product id of the device. 125d962d52aSRuslan Ermilov.\" .It Cd release 126d962d52aSRuslan Ermilov.\" this is the 16 bit release (revision) number of the device. 127d962d52aSRuslan Ermilov.\" .El 128d962d52aSRuslan Ermilov.\" The first locator can be used to pin down a particular device 129d962d52aSRuslan Ermilov.\" according to its physical position in the device tree. 130d962d52aSRuslan Ermilov.\" The last three locators can be used to pin down a particular 131d962d52aSRuslan Ermilov.\" device according to what device it actually is. 132b2c1f437SNick Hibma.Pp 133b2c1f437SNick HibmaThe bus enumeration of the 134b2c1f437SNick Hibma.Tn USB 135b2c1f437SNick Hibmabus proceeds in several steps: 136b2c1f437SNick Hibma.Bl -enum 137b2c1f437SNick Hibma.It 13890305461SRuslan ErmilovAny device specific driver can attach to the device. 139b2c1f437SNick Hibma.It 140b2c1f437SNick HibmaIf none is found, any device class specific driver can attach. 141b2c1f437SNick Hibma.It 142b2c1f437SNick HibmaIf none is found, all configurations are iterated over. 14390305461SRuslan ErmilovFor each configuration, all the interfaces are iterated over, and interface 144b2c1f437SNick Hibmadrivers can attach. 145b2c1f437SNick HibmaIf any interface driver attached in a certain 14690305461SRuslan Ermilovconfiguration, the iteration over configurations is stopped. 147b2c1f437SNick Hibma.It 148b2c1f437SNick HibmaIf still no drivers have been found, the generic 149b2c1f437SNick Hibma.Tn USB 150b2c1f437SNick Hibmadriver can attach. 151b2c1f437SNick Hibma.El 152b2c1f437SNick Hibma.Sh USB CONTROLLER INTERFACE 153b2c1f437SNick HibmaUse the following to get access to the 154b2c1f437SNick Hibma.Tn USB 155f87717faSMike Pritchardspecific structures and defines. 15690305461SRuslan Ermilov.Pp 157b2c1f437SNick HibmaThe 15890305461SRuslan Ermilov.Pa /dev/usb Ns Ar N 159b2c1f437SNick Hibmacan be opened and a few operations can be performed on it. 160b2c1f437SNick HibmaThe 161b2c1f437SNick Hibma.Xr poll 2 162b2c1f437SNick Hibmasystem call will say that I/O is possible on the controller device when a 163b2c1f437SNick Hibma.Tn USB 164b2c1f437SNick Hibmadevice has been connected or disconnected to the bus. 165b2c1f437SNick Hibma.Pp 166b2c1f437SNick HibmaThe following 167b2c1f437SNick Hibma.Xr ioctl 2 168b2c1f437SNick Hibmacommands are supported on the controller device: 169b2c1f437SNick Hibma.Bl -tag -width xxxxxx 170b2c1f437SNick Hibma.It Dv USB_DISCOVER 171b2c1f437SNick HibmaThis command will cause a complete bus discovery to be initiated. 172b2c1f437SNick HibmaIf any devices attached or detached from the bus they will be 173b2c1f437SNick Hibmaprocessed during this command. 174b2c1f437SNick HibmaThis is the only way that new devices are found on the bus. 17590305461SRuslan Ermilov.It Dv USB_DEVICEINFO Vt "struct usb_device_info" 176b2c1f437SNick HibmaThis command can be used to retrieve some information about a device 177b2c1f437SNick Hibmaon the bus. 178b2c1f437SNick HibmaThe 179b8a83c23SHiten Pandya.Va udi_addr 180b2c1f437SNick Hibmafield should be filled before the call and the other fields will 181b2c1f437SNick Hibmabe filled by information about the device on that address. 18290305461SRuslan ErmilovShould no such device exist, an error is reported. 183b2c1f437SNick Hibma.Bd -literal 184b8a83c23SHiten Pandya#define USB_MAX_DEVNAMES 4 185b8a83c23SHiten Pandya#define USB_MAX_DEVNAMELEN 16 186b2c1f437SNick Hibmastruct usb_device_info { 187b8a83c23SHiten Pandya u_int8_t udi_bus; 188b8a83c23SHiten Pandya u_int8_t udi_addr; /* device address */ 189b8a83c23SHiten Pandya usb_event_cookie_t udi_cookie; 190b8a83c23SHiten Pandya char udi_product[USB_MAX_STRING_LEN]; 191b8a83c23SHiten Pandya char udi_vendor[USB_MAX_STRING_LEN]; 192b8a83c23SHiten Pandya char udi_release[8]; 193b8a83c23SHiten Pandya u_int16_t udi_productNo; 194b8a83c23SHiten Pandya u_int16_t udi_vendorNo; 195b8a83c23SHiten Pandya u_int16_t udi_releaseNo; 196b8a83c23SHiten Pandya u_int8_t udi_class; 197b8a83c23SHiten Pandya u_int8_t udi_subclass; 198b8a83c23SHiten Pandya u_int8_t udi_protocol; 199b8a83c23SHiten Pandya u_int8_t udi_config; 200b8a83c23SHiten Pandya u_int8_t udi_speed; 201b8a83c23SHiten Pandya#define USB_SPEED_LOW 1 202b8a83c23SHiten Pandya#define USB_SPEED_FULL 2 203b8a83c23SHiten Pandya#define USB_SPEED_HIGH 3 204b8a83c23SHiten Pandya int udi_power;/* power consumption in mA, 0 if selfpowered */ 205b8a83c23SHiten Pandya int udi_nports; 206b8a83c23SHiten Pandya char udi_devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN]; 207b8a83c23SHiten Pandya u_int8_t udi_ports[16];/* hub only: addresses of devices on ports */ 208b2c1f437SNick Hibma#define USB_PORT_ENABLED 0xff 209b2c1f437SNick Hibma#define USB_PORT_SUSPENDED 0xfe 210b2c1f437SNick Hibma#define USB_PORT_POWERED 0xfd 211b2c1f437SNick Hibma#define USB_PORT_DISABLED 0xfc 212b2c1f437SNick Hibma}; 213b2c1f437SNick Hibma.Ed 214b2c1f437SNick Hibma.Pp 215b8a83c23SHiten Pandya.Va udi_bus 216b2c1f437SNick Hibmaand 217b8a83c23SHiten Pandya.Va udi_addr 2184239682eSNick Hibmacontain the topological information for the device. 219b8a83c23SHiten Pandya.Va udi_devnames 2206d249eeeSSheldon Hearncontains the device names of the connected drivers. 22190305461SRuslan ErmilovFor example, the 22290305461SRuslan Ermilovthird 22390305461SRuslan Ermilov.Tn USB 22490305461SRuslan ErmilovZip drive connected will be 2254239682eSNick Hibma.Li umass2 . 226b2c1f437SNick HibmaThe 227b8a83c23SHiten Pandya.Va udi_product , udi_vendor 2284239682eSNick Hibmaand 229b8a83c23SHiten Pandya.Va udi_release 2304239682eSNick Hibmafields contain self-explanatory descriptions of the device. 231b8a83c23SHiten Pandya.Va udi_productNo , udi_vendorNo , udi_releaseNo , udi_class , udi_subclass 2324239682eSNick Hibmaand 233b8a83c23SHiten Pandya.Va udi_protocol 2344239682eSNick Hibmacontain the corresponding values from the device descriptors. 235b2c1f437SNick HibmaThe 236b8a83c23SHiten Pandya.Va udi_config 237b2c1f437SNick Hibmafield shows the current configuration of the device. 238b2c1f437SNick Hibma.Pp 239238b367cSMarkus Brueffer.Va udi_speed 240b8a83c23SHiten Pandyaindicates whether the device is at low speed 241b8a83c23SHiten Pandya.Pq Dv USB_SPEED_LOW , 242b8a83c23SHiten Pandyafull speed 243b8a83c23SHiten Pandya.Pq Dv USB_SPEED_FULL 244b8a83c23SHiten Pandyaor high speed 245b8a83c23SHiten Pandya.Pq Dv USB_SPEED_HIGH . 2466d249eeeSSheldon HearnThe 247b8a83c23SHiten Pandya.Va udi_power 248b2c1f437SNick Hibmafield shows the power consumption in milli-amps drawn at 5 volts, 249b2c1f437SNick Hibmaor zero if the device is self powered. 250b2c1f437SNick Hibma.Pp 25190305461SRuslan ErmilovIf the device is a hub, the 252b8a83c23SHiten Pandya.Va udi_nports 25390305461SRuslan Ermilovfield is non-zero, and the 254b8a83c23SHiten Pandya.Va udi_ports 255b2c1f437SNick Hibmafield contains the addresses of the connected devices. 25690305461SRuslan ErmilovIf no device is connected to a port, one of the 25790305461SRuslan Ermilov.Dv USB_PORT_* 258b2c1f437SNick Hibmavalues indicates its status. 25990305461SRuslan Ermilov.It Dv USB_DEVICESTATS Vt "struct usb_device_stats" 260b2c1f437SNick HibmaThis command retrieves statistics about the controller. 261b2c1f437SNick Hibma.Bd -literal 262b2c1f437SNick Hibmastruct usb_device_stats { 263b8a83c23SHiten Pandya u_long uds_requests[4]; 264b2c1f437SNick Hibma}; 265b2c1f437SNick Hibma.Ed 266b2c1f437SNick Hibma.Pp 267b2c1f437SNick HibmaThe 268b8a83c23SHiten Pandya.Va udi_requests 26957e4378bSRuslan Ermilovfield is indexed by the transfer kind, i.e.\& 27090305461SRuslan Ermilov.Dv UE_* , 271b2c1f437SNick Hibmaand indicates how many transfers of each kind that has been completed 272b2c1f437SNick Hibmaby the controller. 27390305461SRuslan Ermilov.It Dv USB_REQUEST Vt "struct usb_ctl_request" 274b2c1f437SNick HibmaThis command can be used to execute arbitrary requests on the control pipe. 275b2c1f437SNick HibmaThis is 276b2c1f437SNick Hibma.Em DANGEROUS 277b2c1f437SNick Hibmaand should be used with great care since it 278b2c1f437SNick Hibmacan destroy the bus integrity. 279b2c1f437SNick Hibma.El 280b2c1f437SNick Hibma.Pp 281b2c1f437SNick HibmaThe include file 282fe08efe6SRuslan Ermilov.In dev/usb/usb.h 283b2c1f437SNick Hibmacontains definitions for the types used by the various 284b2c1f437SNick Hibma.Xr ioctl 2 285b2c1f437SNick Hibmacalls. 286b2c1f437SNick HibmaThe naming convention of the fields for the various 287b2c1f437SNick Hibma.Tn USB 288b2c1f437SNick Hibmadescriptors exactly follows the naming in the 289b2c1f437SNick Hibma.Tn USB 290b2c1f437SNick Hibmaspecification. 291b2c1f437SNick HibmaByte sized fields can be accessed directly, but word (16 bit) 292b2c1f437SNick Hibmasized fields must be access by the 293b2c1f437SNick Hibma.Fn UGETW field 294b2c1f437SNick Hibmaand 295b2c1f437SNick Hibma.Fn USETW field value 296b2c1f437SNick Hibmamacros to handle byte order and alignment properly. 297b2c1f437SNick Hibma.Pp 298b2c1f437SNick HibmaThe include file 299fe08efe6SRuslan Ermilov.In dev/usb/usbhid.h 300b2c1f437SNick Hibmasimilarly contains the definitions for 301b2c1f437SNick HibmaHuman Interface Devices 302b2c1f437SNick Hibma.Pq Tn HID . 303a07e9d4aSJosef Karthauser.Sh USB EVENT INTERFACE 304a07e9d4aSJosef KarthauserAll 305a07e9d4aSJosef Karthauser.Tn USB 306a07e9d4aSJosef Karthauserevents are reported via the 307a07e9d4aSJosef Karthauser.Pa /dev/usb 30890305461SRuslan Ermilovdevice. 30990305461SRuslan ErmilovThis devices can be opened for reading and each 310a07e9d4aSJosef Karthauser.Xr read 2 311a07e9d4aSJosef Karthauserwill yield an event record (if something has happened). 312a07e9d4aSJosef KarthauserThe 313a07e9d4aSJosef Karthauser.Xr poll 2 314a07e9d4aSJosef Karthausersystem call can be used to determine if an event record is available 315a07e9d4aSJosef Karthauserfor reading. 316a07e9d4aSJosef Karthauser.Pp 317a07e9d4aSJosef KarthauserThe event record has the following definition: 318a07e9d4aSJosef Karthauser.Bd -literal 319a07e9d4aSJosef Karthauserstruct usb_event { 320a07e9d4aSJosef Karthauser int ue_type; 321a07e9d4aSJosef Karthauser#define USB_EVENT_CTRLR_ATTACH 1 322a07e9d4aSJosef Karthauser#define USB_EVENT_CTRLR_DETACH 2 323a07e9d4aSJosef Karthauser#define USB_EVENT_DEVICE_ATTACH 3 324a07e9d4aSJosef Karthauser#define USB_EVENT_DEVICE_DETACH 4 325a07e9d4aSJosef Karthauser#define USB_EVENT_DRIVER_ATTACH 5 326a07e9d4aSJosef Karthauser#define USB_EVENT_DRIVER_DETACH 6 327a07e9d4aSJosef Karthauser struct timespec ue_time; 328a07e9d4aSJosef Karthauser union { 329a07e9d4aSJosef Karthauser struct { 330a07e9d4aSJosef Karthauser int ue_bus; 331a07e9d4aSJosef Karthauser } ue_ctrlr; 332a07e9d4aSJosef Karthauser struct usb_device_info ue_device; 333a07e9d4aSJosef Karthauser struct { 334a07e9d4aSJosef Karthauser usb_event_cookie_t ue_cookie; 335a07e9d4aSJosef Karthauser char ue_devname[16]; 336a07e9d4aSJosef Karthauser } ue_driver; 337a07e9d4aSJosef Karthauser } u; 338a07e9d4aSJosef Karthauser}; 339a07e9d4aSJosef Karthauser.Ed 340a07e9d4aSJosef KarthauserThe 341a07e9d4aSJosef Karthauser.Va ue_type 342a07e9d4aSJosef Karthauserfield identifies the type of event that is described. 343a07e9d4aSJosef KarthauserThe possible events are attach/detach of a host controller, 34490305461SRuslan Ermilova device, or a device driver. 34590305461SRuslan ErmilovThe union contains information 346a07e9d4aSJosef Karthauserpertinent to the different types of events. 347b8a83c23SHiten PandyaMacros, 348b8a83c23SHiten Pandya.Fn USB_EVENT_IS_ATTACH "ue_type" 349b8a83c23SHiten Pandyaand 350b8a83c23SHiten Pandya.Fn USB_EVENT_IS_DETACH "ue_type" 351b8a83c23SHiten Pandyacan be used to determine if an event was an 352b8a83c23SHiten Pandya.Dq attach 353b8a83c23SHiten Pandyaor a 354b8a83c23SHiten Pandya.Dq detach 355b8a83c23SHiten Pandyarequest. 35690305461SRuslan Ermilov.Pp 357a07e9d4aSJosef KarthauserThe 358a07e9d4aSJosef Karthauser.Va ue_bus 359a07e9d4aSJosef Karthausercontains the number of the 360a07e9d4aSJosef Karthauser.Tn USB 361a07e9d4aSJosef Karthauserbus for host controller events. 36290305461SRuslan Ermilov.Pp 363a07e9d4aSJosef KarthauserThe 364a07e9d4aSJosef Karthauser.Va ue_device 365a07e9d4aSJosef Karthauserrecord contains information about the device in a device event event. 36690305461SRuslan Ermilov.Pp 367a07e9d4aSJosef KarthauserThe 368a07e9d4aSJosef Karthauser.Va ue_cookie 369959d6c24SRuslan Ermilovis an opaque value that uniquely determines which 370a07e9d4aSJosef Karthauserdevice a device driver has been attached to (i.e., it equals 371a07e9d4aSJosef Karthauserthe cookie value in the device that the driver attached to). 37290305461SRuslan Ermilov.Pp 373a07e9d4aSJosef KarthauserThe 374a07e9d4aSJosef Karthauser.Va ue_devname 375a07e9d4aSJosef Karthausercontains the name of the device (driver) as seen in, e.g., 376a07e9d4aSJosef Karthauserkernel messages. 377a07e9d4aSJosef Karthauser.Pp 37890305461SRuslan ErmilovNote that there is a separation between device and device 37990305461SRuslan Ermilovdriver events. 38090305461SRuslan ErmilovA device event is generated when a physical 38190305461SRuslan Ermilov.Tn USB 38290305461SRuslan Ermilovdevice is attached or detached. 38390305461SRuslan ErmilovA single 38490305461SRuslan Ermilov.Tn USB 38590305461SRuslan Ermilovdevice may 386a07e9d4aSJosef Karthauserhave zero, one, or many device drivers associated with it. 387b2c1f437SNick Hibma.Sh SEE ALSO 388b2c1f437SNick HibmaThe 389b2c1f437SNick Hibma.Tn USB 390a31999caSJosef Karthauserspecifications can be found at: 39190305461SRuslan Ermilov.Pp 392b8a83c23SHiten Pandya.D1 Pa http://www.usb.org/developers/docs/ 393b2c1f437SNick Hibma.Pp 394a31999caSJosef Karthauser.Xr aue 4 , 395a31999caSJosef Karthauser.Xr cue 4 , 396ad787bb4SSimon L. B. Nielsen.Xr ehci 4 , 397a31999caSJosef Karthauser.Xr kue 4 , 398b2c1f437SNick Hibma.Xr ohci 4 , 3995521ff5aSRuslan Ermilov.Xr pci 4 , 40002ea0857SJosef Karthauser.Xr ucom 4 , 401a31999caSJosef Karthauser.Xr ugen 4 , 402def37e7cSMike Pritchard.Xr uhci 4 , 403b2c1f437SNick Hibma.Xr uhid 4 , 404b2c1f437SNick Hibma.Xr ukbd 4 , 4056b9ba891STom Rhodes.Xr ulpt 4 , 406a31999caSJosef Karthauser.Xr umass 4 , 407b2c1f437SNick Hibma.Xr ums 4 , 4088140bbcaSTom Rhodes.Xr uplcom 4 , 409a31999caSJosef Karthauser.Xr urio 4 , 410a31999caSJosef Karthauser.Xr uscanner 4 , 4118140bbcaSTom Rhodes.Xr uvscom 4 , 41290305461SRuslan Ermilov.Xr usbd 8 , 413b2c1f437SNick Hibma.Xr usbdevs 8 414b2c1f437SNick Hibma.Sh HISTORY 415b2c1f437SNick HibmaThe 416b2c1f437SNick Hibma.Nm 417b2c1f437SNick Hibmadriver first appeared in 418b2c1f437SNick Hibma.Fx 3.0 . 419def37e7cSMike Pritchard.Sh AUTHORS 420b2c1f437SNick HibmaThe 421b2c1f437SNick Hibma.Nm 422b2c1f437SNick Hibmadriver was written by 423def37e7cSMike Pritchard.An Lennart Augustsson Aq augustss@carlstedt.se 424def37e7cSMike Pritchardfor the 425b2c1f437SNick Hibma.Nx 426b2c1f437SNick Hibmaproject. 427