USB_GADGET_CONFIG_BU(9) | Kernel Mode Gadget API | USB_GADGET_CONFIG_BU(9) |
NAME¶
usb_gadget_config_buf - builts a complete configuration descriptor
SYNOPSIS¶
int usb_gadget_config_buf(const struct usb_config_descriptor * config, void * buf, unsigned length, const struct usb_descriptor_header ** desc);
ARGUMENTS¶
const struct usb_config_descriptor * config
void * buf
unsigned length
const struct usb_descriptor_header ** desc
DESCRIPTION¶
This copies descriptors into the response buffer, building a descriptor for that configuration. It returns the buffer length or a negative status code. The config.wTotalLength field is set to match the length of the result, but other descriptor fields (including power usage and interface count) must be set by the caller.
Gadget drivers could use this when constructing a config descriptor in response to USB_REQ_GET_DESCRIPTOR. They will need to patch the resulting bDescriptorType value if USB_DT_OTHER_SPEED_CONFIG is needed.
AUTHOR¶
David Brownell <dbrownell@users.sourceforge.net>
COPYRIGHT¶
June 2017 | Kernel Hackers Manual 4.11 |