Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > 2c51d8eb79f8810ada971ee8c30ce1e5 > files > 1414

kernel-doc-2.6.32-71.14.1.el6.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>struct usb_configuration</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="USB Gadget API for Linux" /><link rel="up" href="ch03s05.html" title="Composite Device Framework" /><link rel="prev" href="re53.html" title="ep_choose" /><link rel="next" href="re55.html" title="struct usb_composite_driver" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>struct usb_configuration</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re53.html">Prev</a>&#160;</td><th width="60%" align="center">Composite Device Framework</th><td width="20%" align="right">&#160;<a accesskey="n" href="re55.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="struct usb_configuration"><a id="API-struct-usb-configuration"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct usb_configuration &#8212; 
     represents one gadget configuration
 </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><pre class="programlisting">
struct usb_configuration {
  const char * label;
  struct usb_gadget_strings ** strings;
  const struct usb_descriptor_header ** descriptors;
  int (* bind) (struct usb_configuration *);
  void (* unbind) (struct usb_configuration *);
  int (* setup) (struct usb_configuration *,const struct usb_ctrlrequest *);
  u8 bConfigurationValue;
  u8 iConfiguration;
  u8 bmAttributes;
  u8 bMaxPower;
  struct usb_composite_dev * cdev;
};  </pre></div><div class="refsect1" title="Members"><a id="id2998268"></a><h2>Members</h2><div class="variablelist"><dl><dt><span class="term">label</span></dt><dd><p>
   For diagnostics, describes the configuration.
      </p></dd><dt><span class="term">strings</span></dt><dd><p>
   Tables of strings, keyed by identifiers assigned during <em class="parameter"><code>bind</code></em>()
   and by language IDs provided in control requests.
      </p></dd><dt><span class="term">descriptors</span></dt><dd><p>
   Table of descriptors preceding all function descriptors.
   Examples include OTG and vendor-specific descriptors.
      </p></dd><dt><span class="term">bind</span></dt><dd><p>
   Called from <em class="parameter"><code>usb_add_config</code></em>() to allocate resources unique to this
   configuration and to call <em class="parameter"><code>usb_add_function</code></em>() for each function used.
      </p></dd><dt><span class="term">unbind</span></dt><dd><p>
   Reverses <em class="parameter"><code>bind</code></em>; called as a side effect of unregistering the
   driver which added this configuration.
      </p></dd><dt><span class="term">setup</span></dt><dd><p>
   Used to delegate control requests that aren't handled by standard
   device infrastructure or directed at a specific interface.
      </p></dd><dt><span class="term">bConfigurationValue</span></dt><dd><p>
   Copied into configuration descriptor.
      </p></dd><dt><span class="term">iConfiguration</span></dt><dd><p>
   Copied into configuration descriptor.
      </p></dd><dt><span class="term">bmAttributes</span></dt><dd><p>
   Copied into configuration descriptor.
      </p></dd><dt><span class="term">bMaxPower</span></dt><dd><p>
   Copied into configuration descriptor.
      </p></dd><dt><span class="term">cdev</span></dt><dd><p>
   assigned by <em class="parameter"><code>usb_add_config</code></em>() before calling <em class="parameter"><code>bind</code></em>(); this is
   the device associated with this configuration.
      </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2998442"></a><h2>Description</h2><p>
   Configurations are building blocks for gadget drivers structured around
   function drivers.  Simple USB gadgets require only one function and one
   configuration, and handle dual-speed hardware by always providing the same
   functionality.  Slightly more complex gadgets may have more than one
   single-function configuration at a given speed; or have configurations
   that only work at one speed.
   </p><p>

   Composite devices are, by definition, ones with configurations which
   include more than one function.
   </p><p>

   The lifecycle of a usb_configuration includes allocation, initialization
   of the fields described above, and calling <em class="parameter"><code>usb_add_config</code></em>() to set up
   internal data and bind it to a specific device.  The configuration's
   <em class="parameter"><code>bind</code></em>() method is then used to initialize all the functions and then
   call <em class="parameter"><code>usb_add_function</code></em>() for them.
   </p><p>

   Those functions would normally be independant of each other, but that's
   not mandatory.  CDC WMC devices are an example where functions often
   depend on other functions, with some functions subsidiary to others.
   Such interdependency may be managed in any way, so long as all of the
   descriptors complete by the time the composite driver returns from
   its <code class="function">bind</code> routine.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re53.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch03s05.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re55.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>ep_choose</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>struct usb_composite_driver</span></td></tr></table></div></body></html>