1 <title>DVB CA Device</title>
2 <para>The DVB CA device controls the conditional access hardware. It can be accessed through
3 <emphasis role="tt">/dev/dvb/adapter0/ca0</emphasis>. Data types and and ioctl definitions can be accessed by
4 including <emphasis role="tt">linux/dvb/ca.h</emphasis> in your application.
7 <section id="ca_data_types">
8 <title>CA Data Types</title>
11 <section id="ca-slot-info">
12 <title>ca_slot_info_t</title>
14 typedef struct ca_slot_info {
15 int num; /⋆ slot number ⋆/
17 int type; /⋆ CA interface this slot supports ⋆/
18 #define CA_CI 1 /⋆ CI high level interface ⋆/
19 #define CA_CI_LINK 2 /⋆ CI link layer level interface ⋆/
20 #define CA_CI_PHYS 4 /⋆ CI physical layer level interface ⋆/
21 #define CA_DESCR 8 /⋆ built-in descrambler ⋆/
22 #define CA_SC 128 /⋆ simple smart card interface ⋆/
25 #define CA_CI_MODULE_PRESENT 1 /⋆ module (or card) inserted ⋆/
26 #define CA_CI_MODULE_READY 2
31 <section id="ca-descr-info">
32 <title>ca_descr_info_t</title>
34 typedef struct ca_descr_info {
35 unsigned int num; /⋆ number of available descramblers (keys) ⋆/
36 unsigned int type; /⋆ type of supported scrambling system ⋆/
44 <section id="ca-caps">
45 <title>ca_caps_t</title>
47 typedef struct ca_caps {
48 unsigned int slot_num; /⋆ total number of CA card and module slots ⋆/
49 unsigned int slot_type; /⋆ OR of all supported types ⋆/
50 unsigned int descr_num; /⋆ total number of descrambler slots (keys) ⋆/
51 unsigned int descr_type;/⋆ OR of all supported types ⋆/
57 <title>ca_msg_t</title>
59 /⋆ a message to/from a CI-CAM ⋆/
60 typedef struct ca_msg {
64 unsigned char msg[256];
69 <section id="ca-descr">
70 <title>ca_descr_t</title>
72 typedef struct ca_descr {
83 typedef struct ca_pid {
85 int index; /⋆ -1 == disable⋆/
90 <section id="ca_function_calls">
91 <title>CA Function Calls</title>
94 <section id="ca_fopen">
98 <informaltable><tgroup cols="1"><tbody><row><entry
100 <para>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</para>
101 <para>When an open() call has succeeded, the device will be ready for use.
102 The significance of blocking or non-blocking mode is described in the
103 documentation for functions where there is a difference. It does not affect the
104 semantics of the open() call itself. A device opened in blocking mode can later
105 be put into non-blocking mode (and vice versa) using the F_SETFL command
106 of the fcntl system call. This is a standard system call, documented in the Linux
107 manual page for fcntl. Only one user can open the CA Device in O_RDWR
108 mode. All other attempts to open the device in this mode will fail, and an error
109 code will be returned.</para>
111 </row></tbody></tgroup></informaltable>
114 <informaltable><tgroup cols="1"><tbody><row><entry
116 <para>int open(const char ⋆deviceName, int flags);</para>
118 </row></tbody></tgroup></informaltable>
121 <informaltable><tgroup cols="2"><tbody><row><entry
127 <para>Name of specific video device.</para>
131 <para>int flags</para>
134 <para>A bit-wise OR of the following flags:</para>
140 <para>O_RDONLY read-only access</para>
146 <para>O_RDWR read/write access</para>
152 <para>O_NONBLOCK open in non-blocking mode</para>
158 <para>(blocking mode is the default)</para>
160 </row></tbody></tgroup></informaltable>
161 <para>RETURN VALUE</para>
162 <informaltable><tgroup cols="2"><tbody><row><entry
167 <para>Device driver not loaded/available.</para>
171 <para>EINTERNAL</para>
174 <para>Internal error.</para>
181 <para>Device or resource busy.</para>
188 <para>Invalid argument.</para>
190 </row></tbody></tgroup></informaltable>
193 <section id="ca_fclose">
194 <title>close()</title>
197 <informaltable><tgroup cols="1"><tbody><row><entry
199 <para>This system call closes a previously opened audio device.</para>
201 </row></tbody></tgroup></informaltable>
204 <informaltable><tgroup cols="1"><tbody><row><entry
206 <para>int close(int fd);</para>
208 </row></tbody></tgroup></informaltable>
211 <informaltable><tgroup cols="2"><tbody><row><entry
216 <para>File descriptor returned by a previous call to open().</para>
218 </row></tbody></tgroup></informaltable>
219 <para>RETURN VALUE</para>
220 <informaltable><tgroup cols="2"><tbody><row><entry
225 <para>fd is not a valid open file descriptor.</para>
227 </row></tbody></tgroup></informaltable>
230 <section id="CA_RESET"
231 role="subsection"><title>CA_RESET</title>
234 <informaltable><tgroup cols="1"><tbody><row><entry
236 <para>This ioctl is undocumented. Documentation is welcome.</para>
238 </row></tbody></tgroup></informaltable>
241 <informaltable><tgroup cols="1"><tbody><row><entry
243 <para>int ioctl(fd, int request = CA_RESET);
246 </row></tbody></tgroup></informaltable>
249 <informaltable><tgroup cols="2"><tbody><row><entry
254 <para>File descriptor returned by a previous call to open().</para>
258 <para>int request</para>
261 <para>Equals CA_RESET for this command.</para>
263 </row></tbody></tgroup></informaltable>
267 <section id="CA_GET_CAP"
268 role="subsection"><title>CA_GET_CAP</title>
271 <informaltable><tgroup cols="1"><tbody><row><entry
273 <para>This ioctl is undocumented. Documentation is welcome.</para>
275 </row></tbody></tgroup></informaltable>
278 <informaltable><tgroup cols="1"><tbody><row><entry
280 <para>int ioctl(fd, int request = CA_GET_CAP,
283 </row></tbody></tgroup></informaltable>
286 <informaltable><tgroup cols="2"><tbody><row><entry
291 <para>File descriptor returned by a previous call to open().</para>
295 <para>int request</para>
298 <para>Equals CA_GET_CAP for this command.</para>
306 <para>Undocumented.</para>
308 </row></tbody></tgroup></informaltable>
312 <section id="CA_GET_SLOT_INFO"
313 role="subsection"><title>CA_GET_SLOT_INFO</title>
316 <informaltable><tgroup cols="1"><tbody><row><entry
318 <para>This ioctl is undocumented. Documentation is welcome.</para>
320 </row></tbody></tgroup></informaltable>
323 <informaltable><tgroup cols="1"><tbody><row><entry
325 <para>int ioctl(fd, int request = CA_GET_SLOT_INFO,
326 ca_slot_info_t *);</para>
328 </row></tbody></tgroup></informaltable>
331 <informaltable><tgroup cols="2"><tbody><row><entry
336 <para>File descriptor returned by a previous call to open().</para>
340 <para>int request</para>
343 <para>Equals CA_GET_SLOT_INFO for this command.</para>
347 <para>ca_slot_info_t *
351 <para>Undocumented.</para>
353 </row></tbody></tgroup></informaltable>
357 <section id="CA_GET_DESCR_INFO"
358 role="subsection"><title>CA_GET_DESCR_INFO</title>
361 <informaltable><tgroup cols="1"><tbody><row><entry
363 <para>This ioctl is undocumented. Documentation is welcome.</para>
365 </row></tbody></tgroup></informaltable>
368 <informaltable><tgroup cols="1"><tbody><row><entry
370 <para>int ioctl(fd, int request = CA_GET_DESCR_INFO,
371 ca_descr_info_t *);</para>
373 </row></tbody></tgroup></informaltable>
376 <informaltable><tgroup cols="2"><tbody><row><entry
381 <para>File descriptor returned by a previous call to open().</para>
385 <para>int request</para>
388 <para>Equals CA_GET_DESCR_INFO for this command.</para>
392 <para>ca_descr_info_t *
396 <para>Undocumented.</para>
398 </row></tbody></tgroup></informaltable>
402 <section id="CA_GET_MSG"
403 role="subsection"><title>CA_GET_MSG</title>
406 <informaltable><tgroup cols="1"><tbody><row><entry
408 <para>This ioctl is undocumented. Documentation is welcome.</para>
410 </row></tbody></tgroup></informaltable>
413 <informaltable><tgroup cols="1"><tbody><row><entry
415 <para>int ioctl(fd, int request = CA_GET_MSG,
418 </row></tbody></tgroup></informaltable>
421 <informaltable><tgroup cols="2"><tbody><row><entry
426 <para>File descriptor returned by a previous call to open().</para>
430 <para>int request</para>
433 <para>Equals CA_GET_MSG for this command.</para>
441 <para>Undocumented.</para>
443 </row></tbody></tgroup></informaltable>
447 <section id="CA_SEND_MSG"
448 role="subsection"><title>CA_SEND_MSG</title>
451 <informaltable><tgroup cols="1"><tbody><row><entry
453 <para>This ioctl is undocumented. Documentation is welcome.</para>
455 </row></tbody></tgroup></informaltable>
458 <informaltable><tgroup cols="1"><tbody><row><entry
460 <para>int ioctl(fd, int request = CA_SEND_MSG,
463 </row></tbody></tgroup></informaltable>
466 <informaltable><tgroup cols="2"><tbody><row><entry
471 <para>File descriptor returned by a previous call to open().</para>
475 <para>int request</para>
478 <para>Equals CA_SEND_MSG for this command.</para>
486 <para>Undocumented.</para>
488 </row></tbody></tgroup></informaltable>
492 <section id="CA_SET_DESCR"
493 role="subsection"><title>CA_SET_DESCR</title>
496 <informaltable><tgroup cols="1"><tbody><row><entry
498 <para>This ioctl is undocumented. Documentation is welcome.</para>
500 </row></tbody></tgroup></informaltable>
503 <informaltable><tgroup cols="1"><tbody><row><entry
505 <para>int ioctl(fd, int request = CA_SET_DESCR,
506 ca_descr_t *);</para>
508 </row></tbody></tgroup></informaltable>
511 <informaltable><tgroup cols="2"><tbody><row><entry
516 <para>File descriptor returned by a previous call to open().</para>
520 <para>int request</para>
523 <para>Equals CA_SET_DESCR for this command.</para>
531 <para>Undocumented.</para>
533 </row></tbody></tgroup></informaltable>
537 <section id="CA_SET_PID"
538 role="subsection"><title>CA_SET_PID</title>
541 <informaltable><tgroup cols="1"><tbody><row><entry
543 <para>This ioctl is undocumented. Documentation is welcome.</para>
545 </row></tbody></tgroup></informaltable>
548 <informaltable><tgroup cols="1"><tbody><row><entry
550 <para>int ioctl(fd, int request = CA_SET_PID,
553 </row></tbody></tgroup></informaltable>
556 <informaltable><tgroup cols="2"><tbody><row><entry
561 <para>File descriptor returned by a previous call to open().</para>
565 <para>int request</para>
568 <para>Equals CA_SET_PID for this command.</para>
576 <para>Undocumented.</para>
578 </row></tbody></tgroup></informaltable>