1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>CA Function Calls</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvb_ca.html" title="Chapter&#160;13.&#160;DVB CA Device"><link rel="prev" href="dvb_ca.html" title="Chapter&#160;13.&#160;DVB CA Device"><link rel="next" href="dvb_net.html" title="Chapter&#160;14.&#160;DVB Network API"></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">CA Function Calls</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dvb_ca.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;13.&#160;DVB CA Device</th><td width="20%" align="right">&#160;<a accesskey="n" href="dvb_net.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ca_function_calls"></a>CA Function Calls</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ca_function_calls.html#ca_fopen">open()</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#ca_fclose">close()</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_RESET">CA_RESET</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_CAP">CA_GET_CAP</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_SLOT_INFO">CA_GET_SLOT_INFO</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_DESCR_INFO">CA_GET_DESCR_INFO</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_MSG">CA_GET_MSG</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_SEND_MSG">CA_SEND_MSG</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_SET_DESCR">CA_SET_DESCR</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_SET_PID">CA_SET_PID</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca_fopen"></a>open()</h3></div></div></div><p>DESCRIPTION
2</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
3<p>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</p>
4<p>When an open() call has succeeded, the device will be ready for use.
5 The significance of blocking or non-blocking mode is described in the
6 documentation for functions where there is a difference. It does not affect the
7 semantics of the open() call itself. A device opened in blocking mode can later
8 be put into non-blocking mode (and vice versa) using the F_SETFL command
9 of the fcntl system call. This is a standard system call, documented in the Linux
10 manual page for fcntl. Only one user can open the CA Device in O_RDWR
11 mode. All other attempts to open the device in this mode will fail, and an error
12 code will be returned.</p>
13</td></tr></tbody></table></div><p>SYNOPSIS
14</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
15<p>int open(const char &#8902;deviceName, int flags);</p>
16</td></tr></tbody></table></div><p>PARAMETERS
17</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
18<p>const char
19 *deviceName</p>
20</td><td align="char">
21<p>Name of specific video device.</p>
22</td></tr><tr><td align="char">
23<p>int flags</p>
24</td><td align="char">
25<p>A bit-wise OR of the following flags:</p>
26</td></tr><tr><td align="char">
27</td><td align="char">
28<p>O_RDONLY read-only access</p>
29</td></tr><tr><td align="char">
30</td><td align="char">
31<p>O_RDWR read/write access</p>
32</td></tr><tr><td align="char">
33</td><td align="char">
34<p>O_NONBLOCK open in non-blocking mode</p>
35</td></tr><tr><td align="char">
36</td><td align="char">
37<p>(blocking mode is the default)</p>
38</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
39<p>ENODEV</p>
40</td><td align="char">
41<p>Device driver not loaded/available.</p>
42</td></tr><tr><td align="char">
43<p>EINTERNAL</p>
44</td><td align="char">
45<p>Internal error.</p>
46</td></tr><tr><td align="char">
47<p>EBUSY</p>
48</td><td align="char">
49<p>Device or resource busy.</p>
50</td></tr><tr><td align="char">
51<p>EINVAL</p>
52</td><td align="char">
53<p>Invalid argument.</p>
54</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca_fclose"></a>close()</h3></div></div></div><p>DESCRIPTION
55</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
56<p>This system call closes a previously opened audio device.</p>
57</td></tr></tbody></table></div><p>SYNOPSIS
58</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
59<p>int close(int fd);</p>
60</td></tr></tbody></table></div><p>PARAMETERS
61</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
62<p>int fd</p>
63</td><td align="char">
64<p>File descriptor returned by a previous call to open().</p>
65</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
66<p>EBADF</p>
67</td><td align="char">
68<p>fd is not a valid open file descriptor.</p>
69</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_RESET"></a>CA_RESET</h3></div></div></div><p>DESCRIPTION
70</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
71<p>This ioctl is undocumented. Documentation is welcome.</p>
72</td></tr></tbody></table></div><p>SYNOPSIS
73</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
74<p>int ioctl(fd, int request = CA_RESET);
75</p>
76</td></tr></tbody></table></div><p>PARAMETERS
77</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
78<p>int fd</p>
79</td><td align="char">
80<p>File descriptor returned by a previous call to open().</p>
81</td></tr><tr><td align="char">
82<p>int request</p>
83</td><td align="char">
84<p>Equals CA_RESET for this command.</p>
85</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_GET_CAP"></a>CA_GET_CAP</h3></div></div></div><p>DESCRIPTION
86</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
87<p>This ioctl is undocumented. Documentation is welcome.</p>
88</td></tr></tbody></table></div><p>SYNOPSIS
89</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
90<p>int ioctl(fd, int request = CA_GET_CAP,
91 ca_caps_t *);</p>
92</td></tr></tbody></table></div><p>PARAMETERS
93</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
94<p>int fd</p>
95</td><td align="char">
96<p>File descriptor returned by a previous call to open().</p>
97</td></tr><tr><td align="char">
98<p>int request</p>
99</td><td align="char">
100<p>Equals CA_GET_CAP for this command.</p>
101</td></tr><tr><td align="char">
102<p>ca_caps_t *
103</p>
104</td><td align="char">
105<p>Undocumented.</p>
106</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_GET_SLOT_INFO"></a>CA_GET_SLOT_INFO</h3></div></div></div><p>DESCRIPTION
107</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
108<p>This ioctl is undocumented. Documentation is welcome.</p>
109</td></tr></tbody></table></div><p>SYNOPSIS
110</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
111<p>int ioctl(fd, int request = CA_GET_SLOT_INFO,
112 ca_slot_info_t *);</p>
113</td></tr></tbody></table></div><p>PARAMETERS
114</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
115<p>int fd</p>
116</td><td align="char">
117<p>File descriptor returned by a previous call to open().</p>
118</td></tr><tr><td align="char">
119<p>int request</p>
120</td><td align="char">
121<p>Equals CA_GET_SLOT_INFO for this command.</p>
122</td></tr><tr><td align="char">
123<p>ca_slot_info_t *
124</p>
125</td><td align="char">
126<p>Undocumented.</p>
127</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_GET_DESCR_INFO"></a>CA_GET_DESCR_INFO</h3></div></div></div><p>DESCRIPTION
128</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
129<p>This ioctl is undocumented. Documentation is welcome.</p>
130</td></tr></tbody></table></div><p>SYNOPSIS
131</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
132<p>int ioctl(fd, int request = CA_GET_DESCR_INFO,
133 ca_descr_info_t *);</p>
134</td></tr></tbody></table></div><p>PARAMETERS
135</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
136<p>int fd</p>
137</td><td align="char">
138<p>File descriptor returned by a previous call to open().</p>
139</td></tr><tr><td align="char">
140<p>int request</p>
141</td><td align="char">
142<p>Equals CA_GET_DESCR_INFO for this command.</p>
143</td></tr><tr><td align="char">
144<p>ca_descr_info_t *
145</p>
146</td><td align="char">
147<p>Undocumented.</p>
148</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_GET_MSG"></a>CA_GET_MSG</h3></div></div></div><p>DESCRIPTION
149</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
150<p>This ioctl is undocumented. Documentation is welcome.</p>
151</td></tr></tbody></table></div><p>SYNOPSIS
152</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
153<p>int ioctl(fd, int request = CA_GET_MSG,
154 ca_msg_t *);</p>
155</td></tr></tbody></table></div><p>PARAMETERS
156</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
157<p>int fd</p>
158</td><td align="char">
159<p>File descriptor returned by a previous call to open().</p>
160</td></tr><tr><td align="char">
161<p>int request</p>
162</td><td align="char">
163<p>Equals CA_GET_MSG for this command.</p>
164</td></tr><tr><td align="char">
165<p>ca_msg_t *
166</p>
167</td><td align="char">
168<p>Undocumented.</p>
169</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_SEND_MSG"></a>CA_SEND_MSG</h3></div></div></div><p>DESCRIPTION
170</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
171<p>This ioctl is undocumented. Documentation is welcome.</p>
172</td></tr></tbody></table></div><p>SYNOPSIS
173</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
174<p>int ioctl(fd, int request = CA_SEND_MSG,
175 ca_msg_t *);</p>
176</td></tr></tbody></table></div><p>PARAMETERS
177</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
178<p>int fd</p>
179</td><td align="char">
180<p>File descriptor returned by a previous call to open().</p>
181</td></tr><tr><td align="char">
182<p>int request</p>
183</td><td align="char">
184<p>Equals CA_SEND_MSG for this command.</p>
185</td></tr><tr><td align="char">
186<p>ca_msg_t *
187</p>
188</td><td align="char">
189<p>Undocumented.</p>
190</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_SET_DESCR"></a>CA_SET_DESCR</h3></div></div></div><p>DESCRIPTION
191</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
192<p>This ioctl is undocumented. Documentation is welcome.</p>
193</td></tr></tbody></table></div><p>SYNOPSIS
194</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
195<p>int ioctl(fd, int request = CA_SET_DESCR,
196 ca_descr_t *);</p>
197</td></tr></tbody></table></div><p>PARAMETERS
198</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
199<p>int fd</p>
200</td><td align="char">
201<p>File descriptor returned by a previous call to open().</p>
202</td></tr><tr><td align="char">
203<p>int request</p>
204</td><td align="char">
205<p>Equals CA_SET_DESCR for this command.</p>
206</td></tr><tr><td align="char">
207<p>ca_descr_t *
208</p>
209</td><td align="char">
210<p>Undocumented.</p>
211</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="CA_SET_PID"></a>CA_SET_PID</h3></div></div></div><p>DESCRIPTION
212</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
213<p>This ioctl is undocumented. Documentation is welcome.</p>
214</td></tr></tbody></table></div><p>SYNOPSIS
215</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
216<p>int ioctl(fd, int request = CA_SET_PID,
217 ca_pid_t *);</p>
218</td></tr></tbody></table></div><p>PARAMETERS
219</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
220<p>int fd</p>
221</td><td align="char">
222<p>File descriptor returned by a previous call to open().</p>
223</td></tr><tr><td align="char">
224<p>int request</p>
225</td><td align="char">
226<p>Equals CA_SET_PID for this command.</p>
227</td></tr><tr><td align="char">
228<p>ca_pid_t *
229</p>
230</td><td align="char">
231<p>Undocumented.</p>
232</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dvb_ca.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="dvb_ca.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="dvb_net.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;13.&#160;DVB CA Device&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;14.&#160;DVB Network API</td></tr></table></div></body></html>
233