.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "USB_GADGET_CONFIG_BUF" "9" "09 October 2005" "" ""
.SH NAME
usb_gadget_config_buf \- builts a complete configuration descriptor
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int usb_gadget_config_buf (const struct usb_config_descriptor * \fIconfig\fB, void * \fIbuf\fB, unsigned \fIlength\fB, const struct usb_descriptor_header ** \fIdesc\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIconfig\fB\fR
Header for the descriptor, including characteristics such
as power requirements and number of interfaces.
.TP
\fB\fIbuf\fB\fR
Buffer for the resulting configuration descriptor.
.TP
\fB\fIlength\fB\fR
Length of buffer. If this is not big enough to hold the
entire configuration descriptor, an error code will be returned.
.TP
\fB\fIdesc\fB\fR
Null-terminated vector of pointers to the descriptors (interface,
endpoint, etc) defining all functions in this device configuration.
.SH "DESCRIPTION"
.PP
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.
.PP
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.