1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>usb_ep_set_halt</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-dequeue.html" title="usb_ep_dequeue"><link rel="next" href="API-usb-ep-clear-halt.html" title="usb_ep_clear_halt"></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_set_halt</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-usb-ep-dequeue.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-clear-halt.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-usb-ep-set-halt"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_ep_set_halt — 2 sets the endpoint halt feature. 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_set_halt </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="idp1124031804"></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 non-isochronous endpoint being stalled 5 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124033396"></a><h2>Description</h2><p> 6 Use this to stall an endpoint, perhaps as an error report. 7 Except for control endpoints, 8 the endpoint stays halted (will not stream any data) until the host 9 clears this feature; drivers may need to empty the endpoint's request 10 queue first, to make sure no inappropriate transfers happen. 11 </p><p> 12 13 Note that while an endpoint CLEAR_FEATURE will be invisible to the 14 gadget driver, a SET_INTERFACE will not be. To reset endpoints for the 15 current altsetting, see <code class="function">usb_ep_clear_halt</code>. When switching altsettings, 16 it's simplest to use <code class="function">usb_ep_enable</code> or <code class="function">usb_ep_disable</code> for the endpoints. 17 </p><p> 18 19 Returns zero, or a negative error code. On success, this call sets 20 underlying hardware state that blocks data transfers. 21 Attempts to halt IN endpoints will fail (returning -EAGAIN) if any 22 transfer requests are still queued, or if the controller hardware 23 (usually a FIFO) still holds bytes that the host hasn't collected. 24</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-dequeue.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-clear-halt.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">usb_ep_dequeue</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_clear_halt</span></td></tr></table></div></body></html> 25