1<programlisting>
2/*
3 * ca.h
4 *
5 * Copyright (C) 2000 Ralph  Metzler &lt;ralph@convergence.de&gt;
6 *                  &amp; Marcus Metzler &lt;marcus@convergence.de&gt;
7 *                    for convergence integrated media GmbH
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Lesser Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 *
23 */
24
25#ifndef _DVBCA_H_
26#define _DVBCA_H_
27
28/* slot interface types and info */
29
30typedef struct <link linkend="ca-slot-info">ca_slot_info</link> {
31        int num;               /* slot number */
32
33        int type;              /* CA interface this slot supports */
34#define CA_CI            1     /* CI high level interface */
35#define CA_CI_LINK       2     /* CI link layer level interface */
36#define CA_CI_PHYS       4     /* CI physical layer level interface */
37#define CA_DESCR         8     /* built-in descrambler */
38#define CA_SC          128     /* simple smart card interface */
39
40        unsigned int flags;
41#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
42#define CA_CI_MODULE_READY   2
43} <link linkend="ca-slot-info">ca_slot_info_t</link>;
44
45
46/* descrambler types and info */
47
48typedef struct <link linkend="ca-descr-info">ca_descr_info</link> {
49        unsigned int num;          /* number of available descramblers (keys) */
50        unsigned int type;         /* type of supported scrambling system */
51#define CA_ECD           1
52#define CA_NDS           2
53#define CA_DSS           4
54} <link linkend="ca-descr-info">ca_descr_info_t</link>;
55
56typedef struct <link linkend="ca-caps">ca_caps</link> {
57        unsigned int slot_num;     /* total number of CA card and module slots */
58        unsigned int slot_type;    /* OR of all supported types */
59        unsigned int descr_num;    /* total number of descrambler slots (keys) */
60        unsigned int descr_type;   /* OR of all supported types */
61} <link linkend="ca-caps">ca_caps_t</link>;
62
63/* a message to/from a CI-CAM */
64typedef struct <link linkend="ca-msg">ca_msg</link> {
65        unsigned int index;
66        unsigned int type;
67        unsigned int length;
68        unsigned char msg[256];
69} <link linkend="ca-msg">ca_msg_t</link>;
70
71typedef struct <link linkend="ca-descr">ca_descr</link> {
72        unsigned int index;
73        unsigned int parity;    /* 0 == even, 1 == odd */
74        unsigned char cw[8];
75} <link linkend="ca-descr">ca_descr_t</link>;
76
77typedef struct <link linkend="ca-pid">ca_pid</link> {
78        unsigned int pid;
79        int index;              /* -1 == disable*/
80} <link linkend="ca-pid">ca_pid_t</link>;
81
82#define <link linkend="CA_RESET">CA_RESET</link>          _IO('o', 128)
83#define <link linkend="CA_GET_CAP">CA_GET_CAP</link>        _IOR('o', 129, ca_caps_t)
84#define <link linkend="CA_GET_SLOT_INFO">CA_GET_SLOT_INFO</link>  _IOR('o', 130, ca_slot_info_t)
85#define <link linkend="CA_GET_DESCR_INFO">CA_GET_DESCR_INFO</link> _IOR('o', 131, ca_descr_info_t)
86#define <link linkend="CA_GET_MSG">CA_GET_MSG</link>        _IOR('o', 132, ca_msg_t)
87#define <link linkend="CA_SEND_MSG">CA_SEND_MSG</link>       _IOW('o', 133, ca_msg_t)
88#define <link linkend="CA_SET_DESCR">CA_SET_DESCR</link>      _IOW('o', 134, ca_descr_t)
89#define <link linkend="CA_SET_PID">CA_SET_PID</link>        _IOW('o', 135, ca_pid_t)
90
91#endif
92</programlisting>
93