'\" t .\" Title: usb_add_config .\" Author: .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Kernel Mode Gadget API .\" Source: Kernel Hackers Manual 4.11.6 .\" Language: English .\" .TH "USB_ADD_CONFIG" "9" "July 2017" "Kernel Hackers Manual 4\&.11\&" "Kernel Mode Gadget API" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" usb_add_config \- add a configuration to a device\&. .SH "SYNOPSIS" .HP \w'int\ usb_add_config('u .BI "int usb_add_config(struct\ usb_composite_dev\ *\ " "cdev" ", struct\ usb_configuration\ *\ " "config" ", int\ (*" "bind" ")\ (struct\ usb_configuration\ *));" .SH "ARGUMENTS" .PP \fIstruct usb_composite_dev * cdev\fR .RS 4 wraps the USB gadget .RE .PP \fIstruct usb_configuration * config\fR .RS 4 the configuration, with bConfigurationValue assigned .RE .PP \fIint (*)(struct usb_configuration *) bind\fR .RS 4 the configuration\*(Aqs bind function .RE .SH "CONTEXT" .PP single threaded during gadget setup .SH "DESCRIPTION" .PP One of the main tasks of a composite \fIbind\fR() routine is to add each of the configurations it supports, using this routine\&. .PP This function returns the value of the configuration\*(Aqs \fIbind\fR(), which is zero for success else a negative errno value\&. Binding configurations assigns global resources including string IDs, and per\-configuration resources such as interface IDs and endpoints\&. .SH "AUTHOR" .PP \fBDavid Brownell\fR <\&dbrownell@users.sourceforge.net\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br