usb.4 (110954) | usb.4 (115284) |
---|---|
1.\" Copyright (c) 1997, 1998 2.\" Nick Hibma <n_hibma@FreeBSD.org>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 11 unchanged lines hidden (view full) --- 20.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 26.\" THE POSSIBILITY OF SUCH DAMAGE. 27.\" | 1.\" Copyright (c) 1997, 1998 2.\" Nick Hibma <n_hibma@FreeBSD.org>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 11 unchanged lines hidden (view full) --- 20.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 26.\" THE POSSIBILITY OF SUCH DAMAGE. 27.\" |
28.\" $FreeBSD: head/share/man/man4/usb.4 110954 2003-02-15 19:17:30Z trhodes $ | 28.\" $FreeBSD: head/share/man/man4/usb.4 115284 2003-05-24 18:28:18Z hmp $ |
29.\" 30.Dd February 21, 1999 31.Dt USB 4 32.Os 33.Sh NAME 34.Nm usb 35.Nd Universal Serial Bus 36.Sh SYNOPSIS --- 136 unchanged lines hidden (view full) --- 173This command will cause a complete bus discovery to be initiated. 174If any devices attached or detached from the bus they will be 175processed during this command. 176This is the only way that new devices are found on the bus. 177.It Dv USB_DEVICEINFO Vt "struct usb_device_info" 178This command can be used to retrieve some information about a device 179on the bus. 180The | 29.\" 30.Dd February 21, 1999 31.Dt USB 4 32.Os 33.Sh NAME 34.Nm usb 35.Nd Universal Serial Bus 36.Sh SYNOPSIS --- 136 unchanged lines hidden (view full) --- 173This command will cause a complete bus discovery to be initiated. 174If any devices attached or detached from the bus they will be 175processed during this command. 176This is the only way that new devices are found on the bus. 177.It Dv USB_DEVICEINFO Vt "struct usb_device_info" 178This command can be used to retrieve some information about a device 179on the bus. 180The |
181.Va addr | 181.Va udi_addr |
182field should be filled before the call and the other fields will 183be filled by information about the device on that address. 184Should no such device exist, an error is reported. 185.Bd -literal | 182field should be filled before the call and the other fields will 183be filled by information about the device on that address. 184Should no such device exist, an error is reported. 185.Bd -literal |
186#define USB_MAX_DEVNAMES 4 187#define USB_MAX_DEVNAMELEN 16 |
|
186struct usb_device_info { | 188struct usb_device_info { |
187 u_int8_t bus; 188 u_int8_t addr; 189 usb_event_cookie_t cookie; 190 char product[USB_MAX_STRING_LEN]; 191 char vendor[USB_MAX_STRING_LEN]; 192 char release[8]; 193 u_int16_t productNo; 194 u_int16_t vendorNo; 195 u_int16_t releaseNo; 196 u_int8_t class; 197 u_int8_t subclass; 198 u_int8_t protocol; 199 u_int8_t config; 200 u_int8_t lowspeed; 201 int power; 202 int nports; 203 char devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN]; 204 u_int8_t ports[16]; 205#define USB_PORT_ENABLED 0xff 206#define USB_PORT_SUSPENDED 0xfe 207#define USB_PORT_POWERED 0xfd 208#define USB_PORT_DISABLED 0xfc | 189 u_int8_t udi_bus; 190 u_int8_t udi_addr; /* device address */ 191 usb_event_cookie_t udi_cookie; 192 char udi_product[USB_MAX_STRING_LEN]; 193 char udi_vendor[USB_MAX_STRING_LEN]; 194 char udi_release[8]; 195 u_int16_t udi_productNo; 196 u_int16_t udi_vendorNo; 197 u_int16_t udi_releaseNo; 198 u_int8_t udi_class; 199 u_int8_t udi_subclass; 200 u_int8_t udi_protocol; 201 u_int8_t udi_config; 202 u_int8_t udi_speed; 203#define USB_SPEED_LOW 1 204#define USB_SPEED_FULL 2 205#define USB_SPEED_HIGH 3 206 int udi_power;/* power consumption in mA, 0 if selfpowered */ 207 int udi_nports; 208 char udi_devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN]; 209 u_int8_t udi_ports[16];/* hub only: addresses of devices on ports */ 210#define USB_PORT_ENABLED 0xff 211#define USB_PORT_SUSPENDED 0xfe 212#define USB_PORT_POWERED 0xfd 213#define USB_PORT_DISABLED 0xfc |
209}; 210.Ed 211.Pp | 214}; 215.Ed 216.Pp |
212.Va bus | 217.Va udi_bus |
213and | 218and |
214.Va addr | 219.Va udi_addr |
215contain the topological information for the device. | 220contain the topological information for the device. |
216.Va devnames | 221.Va udi_devnames |
217contains the device names of the connected drivers. 218For example, the 219third 220.Tn USB 221Zip drive connected will be 222.Li umass2 . 223The | 222contains the device names of the connected drivers. 223For example, the 224third 225.Tn USB 226Zip drive connected will be 227.Li umass2 . 228The |
224.Va product , vendor | 229.Va udi_product , udi_vendor |
225and | 230and |
226.Va release | 231.Va udi_release |
227fields contain self-explanatory descriptions of the device. | 232fields contain self-explanatory descriptions of the device. |
228.Va productNo , vendorNo , releaseNo , class , subclass | 233.Va udi_productNo , udi_vendorNo , udi_releaseNo , udi_class , udi_subclass |
229and | 234and |
230.Va protocol | 235.Va udi_protocol |
231contain the corresponding values from the device descriptors. 232The | 236contain the corresponding values from the device descriptors. 237The |
233.Va config | 238.Va udi_config |
234field shows the current configuration of the device. 235.Pp | 239field shows the current configuration of the device. 240.Pp |
236.Va lowspeed 237indicates whether the device is a full speed (0) or low speed (1) 238device. | 241.Va udi_peed 242indicates whether the device is at low speed 243.Pq Dv USB_SPEED_LOW , 244full speed 245.Pq Dv USB_SPEED_FULL 246or high speed 247.Pq Dv USB_SPEED_HIGH . |
239The | 248The |
240.Va power | 249.Va udi_power |
241field shows the power consumption in milli-amps drawn at 5 volts, 242or zero if the device is self powered. 243.Pp 244If the device is a hub, the | 250field shows the power consumption in milli-amps drawn at 5 volts, 251or zero if the device is self powered. 252.Pp 253If the device is a hub, the |
245.Va nports | 254.Va udi_nports |
246field is non-zero, and the | 255field is non-zero, and the |
247.Va ports | 256.Va udi_ports |
248field contains the addresses of the connected devices. 249If no device is connected to a port, one of the 250.Dv USB_PORT_* 251values indicates its status. 252.It Dv USB_DEVICESTATS Vt "struct usb_device_stats" 253This command retrieves statistics about the controller. 254.Bd -literal 255struct usb_device_stats { | 257field contains the addresses of the connected devices. 258If no device is connected to a port, one of the 259.Dv USB_PORT_* 260values indicates its status. 261.It Dv USB_DEVICESTATS Vt "struct usb_device_stats" 262This command retrieves statistics about the controller. 263.Bd -literal 264struct usb_device_stats { |
256 u_long requests[4]; | 265 u_long uds_requests[4]; |
257}; 258.Ed 259.Pp 260The | 266}; 267.Ed 268.Pp 269The |
261.Va requests | 270.Va udi_requests |
262field is indexed by the transfer kind, i.e.\& 263.Dv UE_* , 264and indicates how many transfers of each kind that has been completed 265by the controller. 266.It Dv USB_REQUEST Vt "struct usb_ctl_request" 267This command can be used to execute arbitrary requests on the control pipe. 268This is 269.Em DANGEROUS --- 62 unchanged lines hidden (view full) --- 332.Ed 333The 334.Va ue_type 335field identifies the type of event that is described. 336The possible events are attach/detach of a host controller, 337a device, or a device driver. 338The union contains information 339pertinent to the different types of events. | 271field is indexed by the transfer kind, i.e.\& 272.Dv UE_* , 273and indicates how many transfers of each kind that has been completed 274by the controller. 275.It Dv USB_REQUEST Vt "struct usb_ctl_request" 276This command can be used to execute arbitrary requests on the control pipe. 277This is 278.Em DANGEROUS --- 62 unchanged lines hidden (view full) --- 341.Ed 342The 343.Va ue_type 344field identifies the type of event that is described. 345The possible events are attach/detach of a host controller, 346a device, or a device driver. 347The union contains information 348pertinent to the different types of events. |
349Macros, 350.Fn USB_EVENT_IS_ATTACH "ue_type" 351and 352.Fn USB_EVENT_IS_DETACH "ue_type" 353can be used to determine if an event was an 354.Dq attach 355or a 356.Dq detach 357request. |
|
340.Pp 341The 342.Va ue_bus 343contains the number of the 344.Tn USB 345bus for host controller events. 346.Pp 347The --- 20 unchanged lines hidden (view full) --- 368.Tn USB 369device may 370have zero, one, or many device drivers associated with it. 371.Sh SEE ALSO 372The 373.Tn USB 374specifications can be found at: 375.Pp | 358.Pp 359The 360.Va ue_bus 361contains the number of the 362.Tn USB 363bus for host controller events. 364.Pp 365The --- 20 unchanged lines hidden (view full) --- 386.Tn USB 387device may 388have zero, one, or many device drivers associated with it. 389.Sh SEE ALSO 390The 391.Tn USB 392specifications can be found at: 393.Pp |
376.D1 Pa http://www.usb.org/developers/docs.html | 394.D1 Pa http://www.usb.org/developers/docs/ |
377.Pp 378.Xr aue 4 , 379.Xr cue 4 , 380.Xr kue 4 , 381.Xr ohci 4 , 382.Xr pci 4 , 383.Xr ucom 4 , 384.Xr ugen 4 , --- 25 unchanged lines hidden --- | 395.Pp 396.Xr aue 4 , 397.Xr cue 4 , 398.Xr kue 4 , 399.Xr ohci 4 , 400.Xr pci 4 , 401.Xr ucom 4 , 402.Xr ugen 4 , --- 25 unchanged lines hidden --- |