1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>rio_get_device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="RapidIO Subsystem Guide"><link rel="up" href="drivers.html#Functions" title="Functions"><link rel="prev" href="API-rio-get-asm.html" title="rio_get_asm"><link rel="next" href="API-rio-lock-device.html" title="rio_lock_device"></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">rio_get_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-rio-get-asm.html">Prev</a> </td><th width="60%" align="center">Functions</th><td width="20%" align="right"> <a accesskey="n" href="API-rio-lock-device.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-rio-get-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>rio_get_device — 
2     Begin or continue searching for a RIO device by vid/did
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"><a class="link" href="API-struct-rio-dev.html" title="struct rio_dev">struct rio_dev</a> * <b class="fsfunc">rio_get_device </b>(</code></td><td>u16 <var class="pdparam">vid</var>, </td></tr><tr><td> </td><td>u16 <var class="pdparam">did</var>, </td></tr><tr><td> </td><td><a class="link" href="API-struct-rio-dev.html" title="struct rio_dev">struct rio_dev</a> * <var class="pdparam">from</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.5.3.51.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>vid</code></em></span></dt><dd><p>
4     RIO vid to match or <code class="constant">RIO_ANY_ID</code> to match all vids
5    </p></dd><dt><span class="term"><em class="parameter"><code>did</code></em></span></dt><dd><p>
6     RIO did to match or <code class="constant">RIO_ANY_ID</code> to match all dids
7    </p></dd><dt><span class="term"><em class="parameter"><code>from</code></em></span></dt><dd><p>
8     Previous RIO device found in search, or <code class="constant">NULL</code> for new search
9    </p></dd></dl></div></div><div class="refsect1"><a name="id-1.5.3.51.6"></a><h2>Description</h2><p>
10   Iterates through the list of known RIO devices. If a RIO device is
11   found with a matching <em class="parameter"><code>vid</code></em> and <em class="parameter"><code>did</code></em>, the reference count to the
12   device is incrememted and a pointer to its device structure is returned.
13   Otherwise, <code class="constant">NULL</code> is returned. A new search is initiated by passing <code class="constant">NULL</code>
14   to the <em class="parameter"><code>from</code></em> argument. Otherwise, if <em class="parameter"><code>from</code></em> is not <code class="constant">NULL</code>, searches
15   continue from next device on the global list. The reference count for
16   <em class="parameter"><code>from</code></em> is always decremented if it is not <code class="constant">NULL</code>.
17</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-rio-get-asm.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="drivers.html#Functions">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-rio-lock-device.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">rio_get_asm</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">rio_lock_device</span></td></tr></table></div></body></html>
18