1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>usb_ep_enable</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="core.html" title="Core Objects and Methods"><link rel="prev" href="API-usb-ep-set-maxpacket-limit.html" title="usb_ep_set_maxpacket_limit"><link rel="next" href="API-usb-ep-disable.html" title="usb_ep_disable"></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"><span class="phrase">usb_ep_enable</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-ep-set-maxpacket-limit.html">Prev</a>&#160;</td><th width="60%" align="center">Core Objects and Methods</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-usb-ep-disable.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-usb-ep-enable"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_ep_enable &#8212; 
2     configure endpoint, making it usable
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">usb_ep_enable </b>(</code></td><td>struct usb_ep * <var class="pdparam">ep</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1123966372"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>ep</code></em></span></dt><dd><p>
4     the endpoint being configured.  may not be the endpoint named <span class="quote">&#8220;<span class="quote">ep0</span>&#8221;</span>.
5     drivers discover endpoints through the ep_list of a usb_gadget.
6    </p></dd></dl></div></div><div class="refsect1"><a name="idp1123968252"></a><h2>Description</h2><p>
7   When configurations are set, or when interface settings change, the driver
8   will enable or disable the relevant endpoints.  while it is enabled, an
9   endpoint may be used for i/o until the driver receives a <code class="function">disconnect</code> from
10   the host or until the endpoint is disabled.
11   </p><p>
12
13   the ep0 implementation (which calls this routine) must ensure that the
14   hardware capabilities of each endpoint match the descriptor provided
15   for it.  for example, an endpoint named <span class="quote">&#8220;<span class="quote">ep2in-bulk</span>&#8221;</span> would be usable
16   for interrupt transfers as well as bulk, but it likely couldn't be used
17   for iso transfers or for endpoint 14.  some endpoints are fully
18   configurable, with more generic names like <span class="quote">&#8220;<span class="quote">ep-a</span>&#8221;</span>.  (remember that for
19   USB, <span class="quote">&#8220;<span class="quote">in</span>&#8221;</span> means <span class="quote">&#8220;<span class="quote">towards the USB master</span>&#8221;</span>.)
20   </p><p>
21
22   returns zero, or a negative error code.
23</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-usb-ep-set-maxpacket-limit.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="core.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-usb-ep-disable.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_ep_set_maxpacket_limit</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">usb_ep_disable</span></td></tr></table></div></body></html>
24