blob: c790c28dae7d62f97783bc9ef9c467b1b862f560 [file] [log] [blame]
Joel Nider5556a852011-10-16 10:52:13 +02001#ifndef _TSPP_H_
2#define _TSPP_H_
3
4#include <linux/ioctl.h>
5
6#define TSPP_NUM_SYSTEM_KEYS 8
7
8enum tspp_key_parity {
9 TSPP_KEY_PARITY_EVEN,
10 TSPP_KEY_PARITY_ODD
11};
12
13enum tspp_source {
14 TSPP_SOURCE_TSIF0,
15 TSPP_SOURCE_TSIF1,
16 TSPP_SOURCE_MEM,
17 TSPP_SOURCE_NONE = -1
18};
19
20enum tspp_mode {
21 TSPP_MODE_DISABLED,
22 TSPP_MODE_PES,
23 TSPP_MODE_RAW,
24 TSPP_MODE_RAW_NO_SUFFIX
25};
26
Joel Nider435ad8e2011-12-14 16:53:30 +020027enum tspp_tsif_mode {
28 TSPP_TSIF_MODE_LOOPBACK, /* loopback mode */
29 TSPP_TSIF_MODE_1, /* without sync */
30 TSPP_TSIF_MODE_2 /* with sync signal */
31};
32
Joel Nider5556a852011-10-16 10:52:13 +020033struct tspp_filter {
34 int pid;
35 int mask;
36 enum tspp_mode mode;
37 int priority; /* 0 - 15 */
38 int decrypt;
39 enum tspp_source source;
40};
41
42struct tspp_select_source {
43 enum tspp_source source;
Joel Nider435ad8e2011-12-14 16:53:30 +020044 enum tspp_tsif_mode mode;
Hamad Kadmany92705b32012-10-23 14:15:41 +020045 int clk_inverse;
46 int data_inverse;
47 int sync_inverse;
48 int enable_inverse;
Joel Nider5556a852011-10-16 10:52:13 +020049};
50
51struct tspp_pid {
52 int pid;
53};
54
55struct tspp_key {
56 enum tspp_key_parity parity;
57 int lsb;
58 int msb;
59};
60
61struct tspp_iv {
62 int data[2];
63};
64
65struct tspp_system_keys {
66 int data[TSPP_NUM_SYSTEM_KEYS];
67};
68
69struct tspp_buffer {
70 int size;
71};
72
73/* defines for IOCTL functions */
74/* read Documentation/ioctl-number.txt */
75/* some random number to avoid coinciding with other ioctl numbers */
76#define TSPP_IOCTL_BASE 0xAA
77#define TSPP_IOCTL_SELECT_SOURCE \
78 _IOW(TSPP_IOCTL_BASE, 0, struct tspp_select_source)
79#define TSPP_IOCTL_ADD_FILTER \
80 _IOW(TSPP_IOCTL_BASE, 1, struct tspp_filter)
81#define TSPP_IOCTL_REMOVE_FILTER \
82 _IOW(TSPP_IOCTL_BASE, 2, struct tspp_pid)
83#define TSPP_IOCTL_SET_KEY \
84 _IOW(TSPP_IOCTL_BASE, 3, struct tspp_key)
85#define TSPP_IOCTL_SET_IV \
86 _IOW(TSPP_IOCTL_BASE, 4, struct tspp_iv)
87#define TSPP_IOCTL_SET_SYSTEM_KEYS \
88 _IOW(TSPP_IOCTL_BASE, 5, struct tspp_system_keys)
89#define TSPP_IOCTL_BUFFER_SIZE \
90 _IOW(TSPP_IOCTL_BASE, 6, struct tspp_buffer)
Liron Kucha7b49ae2013-02-14 16:26:38 +020091#define TSPP_IOCTL_CLOSE_STREAM \
92 _IO(TSPP_IOCTL_BASE, 7)
Joel Nider5556a852011-10-16 10:52:13 +020093
94#endif /* _TSPP_H_ */