1USB_GADGET_CONFIG_BU(9)     Kernel Mode Gadget API     USB_GADGET_CONFIG_BU(9)
2
3
4

NAME

6       usb_gadget_config_buf - builts a complete configuration descriptor
7

SYNOPSIS

9       int usb_gadget_config_buf(const struct usb_config_descriptor * config,
10                                 void * buf, unsigned length,
11                                 const struct usb_descriptor_header ** desc);
12

ARGUMENTS

14       config
15           Header for the descriptor, including characteristics such as power
16           requirements and number of interfaces.
17
18       buf
19           Buffer for the resulting configuration descriptor.
20
21       length
22           Length of buffer. If this is not big enough to hold the entire
23           configuration descriptor, an error code will be returned.
24
25       desc
26           Null-terminated vector of pointers to the descriptors (interface,
27           endpoint, etc) defining all functions in this device configuration.
28

DESCRIPTION

30       This copies descriptors into the response buffer, building a descriptor
31       for that configuration. It returns the buffer length or a negative
32       status code. The config.wTotalLength field is set to match the length
33       of the result, but other descriptor fields (including power usage and
34       interface count) must be set by the caller.
35
36       Gadget drivers could use this when constructing a config descriptor in
37       response to USB_REQ_GET_DESCRIPTOR. They will need to patch the
38       resulting bDescriptorType value if USB_DT_OTHER_SPEED_CONFIG is needed.
39

AUTHOR

41       David Brownell <dbrownell@users.sourceforge.net>
42           Author.
43
45Kernel Hackers Manual 2.6.       November 2011         USB_GADGET_CONFIG_BU(9)
Impressum