Composite Device Framework

struct usb_function — describes one function of a configuration
ep_choose — select descriptor endpoint at current device speed
struct usb_configuration — represents one gadget configuration
struct usb_composite_driver — groups configurations into a gadget
struct usb_composite_dev — represents one composite usb gadget
usb_add_function — add a function to a configuration
usb_function_deactivate — prevent function and gadget enumeration
usb_function_activate — allow function and gadget enumeration
usb_interface_id — allocate an unused interface ID
usb_add_config — add a configuration to a device.
usb_string_id — allocate an unused string ID
usb_string_ids_tab — allocate unused string IDs in batch
usb_string_ids_n — allocate unused string IDs in batch
usb_composite_probe — register a composite driver
usb_composite_unregister — unregister a composite driver
usb_composite_setup_continue — Continue with the control transfer

The core API is sufficient for writing drivers for composite USB devices (with more than one function in a given configuration), and also multi-configuration devices (also more than one function, but not necessarily sharing a given configuration). There is however an optional framework which makes it easier to reuse and combine functions.

Devices using this framework provide a struct usb_composite_driver, which in turn provides one or more struct usb_configuration instances. Each such configuration includes at least one struct usb_function, which packages a user visible role such as "network link" or "mass storage device". Management functions may also exist, such as "Device Firmware Upgrade".