1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xenomai API: Descriptor Syscall API</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
</div>
<div class="contents">
<h1>Descriptor Syscall API<br>
<small>
[<a class="el" href="group__syscall.html">Level 0 API (Syscall API)</a>]</small>
</h1>
<p>
<div class="dynheader">
Collaboration diagram for Descriptor Syscall API:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__descriptor__sys.png" border="0" alt="" usemap="#group____descriptor____sys_map">
<map name="group____descriptor____sys_map">
<area shape="rect" href="group__syscall.html" title="Level 0 API (Syscall API)" alt="" coords="7,5,177,32"></map></td></tr></table></center>
</div>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structa4l__descriptor.html">a4l_descriptor</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Structure containing device-information useful to users. <a href="structa4l__descriptor.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>ANALOGY_xxx_DESC</h2></td></tr>
<tr><td colspan="2">Constants used as argument so as to define the description depth to recover<p>
<a class="anchor" name="ANALOGY_xxx_DESC"></a> <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9bac966c050032d5f29c3205b80ebe74"></a><!-- doxytag: member="descriptor_sys::A4L_BSC_DESC" ref="g9bac966c050032d5f29c3205b80ebe74" args="" -->
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__descriptor__sys.html#g9bac966c050032d5f29c3205b80ebe74">A4L_BSC_DESC</a> 0x0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">BSC stands for basic descriptor (device data). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gefe74d60fa5f6c85021c66993d2cf306"></a><!-- doxytag: member="descriptor_sys::A4L_CPLX_DESC" ref="gefe74d60fa5f6c85021c66993d2cf306" args="" -->
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__descriptor__sys.html#gefe74d60fa5f6c85021c66993d2cf306">A4L_CPLX_DESC</a> 0x1</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">CPLX stands for complex descriptor (subdevice + channel + range data). <br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__descriptor__sys.html#g1e2ec4c91556e9bb1d1c54a7fc6e4b28">a4l_sys_desc</a> (int fd, <a class="el" href="structa4l__descriptor.html">a4l_desc_t</a> *dsc, int pass)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a descriptor on an attached device. <a href="#g1e2ec4c91556e9bb1d1c54a7fc6e4b28"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g1e2ec4c91556e9bb1d1c54a7fc6e4b28"></a><!-- doxytag: member="descriptor.c::a4l_sys_desc" ref="g1e2ec4c91556e9bb1d1c54a7fc6e4b28" args="(int fd, a4l_desc_t *dsc, int pass)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int a4l_sys_desc </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>fd</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structa4l__descriptor.html">a4l_desc_t</a> * </td>
<td class="paramname"> <em>dsc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>pass</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get a descriptor on an attached device.
<p>
Once the device has been attached, the function a4l_get_desc() retrieves various information on the device (subdevices, channels, ranges, etc.). The function a4l_get_desc() can be called twice:<ul>
<li>The first time, almost all the fields, except sbdata, are set (board_name, nb_subd, idx_read_subd, idx_write_subd, magic, sbsize); the last field , sbdata, is supposed to be a pointer on a buffer, which size is defined by the field sbsize.</li><li>The second time, the buffer pointed by sbdata is filled with data about the subdevices, the channels and the ranges.</li></ul>
<p>
Between the two calls, an allocation must be performed in order to recover a buffer large enough to contain all the data. These data are set up according a root-leaf organization (device -> subdevice -> channel -> range). They cannot be accessed directly; specific functions are available so as to retrieve them:<ul>
<li><a class="el" href="group__descriptor1__lib.html#g4200a3b0f33b20fedeadc0494491cc9c" title="Get an information structure on a specified subdevice.">a4l_get_subdinfo()</a> to get some subdevice's characteristics.</li><li>a4l_get_chaninfo() to get some channel's characteristics.</li><li><a class="el" href="group__descriptor1__lib.html#g1baacb426ed57054a99020c6b2a42baf" title="Get an information structure on a specified range.">a4l_get_rnginfo()</a> to get some range's characteristics.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>Driver file descriptor </td></tr>
<tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>dsc</em> </td><td>Device descriptor </td></tr>
<tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pass</em> </td><td>Description level to retrieve:<ul>
<li>A4L_BSC_DESC to get the basic descriptor (notably the size of the data buffer to allocate).</li><li>A4L_CPLX_DESC to get the complex descriptor, the data buffer is filled with characteristics about the subdevices, the channels and the ranges.</li></ul>
</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if some argument is missing or wrong; the pass argument should be checked; check also the kernel log ("dmesg")</li><li>-EFAULT is returned if a user <-> kernel transfer went wrong</li><li>-ENODEV is returned if the descriptor is incoherent (the device may be unattached) </li></ul>
<p>References <a class="el" href="descriptor_8h-source.html#l00049">A4L_BSC_DESC</a>, <a class="el" href="descriptor_8h-source.html#l00078">a4l_descriptor::magic</a>, and <a class="el" href="descriptor_8h-source.html#l00080">a4l_descriptor::sbsize</a>.</p>
<p>Referenced by <a class="el" href="descriptor_8c-source.html#l00364">a4l_fill_desc()</a>, and <a class="el" href="descriptor_8c-source.html#l00297">a4l_open()</a>.</p>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:39 2010 for Xenomai API by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
|