'\" t .\" Title: struct usb_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Host-Side Data Types and Macros .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "STRUCT USB_DEVICE" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "Host-Side Data Types and Macro" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" struct_usb_device \- kernel\*(Aqs representation of a USB device .SH "SYNOPSIS" .sp .nf struct usb_device { int devnum; char devpath[16]; u32 route; enum usb_device_state state; enum usb_device_speed speed; struct usb_tt * tt; int ttport; unsigned int toggle[2]; struct usb_device * parent; struct usb_bus * bus; struct usb_host_endpoint ep0; struct device dev; struct usb_device_descriptor descriptor; struct usb_host_bos * bos; struct usb_host_config * config; struct usb_host_config * actconfig; struct usb_host_endpoint * ep_in[16]; struct usb_host_endpoint * ep_out[16]; char ** rawdescriptors; unsigned short bus_mA; u8 portnum; u8 level; unsigned can_submit:1; unsigned persist_enabled:1; unsigned have_langid:1; unsigned authorized:1; unsigned authenticated:1; unsigned wusb:1; unsigned lpm_capable:1; unsigned usb2_hw_lpm_capable:1; unsigned usb2_hw_lpm_besl_capable:1; unsigned usb2_hw_lpm_enabled:1; unsigned usb2_hw_lpm_allowed:1; unsigned usb3_lpm_enabled:1; int string_langid; char * product; char * manufacturer; char * serial; struct list_head filelist; int maxchild; u32 quirks; atomic_t urbnum; unsigned long active_duration; #ifdef CONFIG_PM unsigned long connect_time; unsigned do_remote_wakeup:1; unsigned reset_resume:1; unsigned port_is_suspended:1; #endif struct wusb_dev * wusb_dev; int slot_id; enum usb_device_removable removable; struct usb2_lpm_parameters l1_params; struct usb3_lpm_parameters u1_params; struct usb3_lpm_parameters u2_params; unsigned lpm_disable_count; }; .fi .SH "MEMBERS" .PP devnum .RS 4 device number; address on a USB bus .RE .PP devpath[16] .RS 4 device ID string for use in messages (e\&.g\&., /port/\&.\&.\&.) .RE .PP route .RS 4 tree topology hex string for use with xHCI .RE .PP state .RS 4 device state: configured, not attached, etc\&. .RE .PP speed .RS 4 device speed: high/full/low (or error) .RE .PP tt .RS 4 Transaction Translator info; used with low/full speed dev, highspeed hub .RE .PP ttport .RS 4 device port on that tt hub .RE .PP toggle[2] .RS 4 one bit for each endpoint, with ([0] = IN, [1] = OUT) endpoints .RE .PP parent .RS 4 our hub, unless we\*(Aqre the root .RE .PP bus .RS 4 bus we\*(Aqre part of .RE .PP ep0 .RS 4 endpoint 0 data (default control pipe) .RE .PP dev .RS 4 generic device interface .RE .PP descriptor .RS 4 USB device descriptor .RE .PP bos .RS 4 USB device BOS descriptor set .RE .PP config .RS 4 all of the device\*(Aqs configs .RE .PP actconfig .RS 4 the active configuration .RE .PP ep_in[16] .RS 4 array of IN endpoints .RE .PP ep_out[16] .RS 4 array of OUT endpoints .RE .PP rawdescriptors .RS 4 raw descriptors for each config .RE .PP bus_mA .RS 4 Current available from the bus .RE .PP portnum .RS 4 parent port number (origin 1) .RE .PP level .RS 4 number of USB hub ancestors .RE .PP can_submit .RS 4 URBs may be submitted .RE .PP persist_enabled .RS 4 USB_PERSIST enabled for this device .RE .PP have_langid .RS 4 whether string_langid is valid .RE .PP authorized .RS 4 policy has said we can use it; (user space) policy determines if we authorize this device to be used or not\&. By default, wired USB devices are authorized\&. WUSB devices are not, until we authorize them from user space\&. FIXME \-\- complete doc .RE .PP authenticated .RS 4 Crypto authentication passed .RE .PP wusb .RS 4 device is Wireless USB .RE .PP lpm_capable .RS 4 device supports LPM .RE .PP usb2_hw_lpm_capable .RS 4 device can perform USB2 hardware LPM .RE .PP usb2_hw_lpm_besl_capable .RS 4 device can perform USB2 hardware BESL LPM .RE .PP usb2_hw_lpm_enabled .RS 4 USB2 hardware LPM is enabled .RE .PP usb2_hw_lpm_allowed .RS 4 Userspace allows USB 2\&.0 LPM to be enabled .RE .PP usb3_lpm_enabled .RS 4 USB3 hardware LPM enabled .RE .PP string_langid .RS 4 language ID for strings .RE .PP product .RS 4 iProduct string, if present (static) .RE .PP manufacturer .RS 4 iManufacturer string, if present (static) .RE .PP serial .RS 4 iSerialNumber string, if present (static) .RE .PP filelist .RS 4 usbfs files that are open to this device .RE .PP maxchild .RS 4 number of ports if hub .RE .PP quirks .RS 4 quirks of the whole device .RE .PP urbnum .RS 4 number of URBs submitted for the whole device .RE .PP active_duration .RS 4 total time device is not suspended .RE .PP connect_time .RS 4 time device was first connected .RE .PP do_remote_wakeup .RS 4 remote wakeup should be enabled .RE .PP reset_resume .RS 4 needs reset instead of resume .RE .PP port_is_suspended .RS 4 the upstream port is suspended (L2 or U3) .RE .PP wusb_dev .RS 4 if this is a Wireless USB device, link to the WUSB specific data for the device\&. .RE .PP slot_id .RS 4 Slot ID assigned by xHCI .RE .PP removable .RS 4 Device can be physically removed from this port .RE .PP l1_params .RS 4 best effor service latency for USB2 L1 LPM state, and L1 timeout\&. .RE .PP u1_params .RS 4 exit latencies for USB3 U1 LPM state, and hub\-initiated timeout\&. .RE .PP u2_params .RS 4 exit latencies for USB3 U2 LPM state, and hub\-initiated timeout\&. .RE .PP lpm_disable_count .RS 4 Ref count used by \fBusb_disable_lpm\fR and \fBusb_enable_lpm\fR to keep track of the number of functions that require USB 3\&.0 Link Power Management to be disabled for this usb_device\&. This count should only be manipulated by those functions, with the bandwidth_mutex is held\&. .RE .SH "NOTES" .PP Usbcore drivers should not set usbdev\->state directly\&. Instead use \fBusb_set_device_state\fR\&. .SH "COPYRIGHT" .br