History

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.

Mauro Carvalho Chehab committed 9 years ago

Commit c93022a1 parent fce4b373 files · +39 −26Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/dvb/ca.h+32−19
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27/* slot interface types and info */27/* slot interface types and info */
28 28
29typedef struct ca_slot_info {29struct 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 { · 6 unmodified lines
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 241#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
47typedef struct ca_descr_info {47struct 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 150#define CA_ECD 1
51#define CA_NDS 251#define CA_NDS 2
52#define CA_DSS 452#define CA_DSS 4
53} ca_descr_info_t;53};
54 54
55typedef struct ca_caps {55struct 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 */
63typedef struct ca_msg {63struct 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
70typedef struct ca_descr {70struct 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
76typedef struct ca_pid {76struct 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 */
93typedef struct ca_slot_info ca_slot_info_t;
94typedef struct ca_descr_info ca_descr_info_t;
95typedef struct ca_caps ca_caps_t;
96typedef struct ca_msg ca_msg_t;
97typedef struct ca_descr ca_descr_t;
98typedef struct ca_pid ca_pid_t;
99
100#endif
101
89 102
90#endif103#endif