table of contents
STRUCT USB_INTERFACE(9) | Host-Side Data Types and Macro | STRUCT USB_INTERFACE(9) |
NAME¶
struct_usb_interface - what usb device drivers talk to
SYNOPSIS¶
struct usb_interface {
struct usb_host_interface * altsetting;
struct usb_host_interface * cur_altsetting;
unsigned num_altsetting;
struct usb_interface_assoc_descriptor * intf_assoc;
int minor;
enum usb_interface_condition condition;
unsigned sysfs_files_created:1;
unsigned ep_devs_created:1;
unsigned unregistering:1;
unsigned needs_remote_wakeup:1;
unsigned needs_altsetting0:1;
unsigned needs_binding:1;
unsigned resetting_device:1;
unsigned authorized:1;
struct device dev;
struct device * usb_dev;
atomic_t pm_usage_cnt;
struct work_struct reset_ws; };
MEMBERS¶
altsetting
cur_altsetting
num_altsetting
intf_assoc
minor
condition
sysfs_files_created
ep_devs_created
unregistering
needs_remote_wakeup
needs_altsetting0
needs_binding
resetting_device
authorized
dev
usb_dev
pm_usage_cnt
reset_ws
DESCRIPTION¶
USB device drivers attach to interfaces on a physical device. Each interface encapsulates a single high level function, such as feeding an audio stream to a speaker or reporting a change in a volume control. Many USB devices only have one interface. The protocol used to talk to an interface's endpoints can be defined in a usb “class” specification, or by a product's vendor. The (default) control endpoint is part of every interface, but is never listed among the interface's descriptors.
The driver that is bound to the interface can use standard driver model calls such as dev_get_drvdata on the dev member of this structure.
Each interface may have alternate settings. The initial configuration of a device sets altsetting 0, but the device driver can change that setting using usb_set_interface. Alternate settings are often used to control the use of periodic endpoints, such as by having different endpoints use different amounts of reserved USB bandwidth. All standards-conformant USB devices that use isochronous endpoints will use them in non-default settings.
The USB specification says that alternate setting numbers must run from 0 to one less than the total number of alternate settings. But some devices manage to mess this up, and the structures aren't necessarily stored in numerical order anyhow. Use usb_altnum_to_altsetting to look up an alternate setting in the altsetting array based on its number.
COPYRIGHT¶
June 2024 | Kernel Hackers Manual 3.10 |