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>