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