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_t">
12 <title>ca_slot_info_t</title>
14 /⋆ slot interface types and info ⋆/
16 typedef struct ca_slot_info_s {
17 int num; /⋆ slot number ⋆/
19 int type; /⋆ CA interface this slot supports ⋆/
20 #define CA_CI 1 /⋆ CI high level interface ⋆/
21 #define CA_CI_LINK 2 /⋆ CI link layer level interface ⋆/
22 #define CA_CI_PHYS 4 /⋆ CI physical layer level interface ⋆/
23 #define CA_SC 128 /⋆ simple smart card interface ⋆/
26 #define CA_CI_MODULE_PRESENT 1 /⋆ module (or card) inserted ⋆/
27 #define CA_CI_MODULE_READY 2
32 <section id="ca_descr_info_t">
33 <title>ca_descr_info_t</title>
35 typedef struct ca_descr_info_s {
36 unsigned int num; /⋆ number of available descramblers (keys) ⋆/
37 unsigned int type; /⋆ type of supported scrambling system ⋆/
45 <section id="ca_cap_t">
46 <title>ca_cap_t</title>
48 typedef struct ca_cap_s {
49 unsigned int slot_num; /⋆ total number of CA card and module slots ⋆/
50 unsigned int slot_type; /⋆ OR of all supported types ⋆/
51 unsigned int descr_num; /⋆ total number of descrambler slots (keys) ⋆/
52 unsigned int descr_type;/⋆ OR of all supported types ⋆/
57 <section id="ca_msg_t">
58 <title>ca_msg_t</title>
60 /⋆ a message to/from a CI-CAM ⋆/
61 typedef struct ca_msg_s {
65 unsigned char msg[256];
70 <section id="ca_descr_t">
71 <title>ca_descr_t</title>
73 typedef struct ca_descr_s {
80 <section id="ca_function_calls">
81 <title>CA Function Calls</title>
84 <section id="ca_fopen">
88 <informaltable><tgroup cols="1"><tbody><row><entry
90 <para>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</para>
91 <para>When an open() call has succeeded, the device will be ready for use.
92 The significance of blocking or non-blocking mode is described in the
93 documentation for functions where there is a difference. It does not affect the
94 semantics of the open() call itself. A device opened in blocking mode can later
95 be put into non-blocking mode (and vice versa) using the F_SETFL command
96 of the fcntl system call. This is a standard system call, documented in the Linux
97 manual page for fcntl. Only one user can open the CA Device in O_RDWR
98 mode. All other attempts to open the device in this mode will fail, and an error
99 code will be returned.</para>
101 </row></tbody></tgroup></informaltable>
104 <informaltable><tgroup cols="1"><tbody><row><entry
106 <para>int open(const char ⋆deviceName, int flags);</para>
108 </row></tbody></tgroup></informaltable>
111 <informaltable><tgroup cols="2"><tbody><row><entry
117 <para>Name of specific video device.</para>
121 <para>int flags</para>
124 <para>A bit-wise OR of the following flags:</para>
130 <para>O_RDONLY read-only access</para>
136 <para>O_RDWR read/write access</para>
142 <para>O_NONBLOCK open in non-blocking mode</para>
148 <para>(blocking mode is the default)</para>
150 </row></tbody></tgroup></informaltable>
153 <informaltable><tgroup cols="2"><tbody><row><entry
158 <para>Device driver not loaded/available.</para>
162 <para>EINTERNAL</para>
165 <para>Internal error.</para>
172 <para>Device or resource busy.</para>
179 <para>Invalid argument.</para>
181 </row></tbody></tgroup></informaltable>
184 <section id="ca_fclose">
185 <title>close()</title>
188 <informaltable><tgroup cols="1"><tbody><row><entry
190 <para>This system call closes a previously opened audio device.</para>
192 </row></tbody></tgroup></informaltable>
195 <informaltable><tgroup cols="1"><tbody><row><entry
197 <para>int close(int fd);</para>
199 </row></tbody></tgroup></informaltable>
202 <informaltable><tgroup cols="2"><tbody><row><entry
207 <para>File descriptor returned by a previous call to open().</para>
209 </row></tbody></tgroup></informaltable>
212 <informaltable><tgroup cols="2"><tbody><row><entry
217 <para>fd is not a valid open file descriptor.</para>
219 </row></tbody></tgroup></informaltable>