History

media: dmx.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 3256b361 parent c93022a2 files · +35 −25Browse files

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

Unified · Split

include/uapi/linux/dvb/dmx.h+33−23
@@ -43,16 +43,14 @@ enum dmx_output · 42 unmodified lines
43 DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */43 DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
44};44};
45 45
46typedef enum dmx_output dmx_output_t;46enum dmx_input
47
48typedef enum dmx_input
49{47{
50 DMX_IN_FRONTEND, /* Input from a front-end device. */48 DMX_IN_FRONTEND, /* Input from a front-end device. */
51 DMX_IN_DVR /* Input from the logical DVR device. */49 DMX_IN_DVR /* Input from the logical DVR device. */
52} dmx_input_t;50};
53 51
54 52
55typedef enum dmx_ts_pes53enum dmx_ts_pes
56{54{
57 DMX_PES_AUDIO0,55 DMX_PES_AUDIO0,
58 DMX_PES_VIDEO0,56 DMX_PES_VIDEO0,
@@ -79,7 +77,7 @@ typedef enum dmx_ts_pes · 20 unmodified lines
79 DMX_PES_PCR3,77 DMX_PES_PCR3,
80 78
81 DMX_PES_OTHER79 DMX_PES_OTHER
82} dmx_pes_type_t;80};
83 81
84#define DMX_PES_AUDIO DMX_PES_AUDIO082#define DMX_PES_AUDIO DMX_PES_AUDIO0
85#define DMX_PES_VIDEO DMX_PES_VIDEO083#define DMX_PES_VIDEO DMX_PES_VIDEO0
@@ -88,20 +86,20 @@ typedef enum dmx_ts_pes · 2 unmodified lines
88#define DMX_PES_PCR DMX_PES_PCR086#define DMX_PES_PCR DMX_PES_PCR0
89 87
90 88
91typedef struct dmx_filter89struct dmx_filter
92{90{
93 __u8 filter[DMX_FILTER_SIZE];91 __u8 filter[DMX_FILTER_SIZE];
94 __u8 mask[DMX_FILTER_SIZE];92 __u8 mask[DMX_FILTER_SIZE];
95 __u8 mode[DMX_FILTER_SIZE];93 __u8 mode[DMX_FILTER_SIZE];
96} dmx_filter_t;94};
97 95
98 96
99struct dmx_sct_filter_params97struct dmx_sct_filter_params
100{98{
101 __u16 pid;99 __u16 pid;
102 dmx_filter_t filter;100 struct dmx_filter filter;
103 __u32 timeout;101 __u32 timeout;
104 __u32 flags;102 __u32 flags;
105#define DMX_CHECK_CRC 1103#define DMX_CHECK_CRC 1
106#define DMX_ONESHOT 2104#define DMX_ONESHOT 2
107#define DMX_IMMEDIATE_START 4105#define DMX_IMMEDIATE_START 4
@@ -111,19 +109,19 @@ struct dmx_sct_filter_params · 3 unmodified lines
111 109
112struct dmx_pes_filter_params110struct dmx_pes_filter_params
113{111{
114 __u16 pid;112 __u16 pid;
115 dmx_input_t input;113 enum dmx_input input;
116 dmx_output_t output;114 enum dmx_output output;
117 dmx_pes_type_t pes_type;115 enum dmx_ts_pes pes_type;
118 __u32 flags;116 __u32 flags;
119};117};
120 118
121typedef struct dmx_caps {119struct dmx_caps {
122 __u32 caps;120 __u32 caps;
123 int num_decoders;121 int num_decoders;
124} dmx_caps_t;122};
125 123
126typedef enum dmx_source {124enum dmx_source {
127 DMX_SOURCE_FRONT0 = 0,125 DMX_SOURCE_FRONT0 = 0,
128 DMX_SOURCE_FRONT1,126 DMX_SOURCE_FRONT1,
129 DMX_SOURCE_FRONT2,127 DMX_SOURCE_FRONT2,
@@ -132,7 +130,7 @@ typedef enum dmx_source { · 2 unmodified lines
132 DMX_SOURCE_DVR1,130 DMX_SOURCE_DVR1,
133 DMX_SOURCE_DVR2,131 DMX_SOURCE_DVR2,
134 DMX_SOURCE_DVR3132 DMX_SOURCE_DVR3
135} dmx_source_t;133};
136 134
137struct dmx_stc {135struct dmx_stc {
138 unsigned int num; /* input : which STC? 0..N */136 unsigned int num; /* input : which STC? 0..N */
@@ -146,10 +144,22 @@ struct dmx_stc { · 7 unmodified lines
146#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)144#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
147#define DMX_SET_BUFFER_SIZE _IO('o', 45)145#define DMX_SET_BUFFER_SIZE _IO('o', 45)
148#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])146#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
149#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)147#define DMX_GET_CAPS _IOR('o', 48, struct dmx_caps)
150#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)148#define DMX_SET_SOURCE _IOW('o', 49, enum dmx_source)
151#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)149#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
152#define DMX_ADD_PID _IOW('o', 51, __u16)150#define DMX_ADD_PID _IOW('o', 51, __u16)
153#define DMX_REMOVE_PID _IOW('o', 52, __u16)151#define DMX_REMOVE_PID _IOW('o', 52, __u16)
154 152
153#if !defined (__KERNEL__)
154
155/* This is needed for legacy userspace support */
156typedef enum dmx_output dmx_output_t;
157typedef enum dmx_input dmx_input_t;
158typedef enum dmx_ts_pes dmx_pes_type_t;
159typedef struct dmx_filter dmx_filter_t;
160typedef struct dmx_caps dmx_caps_t;
161typedef enum dmx_source dmx_source_t;
162
163#endif
164
155#endif /* _UAPI_DVBDMX_H_ */165#endif /* _UAPI_DVBDMX_H_ */