Sophie

Sophie

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

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_sg_init</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="The Linux-USB Host Side API" /><link rel="up" href="ch05.html" title="Chapter&#160;5.&#160;USB Core APIs" /><link rel="prev" href="re61.html" title="usb_bulk_msg" /><link rel="next" href="re63.html" title="usb_sg_wait" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>usb_sg_init</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re61.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;5.&#160;USB Core APIs</th><td width="20%" align="right">&#160;<a accesskey="n" href="re63.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="usb_sg_init"><a id="API-usb-sg-init"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>usb_sg_init &#8212; 
     initializes scatterlist-based bulk/interrupt I/O request
 </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_sg_init </b>(</code></td><td>struct usb_sg_request * <var class="pdparam">io</var>, </td></tr><tr><td>&#160;</td><td>struct usb_device * <var class="pdparam">dev</var>, </td></tr><tr><td>&#160;</td><td>unsigned <var class="pdparam">pipe</var>, </td></tr><tr><td>&#160;</td><td>unsigned <var class="pdparam">period</var>, </td></tr><tr><td>&#160;</td><td>struct scatterlist * <var class="pdparam">sg</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">nents</var>, </td></tr><tr><td>&#160;</td><td>size_t <var class="pdparam">length</var>, </td></tr><tr><td>&#160;</td><td>gfp_t <var class="pdparam">mem_flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1" title="Arguments"><a id="id2746822"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>io</code></em></span></dt><dd><p>
     request block being initialized.  until <code class="function">usb_sg_wait</code> returns,
     treat this as a pointer to an opaque block of memory,
    </p></dd><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p>
     the usb device that will send or receive the data
    </p></dd><dt><span class="term"><em class="parameter"><code>pipe</code></em></span></dt><dd><p>
     endpoint <span class="quote">&#8220;<span class="quote">pipe</span>&#8221;</span> used to transfer the data
    </p></dd><dt><span class="term"><em class="parameter"><code>period</code></em></span></dt><dd><p>
     polling rate for interrupt endpoints, in frames or
     (for high speed endpoints) microframes; ignored for bulk
    </p></dd><dt><span class="term"><em class="parameter"><code>sg</code></em></span></dt><dd><p>
     scatterlist entries
    </p></dd><dt><span class="term"><em class="parameter"><code>nents</code></em></span></dt><dd><p>
     how many entries in the scatterlist
    </p></dd><dt><span class="term"><em class="parameter"><code>length</code></em></span></dt><dd><p>
     how many bytes to send from the scatterlist, or zero to
     send every byte identified in the list.
    </p></dd><dt><span class="term"><em class="parameter"><code>mem_flags</code></em></span></dt><dd><p>
     SLAB_* flags affecting memory allocations in this call
    </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2746978"></a><h2>Description</h2><p>
   Returns zero for success, else a negative errno value.  This initializes a
   scatter/gather request, allocating resources such as I/O mappings and urb
   memory (except maybe memory used by USB controller drivers).
   </p><p>

   The request must be issued using <code class="function">usb_sg_wait</code>, which waits for the I/O to
   complete (or to be canceled) and then cleans up all resources allocated by
   <code class="function">usb_sg_init</code>.
   </p><p>

   The request may be canceled with <code class="function">usb_sg_cancel</code>, either before or after
   <code class="function">usb_sg_wait</code> is called.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re61.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re63.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>usb_bulk_msg</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_sg_wait</span></td></tr></table></div></body></html>