Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

usb_interface_id(9) [centos man page]

USB_INTERFACE_ID(9)					      Kernel Mode Gadget API					       USB_INTERFACE_ID(9)

NAME
usb_interface_id - allocate an unused interface ID SYNOPSIS
int usb_interface_id(struct usb_configuration * config, struct usb_function * function); ARGUMENTS
config configuration associated with the interface function function handling the interface CONTEXT
single threaded during gadget setup DESCRIPTION
usb_interface_id is called from usb_function.bind callbacks to allocate new interface IDs. The function driver will then store that ID in interface, association, CDC union, and other descriptors. It will also handle any control requests targeted at that interface, particularly changing its altsetting via set_alt. There may also be class-specific or vendor-specific requests to handle. All interface identifier should be allocated using this routine, to ensure that for example different functions don't wrongly assign different meanings to the same identifier. Note that since interface identifiers are configuration-specific, functions used in more than one configuration (or more than once in a given configuration) need multiple versions of the relevant descriptors. Returns the interface ID which was allocated; or -ENODEV if no more interface IDs can be allocated. AUTHOR
David Brownell <dbrownell@users.sourceforge.net> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 USB_INTERFACE_ID(9)

Check Out this Related Man Page

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
config Header for the descriptor, including characteristics such as power requirements and number of interfaces. buf Buffer for the resulting configuration descriptor. length Length of buffer. If this is not big enough to hold the entire configuration descriptor, an error code will be returned. desc Null-terminated vector of pointers to the descriptors (interface, endpoint, etc) defining all functions in this device configuration. 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> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 USB_GADGET_CONFIG_BU(9)
Man Page