Joel Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 1 | #ifndef _TSPP_H_ |
| 2 | #define _TSPP_H_ |
| 3 | |
| 4 | #include <linux/ioctl.h> |
| 5 | |
| 6 | #define TSPP_NUM_SYSTEM_KEYS 8 |
| 7 | |
| 8 | enum tspp_key_parity { |
| 9 | TSPP_KEY_PARITY_EVEN, |
| 10 | TSPP_KEY_PARITY_ODD |
| 11 | }; |
| 12 | |
| 13 | enum tspp_source { |
| 14 | TSPP_SOURCE_TSIF0, |
| 15 | TSPP_SOURCE_TSIF1, |
| 16 | TSPP_SOURCE_MEM, |
| 17 | TSPP_SOURCE_NONE = -1 |
| 18 | }; |
| 19 | |
| 20 | enum tspp_mode { |
| 21 | TSPP_MODE_DISABLED, |
| 22 | TSPP_MODE_PES, |
| 23 | TSPP_MODE_RAW, |
| 24 | TSPP_MODE_RAW_NO_SUFFIX |
| 25 | }; |
| 26 | |
Joel Nider | 435ad8e | 2011-12-14 16:53:30 +0200 | [diff] [blame] | 27 | enum 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 Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 33 | struct 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 | |
| 42 | struct tspp_select_source { |
| 43 | enum tspp_source source; |
Joel Nider | 435ad8e | 2011-12-14 16:53:30 +0200 | [diff] [blame] | 44 | enum tspp_tsif_mode mode; |
Hamad Kadmany | 92705b3 | 2012-10-23 14:15:41 +0200 | [diff] [blame] | 45 | int clk_inverse; |
| 46 | int data_inverse; |
| 47 | int sync_inverse; |
| 48 | int enable_inverse; |
Joel Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | struct tspp_pid { |
| 52 | int pid; |
| 53 | }; |
| 54 | |
| 55 | struct tspp_key { |
| 56 | enum tspp_key_parity parity; |
| 57 | int lsb; |
| 58 | int msb; |
| 59 | }; |
| 60 | |
| 61 | struct tspp_iv { |
| 62 | int data[2]; |
| 63 | }; |
| 64 | |
| 65 | struct tspp_system_keys { |
| 66 | int data[TSPP_NUM_SYSTEM_KEYS]; |
| 67 | }; |
| 68 | |
| 69 | struct 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 Kuch | a7b49ae | 2013-02-14 16:26:38 +0200 | [diff] [blame] | 91 | #define TSPP_IOCTL_CLOSE_STREAM \ |
| 92 | _IO(TSPP_IOCTL_BASE, 7) |
Joel Nider | 5556a85 | 2011-10-16 10:52:13 +0200 | [diff] [blame] | 93 | |
| 94 | #endif /* _TSPP_H_ */ |