1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Composite Device Framework</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="USB Gadget API for Linux"><link rel="up" href="api.html" title="Chapter&#160;3.&#160;Kernel Mode Gadget API"><link rel="prev" href="API-usb-copy-descriptors.html" title="usb_copy_descriptors"><link rel="next" href="API-struct-usb-os-desc-ext-prop.html" title="struct usb_os_desc_ext_prop"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Composite Device Framework</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-copy-descriptors.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;3.&#160;Kernel Mode Gadget API</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-struct-usb-os-desc-ext-prop.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="composite"></a>Composite Device Framework</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-usb-os-desc-ext-prop.html"><span class="phrase">struct usb_os_desc_ext_prop</span></a></span><span class="refpurpose"> &#8212; 
2  describes one <span class="quote">&#8220;<span class="quote">Extended Property</span>&#8221;</span>
3 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-os-desc.html"><span class="phrase">struct usb_os_desc</span></a></span><span class="refpurpose"> &#8212; 
4     describes OS descriptors associated with one interface
5 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-os-desc-table.html"><span class="phrase">struct usb_os_desc_table</span></a></span><span class="refpurpose"> &#8212; 
6     describes OS descriptors associated with one interface of a usb_function
7 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-function.html"><span class="phrase">struct usb_function</span></a></span><span class="refpurpose"> &#8212; 
8     describes one function of a configuration
9 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-configuration.html"><span class="phrase">struct usb_configuration</span></a></span><span class="refpurpose"> &#8212; 
10     represents one gadget configuration
11 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-composite-driver.html"><span class="phrase">struct usb_composite_driver</span></a></span><span class="refpurpose"> &#8212; 
12     groups configurations into a gadget
13 </span></dt><dt><span class="refentrytitle"><a href="API-module-usb-composite-driver.html"><span class="phrase">module_usb_composite_driver</span></a></span><span class="refpurpose"> &#8212; 
14     Helper macro for registering a USB gadget composite driver
15 </span></dt><dt><span class="refentrytitle"><a href="API-struct-usb-composite-dev.html"><span class="phrase">struct usb_composite_dev</span></a></span><span class="refpurpose"> &#8212; 
16     represents one composite usb gadget
17 </span></dt><dt><span class="refentrytitle"><a href="API-config-ep-by-speed.html"><span class="phrase">config_ep_by_speed</span></a></span><span class="refpurpose"> &#8212; 
18  configures the given endpoint according to gadget speed.
19 </span></dt><dt><span class="refentrytitle"><a href="API-usb-add-function.html"><span class="phrase">usb_add_function</span></a></span><span class="refpurpose"> &#8212; 
20     add a function to a configuration
21 </span></dt><dt><span class="refentrytitle"><a href="API-usb-function-deactivate.html"><span class="phrase">usb_function_deactivate</span></a></span><span class="refpurpose"> &#8212; 
22     prevent function and gadget enumeration
23 </span></dt><dt><span class="refentrytitle"><a href="API-usb-function-activate.html"><span class="phrase">usb_function_activate</span></a></span><span class="refpurpose"> &#8212; 
24     allow function and gadget enumeration
25 </span></dt><dt><span class="refentrytitle"><a href="API-usb-interface-id.html"><span class="phrase">usb_interface_id</span></a></span><span class="refpurpose"> &#8212; 
26     allocate an unused interface ID
27 </span></dt><dt><span class="refentrytitle"><a href="API-usb-add-config.html"><span class="phrase">usb_add_config</span></a></span><span class="refpurpose"> &#8212; 
28     add a configuration to a device.
29 </span></dt><dt><span class="refentrytitle"><a href="API-usb-string-id.html"><span class="phrase">usb_string_id</span></a></span><span class="refpurpose"> &#8212; 
30     allocate an unused string ID
31 </span></dt><dt><span class="refentrytitle"><a href="API-usb-string-ids-tab.html"><span class="phrase">usb_string_ids_tab</span></a></span><span class="refpurpose"> &#8212; 
32     allocate unused string IDs in batch
33 </span></dt><dt><span class="refentrytitle"><a href="API-usb-gstrings-attach.html"><span class="phrase">usb_gstrings_attach</span></a></span><span class="refpurpose"> &#8212; 
34     attach gadget strings to a cdev and assign ids
35 </span></dt><dt><span class="refentrytitle"><a href="API-usb-string-ids-n.html"><span class="phrase">usb_string_ids_n</span></a></span><span class="refpurpose"> &#8212; 
36     allocate unused string IDs in batch
37 </span></dt><dt><span class="refentrytitle"><a href="API-usb-composite-probe.html"><span class="phrase">usb_composite_probe</span></a></span><span class="refpurpose"> &#8212; 
38     register a composite driver
39 </span></dt><dt><span class="refentrytitle"><a href="API-usb-composite-unregister.html"><span class="phrase">usb_composite_unregister</span></a></span><span class="refpurpose"> &#8212; 
40     unregister a composite driver
41 </span></dt><dt><span class="refentrytitle"><a href="API-usb-composite-setup-continue.html"><span class="phrase">usb_composite_setup_continue</span></a></span><span class="refpurpose"> &#8212; 
42     Continue with the control transfer
43 </span></dt></dl></div><p>The core API is sufficient for writing drivers for composite
44USB devices (with more than one function in a given configuration),
45and also multi-configuration devices (also more than one function,
46but not necessarily sharing a given configuration).
47There is however an optional framework which makes it easier to
48reuse and combine functions.
49</p><p>Devices using this framework provide a <span class="emphasis"><em>struct
50usb_composite_driver</em></span>, which in turn provides one or
51more <span class="emphasis"><em>struct usb_configuration</em></span> instances.
52Each such configuration includes at least one
53<span class="emphasis"><em>struct usb_function</em></span>, which packages a user
54visible role such as "network link" or "mass storage device".
55Management functions may also exist, such as "Device Firmware
56Upgrade".
57</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-usb-copy-descriptors.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="api.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-struct-usb-os-desc-ext-prop.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_copy_descriptors</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">struct usb_os_desc_ext_prop</span></td></tr></table></div></body></html>
58