'\" t .\" Title: struct usb_host_config .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Host-Side Data Types and Macros .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "STRUCT USB_HOST_CONF" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "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_host_config \- representation of a device\*(Aqs configuration .SH "SYNOPSIS" .sp .nf struct usb_host_config { struct usb_config_descriptor desc; char * string; struct usb_interface_assoc_descriptor * intf_assoc[USB_MAXIADS]; struct usb_interface * interface[USB_MAXINTERFACES]; struct usb_interface_cache * intf_cache[USB_MAXINTERFACES]; unsigned char * extra; int extralen; }; .fi .SH "MEMBERS" .PP desc .RS 4 the device\*(Aqs configuration descriptor\&. .RE .PP string .RS 4 pointer to the cached version of the iConfiguration string, if present for this configuration\&. .RE .PP intf_assoc[USB_MAXIADS] .RS 4 list of any interface association descriptors in this config .RE .PP interface[USB_MAXINTERFACES] .RS 4 array of pointers to usb_interface structures, one for each interface in the configuration\&. The number of interfaces is stored in desc\&.bNumInterfaces\&. These pointers are valid only while the the configuration is active\&. .RE .PP intf_cache[USB_MAXINTERFACES] .RS 4 array of pointers to usb_interface_cache structures, one for each interface in the configuration\&. These structures exist for the entire life of the device\&. .RE .PP extra .RS 4 pointer to buffer containing all extra descriptors associated with this configuration (those preceding the first interface descriptor)\&. .RE .PP extralen .RS 4 length of the extra descriptors buffer\&. .RE .SH "DESCRIPTION" .PP USB devices may have multiple configurations, but only one can be active at any time\&. Each encapsulates a different operational environment; for example, a dual\-speed device would have separate configurations for full\-speed and high\-speed operation\&. The number of configurations available is stored in the device descriptor as bNumConfigurations\&. .PP A configuration can contain multiple interfaces\&. Each corresponds to a different function of the USB device, and all are available whenever the configuration is active\&. The USB standard says that interfaces are supposed to be numbered from 0 to desc\&.bNumInterfaces\-1, but a lot of devices get this wrong\&. In addition, the interface array is not guaranteed to be sorted in numerical order\&. Use \fBusb_ifnum_to_if\fR to look up an interface entry based on its number\&. .PP Device drivers should not attempt to activate configurations\&. The choice of which configuration to install is a policy decision based on such considerations as available power, functionality provided, and the user\*(Aqs desires (expressed through userspace tools)\&. However, drivers can call \fBusb_reset_configuration\fR to reinitialize the current configuration and all its interfaces\&. .SH "COPYRIGHT" .br