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
2626
2727 /* slot interface types and info */
2828
29−typedef struct ca_slot_info {
29+struct ca_slot_info {
3030 int num; /* slot number */
3131
3232 int type; /* CA interface this slot supports */
@@ -39,52 +39,65 @@ typedef struct ca_slot_info { · 6 unmodified lines
3939 unsigned int flags;
4040 #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
4141 #define CA_CI_MODULE_READY 2
42−} ca_slot_info_t;
42+};
4343
4444
4545 /* descrambler types and info */
4646
47−typedef struct ca_descr_info {
47+struct ca_descr_info {
4848 unsigned int num; /* number of available descramblers (keys) */
4949 unsigned int type; /* type of supported scrambling system */
5050 #define CA_ECD 1
5151 #define CA_NDS 2
5252 #define CA_DSS 4
53−} ca_descr_info_t;
53+};
5454
55−typedef struct ca_caps {
55+struct ca_caps {
5656 unsigned int slot_num; /* total number of CA card and module slots */
5757 unsigned int slot_type; /* OR of all supported types */
5858 unsigned int descr_num; /* total number of descrambler slots (keys) */
5959 unsigned int descr_type; /* OR of all supported types */
60−} ca_caps_t;
60+};
6161
6262 /* a message to/from a CI-CAM */
63−typedef struct ca_msg {
63+struct ca_msg {
6464 unsigned int index;
6565 unsigned int type;
6666 unsigned int length;
6767 unsigned char msg[256];
68−} ca_msg_t;
68+};
6969
70−typedef struct ca_descr {
70+struct ca_descr {
7171 unsigned int index;
7272 unsigned int parity; /* 0 == even, 1 == odd */
7373 unsigned char cw[8];
74−} ca_descr_t;
74+};
7575
76−typedef struct ca_pid {
76+struct ca_pid {
7777 unsigned int pid;
7878 int index; /* -1 == disable*/
79−} ca_pid_t;
79+};
8080
8181 #define CA_RESET _IO('o', 128)
82−#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
83−#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
84−#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
85−#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
86−#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
87−#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
88−#define CA_SET_PID _IOW('o', 135, ca_pid_t)
82+#define CA_GET_CAP _IOR('o', 129, struct ca_caps)
83+#define CA_GET_SLOT_INFO _IOR('o', 130, struct ca_slot_info)
84+#define CA_GET_DESCR_INFO _IOR('o', 131, struct ca_descr_info)
85+#define CA_GET_MSG _IOR('o', 132, struct ca_msg)
86+#define CA_SEND_MSG _IOW('o', 133, struct ca_msg)
87+#define CA_SET_DESCR _IOW('o', 134, struct ca_descr)
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+
89102
90103 #endif