aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-01 06:09:14 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-05 05:49:45 -0400
commit3256b36ea36525945d8575c0100752819a309aaa (patch)
treedbc64c98a67c07a242b412db4d4dc5d9e76d7ffe
parentc93022a72f01f8e53d6e1bc2a8d2c2824c2f36bc (diff)
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. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/dvb-core/dmxdev.c4
-rw-r--r--include/uapi/linux/dvb/dmx.h56
2 files changed, 35 insertions, 25 deletions
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 45e91add73ba..16b0b74c3114 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -562,7 +562,7 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev,
562{ 562{
563 ktime_t timeout = 0; 563 ktime_t timeout = 0;
564 struct dmx_pes_filter_params *para = &filter->params.pes; 564 struct dmx_pes_filter_params *para = &filter->params.pes;
565 dmx_output_t otype; 565 enum dmx_output otype;
566 int ret; 566 int ret;
567 int ts_type; 567 int ts_type;
568 enum dmx_ts_pes ts_pes; 568 enum dmx_ts_pes ts_pes;
@@ -787,7 +787,7 @@ static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev,
787 return 0; 787 return 0;
788} 788}
789 789
790static inline void invert_mode(dmx_filter_t *filter) 790static inline void invert_mode(struct dmx_filter *filter)
791{ 791{
792 int i; 792 int i;
793 793
diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h
index 427e4899ed69..1bc4d6fb0f01 100644
--- a/include/uapi/linux/dvb/dmx.h
+++ b/include/uapi/linux/dvb/dmx.h
@@ -43,16 +43,14 @@ enum dmx_output
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_pes 53enum 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
79 DMX_PES_PCR3, 77 DMX_PES_PCR3,
80 78
81 DMX_PES_OTHER 79 DMX_PES_OTHER
82} dmx_pes_type_t; 80};
83 81
84#define DMX_PES_AUDIO DMX_PES_AUDIO0 82#define DMX_PES_AUDIO DMX_PES_AUDIO0
85#define DMX_PES_VIDEO DMX_PES_VIDEO0 83#define DMX_PES_VIDEO DMX_PES_VIDEO0
@@ -88,20 +86,20 @@ typedef enum dmx_ts_pes
88#define DMX_PES_PCR DMX_PES_PCR0 86#define DMX_PES_PCR DMX_PES_PCR0
89 87
90 88
91typedef struct dmx_filter 89struct 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_params 97struct 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 1 103#define DMX_CHECK_CRC 1
106#define DMX_ONESHOT 2 104#define DMX_ONESHOT 2
107#define DMX_IMMEDIATE_START 4 105#define DMX_IMMEDIATE_START 4
@@ -111,19 +109,19 @@ struct dmx_sct_filter_params
111 109
112struct dmx_pes_filter_params 110struct 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 {
132 DMX_SOURCE_DVR1, 130 DMX_SOURCE_DVR1,
133 DMX_SOURCE_DVR2, 131 DMX_SOURCE_DVR2,
134 DMX_SOURCE_DVR3 132 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 {
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_ */