diff options
| author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-01 05:43:39 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-05 05:48:39 -0400 |
| commit | c93022a72f01f8e53d6e1bc2a8d2c2824c2f36bc (patch) | |
| tree | 62f5874255edf0644b59b137f8f7a2de8a5a4d36 /include/uapi/linux/dvb | |
| parent | fce4b371fe5c99a9c05db8493d72f0d1a474ab26 (diff) | |
media: ca.h: split typedefs from structs
Using typedefs inside the Kernel is against CodingStyle, and
there's no good usage here.
Just like we did at frontend.h, at commit 0df289a209e0 ("[media] dvb:
Get rid of typedev usage for enums"), let's keep those typedefs only
to provide userspace backward compatibility.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/uapi/linux/dvb')
| -rw-r--r-- | include/uapi/linux/dvb/ca.h | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/include/uapi/linux/dvb/ca.h b/include/uapi/linux/dvb/ca.h index c18537f3e449..00cf24587bea 100644 --- a/include/uapi/linux/dvb/ca.h +++ b/include/uapi/linux/dvb/ca.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | /* slot interface types and info */ | 27 | /* slot interface types and info */ |
| 28 | 28 | ||
| 29 | typedef struct ca_slot_info { | 29 | struct ca_slot_info { |
| 30 | int num; /* slot number */ | 30 | int num; /* slot number */ |
| 31 | 31 | ||
| 32 | int type; /* CA interface this slot supports */ | 32 | int type; /* CA interface this slot supports */ |
| @@ -39,52 +39,65 @@ typedef struct ca_slot_info { | |||
| 39 | unsigned int flags; | 39 | unsigned int flags; |
| 40 | #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ | 40 | #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ |
| 41 | #define CA_CI_MODULE_READY 2 | 41 | #define CA_CI_MODULE_READY 2 |
| 42 | } ca_slot_info_t; | 42 | }; |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | /* descrambler types and info */ | 45 | /* descrambler types and info */ |
| 46 | 46 | ||
| 47 | typedef struct ca_descr_info { | 47 | struct ca_descr_info { |
| 48 | unsigned int num; /* number of available descramblers (keys) */ | 48 | unsigned int num; /* number of available descramblers (keys) */ |
| 49 | unsigned int type; /* type of supported scrambling system */ | 49 | unsigned int type; /* type of supported scrambling system */ |
| 50 | #define CA_ECD 1 | 50 | #define CA_ECD 1 |
| 51 | #define CA_NDS 2 | 51 | #define CA_NDS 2 |
| 52 | #define CA_DSS 4 | 52 | #define CA_DSS 4 |
| 53 | } ca_descr_info_t; | 53 | }; |
| 54 | 54 | ||
| 55 | typedef struct ca_caps { | 55 | struct ca_caps { |
| 56 | unsigned int slot_num; /* total number of CA card and module slots */ | 56 | unsigned int slot_num; /* total number of CA card and module slots */ |
| 57 | unsigned int slot_type; /* OR of all supported types */ | 57 | unsigned int slot_type; /* OR of all supported types */ |
| 58 | unsigned int descr_num; /* total number of descrambler slots (keys) */ | 58 | unsigned int descr_num; /* total number of descrambler slots (keys) */ |
| 59 | unsigned int descr_type; /* OR of all supported types */ | 59 | unsigned int descr_type; /* OR of all supported types */ |
| 60 | } ca_caps_t; | 60 | }; |
| 61 | 61 | ||
| 62 | /* a message to/from a CI-CAM */ | 62 | /* a message to/from a CI-CAM */ |
| 63 | typedef struct ca_msg { | 63 | struct ca_msg { |
| 64 | unsigned int index; | 64 | unsigned int index; |
| 65 | unsigned int type; | 65 | unsigned int type; |
| 66 | unsigned int length; | 66 | unsigned int length; |
| 67 | unsigned char msg[256]; | 67 | unsigned char msg[256]; |
| 68 | } ca_msg_t; | 68 | }; |
| 69 | 69 | ||
| 70 | typedef struct ca_descr { | 70 | struct ca_descr { |
| 71 | unsigned int index; | 71 | unsigned int index; |
| 72 | unsigned int parity; /* 0 == even, 1 == odd */ | 72 | unsigned int parity; /* 0 == even, 1 == odd */ |
| 73 | unsigned char cw[8]; | 73 | unsigned char cw[8]; |
| 74 | } ca_descr_t; | 74 | }; |
| 75 | 75 | ||
| 76 | typedef struct ca_pid { | 76 | struct ca_pid { |
| 77 | unsigned int pid; | 77 | unsigned int pid; |
| 78 | int index; /* -1 == disable*/ | 78 | int index; /* -1 == disable*/ |
| 79 | } ca_pid_t; | 79 | }; |
| 80 | 80 | ||
| 81 | #define CA_RESET _IO('o', 128) | 81 | #define CA_RESET _IO('o', 128) |
| 82 | #define CA_GET_CAP _IOR('o', 129, ca_caps_t) | 82 | #define CA_GET_CAP _IOR('o', 129, struct ca_caps) |
| 83 | #define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) | 83 | #define CA_GET_SLOT_INFO _IOR('o', 130, struct ca_slot_info) |
| 84 | #define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) | 84 | #define CA_GET_DESCR_INFO _IOR('o', 131, struct ca_descr_info) |
| 85 | #define CA_GET_MSG _IOR('o', 132, ca_msg_t) | 85 | #define CA_GET_MSG _IOR('o', 132, struct ca_msg) |
| 86 | #define CA_SEND_MSG _IOW('o', 133, ca_msg_t) | 86 | #define CA_SEND_MSG _IOW('o', 133, struct ca_msg) |
| 87 | #define CA_SET_DESCR _IOW('o', 134, ca_descr_t) | 87 | #define CA_SET_DESCR _IOW('o', 134, struct ca_descr) |
| 88 | #define CA_SET_PID _IOW('o', 135, ca_pid_t) | 88 | #define CA_SET_PID _IOW('o', 135, struct ca_pid) |
| 89 | |||
| 90 | #if !defined (__KERNEL__) | ||
| 91 | |||
| 92 | /* This is needed for legacy userspace support */ | ||
| 93 | typedef struct ca_slot_info ca_slot_info_t; | ||
| 94 | typedef struct ca_descr_info ca_descr_info_t; | ||
| 95 | typedef struct ca_caps ca_caps_t; | ||
| 96 | typedef struct ca_msg ca_msg_t; | ||
| 97 | typedef struct ca_descr ca_descr_t; | ||
| 98 | typedef struct ca_pid ca_pid_t; | ||
| 99 | |||
| 100 | #endif | ||
| 101 | |||
| 89 | 102 | ||
| 90 | #endif | 103 | #endif |
