1USB_SET_INTERFACE(9) USB Core APIs USB_SET_INTERFACE(9)
2
3
4
6 usb_set_interface - Makes a particular alternate setting be current
7
9 int usb_set_interface(struct usb_device * dev, int interface,
10 int alternate);
11
13 dev
14 the device whose interface is being updated
15
16 interface
17 the interface being updated
18
19 alternate
20 the setting being chosen.
21
23 !in_interrupt ()
24
26 This is used to enable data transfers on interfaces that may not be
27 enabled by default. Not all devices support such configurability. Only
28 the driver bound to an interface may change its setting.
29
30 Within any given configuration, each interface may have several
31 alternative settings. These are often used to control levels of
32 bandwidth consumption. For example, the default setting for a high
33 speed interrupt endpoint may not send more than 64 bytes per
34 microframe, while interrupt transfers of up to 3KBytes per microframe
35 are legal. Also, isochronous endpoints may never be part of an
36 interface's default setting. To access such bandwidth, alternate
37 interface settings must be made current.
38
39 Note that in the Linux USB subsystem, bandwidth associated with an
40 endpoint in a given alternate setting is not reserved until an URB is
41 submitted that needs that bandwidth. Some other operating systems
42 allocate bandwidth early, when a configuration is chosen.
43
44 This call is synchronous, and may not be used in an interrupt context.
45 Also, drivers must not change altsettings while urbs are scheduled for
46 endpoints in that interface; all such urbs must first be completed
47 (perhaps forced by unlinking).
48
50 Zero on success, or else the status code returned by the underlying
51 usb_control_msg call.
52
54Kernel Hackers Manual 3.10 June 2019 USB_SET_INTERFACE(9)