'\" t .\" Title: usb_set_interface .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: USB Core APIs .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "USB_SET_INTERFACE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "USB Core APIs" .\" ----------------------------------------------------------------- .\" * 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" usb_set_interface \- Makes a particular alternate setting be current .SH "SYNOPSIS" .HP \w'int\ usb_set_interface('u .BI "int usb_set_interface(struct\ usb_device\ *\ " "dev" ", int\ " "interface" ", int\ " "alternate" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 the device whose interface is being updated .RE .PP \fIinterface\fR .RS 4 the interface being updated .RE .PP \fIalternate\fR .RS 4 the setting being chosen\&. .RE .SH "CONTEXT" .PP !in_interrupt () .SH "DESCRIPTION" .PP This is used to enable data transfers on interfaces that may not be enabled by default\&. Not all devices support such configurability\&. Only the driver bound to an interface may change its setting\&. .PP Within any given configuration, each interface may have several alternative settings\&. These are often used to control levels of bandwidth consumption\&. For example, the default setting for a high speed interrupt endpoint may not send more than 64 bytes per microframe, while interrupt transfers of up to 3KBytes per microframe are legal\&. Also, isochronous endpoints may never be part of an interface\*(Aqs default setting\&. To access such bandwidth, alternate interface settings must be made current\&. .PP Note that in the Linux USB subsystem, bandwidth associated with an endpoint in a given alternate setting is not reserved until an URB is submitted that needs that bandwidth\&. Some other operating systems allocate bandwidth early, when a configuration is chosen\&. .PP This call is synchronous, and may not be used in an interrupt context\&. Also, drivers must not change altsettings while urbs are scheduled for endpoints in that interface; all such urbs must first be completed (perhaps forced by unlinking)\&. .SH "RETURN" .PP Zero on success, or else the status code returned by the underlying \fBusb_control_msg\fR call\&. .SH "COPYRIGHT" .br