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.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | /* slot interface types and info */ |
| 28 | 28 | |
| 29 | −typedef struct ca_slot_info { | |
| 29 | +struct ca_slot_info { | |
| 30 | 30 | int num; /* slot number */ |
| 31 | 31 | |
| 32 | 32 | int type; /* CA interface this slot supports */ |
| @@ -39,52 +39,65 @@ typedef struct ca_slot_info { · 6 unmodified lines | ||
| 39 | 39 | unsigned int flags; |
| 40 | 40 | #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ |
| 41 | 41 | #define CA_CI_MODULE_READY 2 |
| 42 | −} ca_slot_info_t; | |
| 42 | +}; | |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /* descrambler types and info */ |
| 46 | 46 | |
| 47 | −typedef struct ca_descr_info { | |
| 47 | +struct ca_descr_info { | |
| 48 | 48 | unsigned int num; /* number of available descramblers (keys) */ |
| 49 | 49 | unsigned int type; /* type of supported scrambling system */ |
| 50 | 50 | #define CA_ECD 1 |
| 51 | 51 | #define CA_NDS 2 |
| 52 | 52 | #define CA_DSS 4 |
| 53 | −} ca_descr_info_t; | |
| 53 | +}; | |
| 54 | 54 | |
| 55 | −typedef struct ca_caps { | |
| 55 | +struct ca_caps { | |
| 56 | 56 | unsigned int slot_num; /* total number of CA card and module slots */ |
| 57 | 57 | unsigned int slot_type; /* OR of all supported types */ |
| 58 | 58 | unsigned int descr_num; /* total number of descrambler slots (keys) */ |
| 59 | 59 | unsigned int descr_type; /* OR of all supported types */ |
| 60 | −} ca_caps_t; | |
| 60 | +}; | |
| 61 | 61 | |
| 62 | 62 | /* a message to/from a CI-CAM */ |
| 63 | −typedef struct ca_msg { | |
| 63 | +struct ca_msg { | |
| 64 | 64 | unsigned int index; |
| 65 | 65 | unsigned int type; |
| 66 | 66 | unsigned int length; |
| 67 | 67 | unsigned char msg[256]; |
| 68 | −} ca_msg_t; | |
| 68 | +}; | |
| 69 | 69 | |
| 70 | −typedef struct ca_descr { | |
| 70 | +struct ca_descr { | |
| 71 | 71 | unsigned int index; |
| 72 | 72 | unsigned int parity; /* 0 == even, 1 == odd */ |
| 73 | 73 | unsigned char cw[8]; |
| 74 | −} ca_descr_t; | |
| 74 | +}; | |
| 75 | 75 | |
| 76 | −typedef struct ca_pid { | |
| 76 | +struct ca_pid { | |
| 77 | 77 | unsigned int pid; |
| 78 | 78 | int index; /* -1 == disable*/ |
| 79 | −} ca_pid_t; | |
| 79 | +}; | |
| 80 | 80 | |
| 81 | 81 | #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 | + | |
| 89 | 102 | |
| 90 | 103 | #endif |