Sophie

Sophie

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

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>usb_ep_queue</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="ch03s03.html" title="Core Objects and Methods" /><link rel="prev" href="re21.html" title="usb_ep_free_request" /><link rel="next" href="re23.html" title="usb_ep_dequeue" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>usb_ep_queue</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re21.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="re23.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="usb_ep_queue"><a id="API-usb-ep-queue"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_ep_queue &#8212; 
     queues (submits) an I/O request to an endpoint.
 </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">int <b class="fsfunc">usb_ep_queue </b>(</code></td><td>struct usb_ep * <var class="pdparam">ep</var>, </td></tr><tr><td>&#160;</td><td>struct usb_request * <var class="pdparam">req</var>, </td></tr><tr><td>&#160;</td><td>gfp_t <var class="pdparam">gfp_flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1" title="Arguments"><a id="id2993238"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>ep</code></em></span></dt><dd><p>
     the endpoint associated with the request
    </p></dd><dt><span class="term"><em class="parameter"><code>req</code></em></span></dt><dd><p>
     the request being submitted
    </p></dd><dt><span class="term"><em class="parameter"><code>gfp_flags</code></em></span></dt><dd><p>
     GFP_* flags to use in case the lower level driver couldn't
     pre-allocate all necessary memory with the request.
    </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2993299"></a><h2>Description</h2><p>
   This tells the device controller to perform the specified request through
   that endpoint (reading or writing a buffer).  When the request completes,
   including being canceled by <code class="function">usb_ep_dequeue</code>, the request's completion
   routine is called to return the request to the driver.  Any endpoint
   (except control endpoints like ep0) may have more than one transfer
   request queued; they complete in FIFO order.  Once a gadget driver
   submits a request, that request may not be examined or modified until it
   is given back to that driver through the completion callback.
   </p><p>

   Each request is turned into one or more packets.  The controller driver
   never merges adjacent requests into the same packet.  OUT transfers
   will sometimes use data that's already buffered in the hardware.
   Drivers can rely on the fact that the first byte of the request's buffer
   always corresponds to the first byte of some USB packet, for both
   IN and OUT transfers.
   </p><p>

   Bulk endpoints can queue any amount of data; the transfer is packetized
   automatically.  The last packet will be short if the request doesn't fill it
   out completely.  Zero length packets (ZLPs) should be avoided in portable
   protocols since not all usb hardware can successfully handle zero length
   packets.  (ZLPs may be explicitly written, and may be implicitly written if
   the request 'zero' flag is set.)  Bulk endpoints may also be used
   for interrupt transfers; but the reverse is not true, and some endpoints
   won't support every interrupt transfer.  (Such as 768 byte packets.)
   </p><p>

   Interrupt-only endpoints are less functional than bulk endpoints, for
   example by not supporting queueing or not handling buffers that are
   larger than the endpoint's maxpacket size.  They may also treat data
   toggle differently.
   </p><p>

   Control endpoints ... after getting a <code class="function">setup</code> callback, the driver queues
   one response (even if it would be zero length).  That enables the
   status ack, after transfering data as specified in the response.  Setup
   functions may return negative error codes to generate protocol stalls.
   (Note that some USB device controllers disallow protocol stall responses
   in some cases.)  When control responses are deferred (the response is
   written after the setup callback returns), then <code class="function">usb_ep_set_halt</code> may be
   used on ep0 to trigger protocol stalls.  Depending on the controller,
   it may not be possible to trigger a status-stage protocol stall when the
   data stage is over, that is, from within the response's completion
   routine.
   </p><p>

   For periodic endpoints, like interrupt or isochronous ones, the usb host
   arranges to poll once per interval, and the gadget driver usually will
   have queued some data to transfer at that time.
   </p><p>

   Returns zero, or a negative error code.  Endpoints that are not enabled
   report errors; errors will also be
   reported when the usb peripheral is disconnected.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re21.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch03s03.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re23.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>usb_ep_free_request</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>usb_ep_dequeue</span></td></tr></table></div></body></html>