1STRUCT USB_COMPOSITE(9)     Kernel Mode Gadget API     STRUCT USB_COMPOSITE(9)
2
3
4

NAME

6       struct_usb_composite_driver - groups configurations into a gadget
7

SYNOPSIS

9       struct usb_composite_driver {
10         const char * name;
11         const struct usb_device_descriptor * dev;
12         struct usb_gadget_strings ** strings;
13         int (* bind) (struct usb_composite_dev *);
14         int (* unbind) (struct usb_composite_dev *);
15         void (* suspend) (struct usb_composite_dev *);
16         void (* resume) (struct usb_composite_dev *);
17       };
18

MEMBERS

20       name
21           For diagnostics, identifies the driver.
22
23       dev
24           Template descriptor for the device, including default device
25           identifiers.
26
27       strings
28           tables of strings, keyed by identifiers assigned during bind and
29           language IDs provided in control requests
30
31       bind
32           (REQUIRED) Used to allocate resources that are shared across the
33           whole device, such as string IDs, and add its configurations using
34           usb_add_config(). This may fail by returning a negative errno
35           value; it should return zero on successful initialization.
36
37       unbind
38           Reverses bind(); called as a side effect of unregistering this
39           driver.
40
41       suspend
42           Notifies when the host stops sending USB traffic, after function
43           notifications
44
45       resume
46           Notifies configuration when the host restarts USB traffic, before
47           function notifications
48

DESCRIPTION

50       Devices default to reporting self powered operation. Devices which rely
51       on bus powered operation should report this in their bind() method.
52
53       Before returning from bind, various fields in the template descriptor
54       may be overridden. These include the idVendor/idProduct/bcdDevice
55       values normally to bind the appropriate host side driver, and the three
56       strings (iManufacturer, iProduct, iSerialNumber) normally used to
57       provide user meaningful device identifiers. (The strings will not be
58       defined unless they are defined in dev and strings.) The correct ep0
59       maxpacket size is also reported, as defined by the underlying
60       controller driver.
61

AUTHOR

63       David Brownell <dbrownell@users.sourceforge.net>
64           Author.
65
67Kernel Hackers Manual 2.6.         June 2019           STRUCT USB_COMPOSITE(9)
Impressum