Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

usb_set_interface(9) [centos man page]

USB_SET_INTERFACE(9)						   USB Core APIs					      USB_SET_INTERFACE(9)

NAME
usb_set_interface - Makes a particular alternate setting be current SYNOPSIS
int usb_set_interface(struct usb_device * dev, int interface, int alternate); ARGUMENTS
dev the device whose interface is being updated interface the interface being updated alternate the setting being chosen. CONTEXT
!in_interrupt () DESCRIPTION
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. 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's default setting. To access such bandwidth, alternate interface settings must be made current. 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. 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). RETURN
Zero on success, or else the status code returned by the underlying usb_control_msg call. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 USB_SET_INTERFACE(9)

Check Out this Related Man Page

USB_SG_WAIT(9)							   USB Core APIs						    USB_SG_WAIT(9)

NAME
usb_sg_wait - synchronously execute scatter/gather request SYNOPSIS
void usb_sg_wait(struct usb_sg_request * io); ARGUMENTS
io request block handle, as initialized with usb_sg_init. some fields become accessible when this call returns. CONTEXT
!in_interrupt () DESCRIPTION
This function blocks until the specified I/O operation completes. It leverages the grouping of the related I/O requests to get good transfer rates, by queueing the requests. At higher speeds, such queuing can significantly improve USB throughput. There are three kinds of completion for this function. (1) success, where io->status is zero. The number of io->bytes transferred is as requested. (2) error, where io->status is a negative errno value. The number of io->bytes transferred before the error is usually less than requested, and can be nonzero. (3) cancellation, a type of error with status -ECONNRESET that is initiated by usb_sg_cancel. When this function returns, all memory allocated through usb_sg_init or this call will have been freed. The request block parameter may still be passed to usb_sg_cancel, or it may be freed. It could also be reinitialized and then reused. DATA TRANSFER RATES
Bulk transfers are valid for full or high speed endpoints. The best full speed data rate is 19 packets of 64 bytes each per frame, or 1216 bytes per millisecond. The best high speed data rate is 13 packets of 512 bytes each per microframe, or 52 KBytes per millisecond. The reason to use interrupt transfers through this API would most likely be to reserve high speed bandwidth, where up to 24 KBytes per millisecond could be transferred. That capability is less useful for low or full speed interrupt endpoints, which allow at most one packet per millisecond, of at most 8 or 64 bytes (respectively). It is not necessary to call this function to reserve bandwidth for devices under an xHCI host controller, as the bandwidth is reserved when the configuration or interface alt setting is selected. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 USB_SG_WAIT(9)
Man Page