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> </td><th width="60%" align="center">Core Objects and Methods</th><td width="20%" align="right"> <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 — 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"> </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">“<span class="quote">ep0</span>”</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">“<span class="quote">ep2in-bulk</span>”</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">“<span class="quote">ep-a</span>”</span>. (remember that for 19 USB, <span class="quote">“<span class="quote">in</span>”</span> means <span class="quote">“<span class="quote">towards the USB master</span>”</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> </td><td width="20%" align="center"><a accesskey="u" href="core.html">Up</a></td><td width="40%" align="right"> <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> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">usb_ep_disable</span></td></tr></table></div></body></html> 24