diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-12-12 03:37:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-12 11:57:44 -0500 |
commit | afd1a0c9ac281eed3b22b293ccd92af7b0d60889 (patch) | |
tree | 686c03cf1a1a2efb1fba6dc6e682fbb48edc7c58 /drivers/media/dvb | |
parent | 808824b5f73e361503420ee318ca9689781da034 (diff) |
[PATCH] V4L/DVB: (3086c) Whitespaces cleanups part 3
Clean up whitespaces at v4l/dvb files
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/demux.h | 92 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dmxdev.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dmxdev.h | 64 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_filter.c | 332 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_filter.h | 102 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 8 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.h | 8 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_net.c | 42 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ringbuffer.c | 262 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ringbuffer.h | 20 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 142 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.h | 6 |
13 files changed, 541 insertions, 541 deletions
diff --git a/drivers/media/dvb/dvb-core/demux.h b/drivers/media/dvb/dvb-core/demux.h index 7d7b0067f228..9f025825b2d2 100644 --- a/drivers/media/dvb/dvb-core/demux.h +++ b/drivers/media/dvb/dvb-core/demux.h | |||
@@ -86,25 +86,25 @@ enum dmx_success { | |||
86 | 86 | ||
87 | enum dmx_ts_pes | 87 | enum dmx_ts_pes |
88 | { /* also send packets to decoder (if it exists) */ | 88 | { /* also send packets to decoder (if it exists) */ |
89 | DMX_TS_PES_AUDIO0, | 89 | DMX_TS_PES_AUDIO0, |
90 | DMX_TS_PES_VIDEO0, | 90 | DMX_TS_PES_VIDEO0, |
91 | DMX_TS_PES_TELETEXT0, | 91 | DMX_TS_PES_TELETEXT0, |
92 | DMX_TS_PES_SUBTITLE0, | 92 | DMX_TS_PES_SUBTITLE0, |
93 | DMX_TS_PES_PCR0, | 93 | DMX_TS_PES_PCR0, |
94 | 94 | ||
95 | DMX_TS_PES_AUDIO1, | 95 | DMX_TS_PES_AUDIO1, |
96 | DMX_TS_PES_VIDEO1, | 96 | DMX_TS_PES_VIDEO1, |
97 | DMX_TS_PES_TELETEXT1, | 97 | DMX_TS_PES_TELETEXT1, |
98 | DMX_TS_PES_SUBTITLE1, | 98 | DMX_TS_PES_SUBTITLE1, |
99 | DMX_TS_PES_PCR1, | 99 | DMX_TS_PES_PCR1, |
100 | 100 | ||
101 | DMX_TS_PES_AUDIO2, | 101 | DMX_TS_PES_AUDIO2, |
102 | DMX_TS_PES_VIDEO2, | 102 | DMX_TS_PES_VIDEO2, |
103 | DMX_TS_PES_TELETEXT2, | 103 | DMX_TS_PES_TELETEXT2, |
104 | DMX_TS_PES_SUBTITLE2, | 104 | DMX_TS_PES_SUBTITLE2, |
105 | DMX_TS_PES_PCR2, | 105 | DMX_TS_PES_PCR2, |
106 | 106 | ||
107 | DMX_TS_PES_AUDIO3, | 107 | DMX_TS_PES_AUDIO3, |
108 | DMX_TS_PES_VIDEO3, | 108 | DMX_TS_PES_VIDEO3, |
109 | DMX_TS_PES_TELETEXT3, | 109 | DMX_TS_PES_TELETEXT3, |
110 | DMX_TS_PES_SUBTITLE3, | 110 | DMX_TS_PES_SUBTITLE3, |
@@ -121,17 +121,17 @@ enum dmx_ts_pes | |||
121 | 121 | ||
122 | 122 | ||
123 | struct dmx_ts_feed { | 123 | struct dmx_ts_feed { |
124 | int is_filtering; /* Set to non-zero when filtering in progress */ | 124 | int is_filtering; /* Set to non-zero when filtering in progress */ |
125 | struct dmx_demux *parent; /* Back-pointer */ | 125 | struct dmx_demux *parent; /* Back-pointer */ |
126 | void *priv; /* Pointer to private data of the API client */ | 126 | void *priv; /* Pointer to private data of the API client */ |
127 | int (*set) (struct dmx_ts_feed *feed, | 127 | int (*set) (struct dmx_ts_feed *feed, |
128 | u16 pid, | 128 | u16 pid, |
129 | int type, | 129 | int type, |
130 | enum dmx_ts_pes pes_type, | 130 | enum dmx_ts_pes pes_type, |
131 | size_t circular_buffer_size, | 131 | size_t circular_buffer_size, |
132 | struct timespec timeout); | 132 | struct timespec timeout); |
133 | int (*start_filtering) (struct dmx_ts_feed* feed); | 133 | int (*start_filtering) (struct dmx_ts_feed* feed); |
134 | int (*stop_filtering) (struct dmx_ts_feed* feed); | 134 | int (*stop_filtering) (struct dmx_ts_feed* feed); |
135 | }; | 135 | }; |
136 | 136 | ||
137 | /*--------------------------------------------------------------------------*/ | 137 | /*--------------------------------------------------------------------------*/ |
@@ -139,35 +139,35 @@ struct dmx_ts_feed { | |||
139 | /*--------------------------------------------------------------------------*/ | 139 | /*--------------------------------------------------------------------------*/ |
140 | 140 | ||
141 | struct dmx_section_filter { | 141 | struct dmx_section_filter { |
142 | u8 filter_value [DMX_MAX_FILTER_SIZE]; | 142 | u8 filter_value [DMX_MAX_FILTER_SIZE]; |
143 | u8 filter_mask [DMX_MAX_FILTER_SIZE]; | 143 | u8 filter_mask [DMX_MAX_FILTER_SIZE]; |
144 | u8 filter_mode [DMX_MAX_FILTER_SIZE]; | 144 | u8 filter_mode [DMX_MAX_FILTER_SIZE]; |
145 | struct dmx_section_feed* parent; /* Back-pointer */ | 145 | struct dmx_section_feed* parent; /* Back-pointer */ |
146 | void* priv; /* Pointer to private data of the API client */ | 146 | void* priv; /* Pointer to private data of the API client */ |
147 | }; | 147 | }; |
148 | 148 | ||
149 | struct dmx_section_feed { | 149 | struct dmx_section_feed { |
150 | int is_filtering; /* Set to non-zero when filtering in progress */ | 150 | int is_filtering; /* Set to non-zero when filtering in progress */ |
151 | struct dmx_demux* parent; /* Back-pointer */ | 151 | struct dmx_demux* parent; /* Back-pointer */ |
152 | void* priv; /* Pointer to private data of the API client */ | 152 | void* priv; /* Pointer to private data of the API client */ |
153 | 153 | ||
154 | int check_crc; | 154 | int check_crc; |
155 | u32 crc_val; | 155 | u32 crc_val; |
156 | 156 | ||
157 | u8 *secbuf; | 157 | u8 *secbuf; |
158 | u8 secbuf_base[DMX_MAX_SECFEED_SIZE]; | 158 | u8 secbuf_base[DMX_MAX_SECFEED_SIZE]; |
159 | u16 secbufp, seclen, tsfeedp; | 159 | u16 secbufp, seclen, tsfeedp; |
160 | 160 | ||
161 | int (*set) (struct dmx_section_feed* feed, | 161 | int (*set) (struct dmx_section_feed* feed, |
162 | u16 pid, | 162 | u16 pid, |
163 | size_t circular_buffer_size, | 163 | size_t circular_buffer_size, |
164 | int check_crc); | 164 | int check_crc); |
165 | int (*allocate_filter) (struct dmx_section_feed* feed, | 165 | int (*allocate_filter) (struct dmx_section_feed* feed, |
166 | struct dmx_section_filter** filter); | 166 | struct dmx_section_filter** filter); |
167 | int (*release_filter) (struct dmx_section_feed* feed, | 167 | int (*release_filter) (struct dmx_section_feed* feed, |
168 | struct dmx_section_filter* filter); | 168 | struct dmx_section_filter* filter); |
169 | int (*start_filtering) (struct dmx_section_feed* feed); | 169 | int (*start_filtering) (struct dmx_section_feed* feed); |
170 | int (*stop_filtering) (struct dmx_section_feed* feed); | 170 | int (*stop_filtering) (struct dmx_section_feed* feed); |
171 | }; | 171 | }; |
172 | 172 | ||
173 | /*--------------------------------------------------------------------------*/ | 173 | /*--------------------------------------------------------------------------*/ |
@@ -205,10 +205,10 @@ enum dmx_frontend_source { | |||
205 | }; | 205 | }; |
206 | 206 | ||
207 | struct dmx_frontend { | 207 | struct dmx_frontend { |
208 | struct list_head connectivity_list; /* List of front-ends that can | 208 | struct list_head connectivity_list; /* List of front-ends that can |
209 | be connected to a particular | 209 | be connected to a particular |
210 | demux */ | 210 | demux */ |
211 | enum dmx_frontend_source source; | 211 | enum dmx_frontend_source source; |
212 | }; | 212 | }; |
213 | 213 | ||
214 | /*--------------------------------------------------------------------------*/ | 214 | /*--------------------------------------------------------------------------*/ |
@@ -240,38 +240,38 @@ struct dmx_frontend { | |||
240 | #define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) | 240 | #define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) |
241 | 241 | ||
242 | struct dmx_demux { | 242 | struct dmx_demux { |
243 | u32 capabilities; /* Bitfield of capability flags */ | 243 | u32 capabilities; /* Bitfield of capability flags */ |
244 | struct dmx_frontend* frontend; /* Front-end connected to the demux */ | 244 | struct dmx_frontend* frontend; /* Front-end connected to the demux */ |
245 | void* priv; /* Pointer to private data of the API client */ | 245 | void* priv; /* Pointer to private data of the API client */ |
246 | int (*open) (struct dmx_demux* demux); | 246 | int (*open) (struct dmx_demux* demux); |
247 | int (*close) (struct dmx_demux* demux); | 247 | int (*close) (struct dmx_demux* demux); |
248 | int (*write) (struct dmx_demux* demux, const char* buf, size_t count); | 248 | int (*write) (struct dmx_demux* demux, const char* buf, size_t count); |
249 | int (*allocate_ts_feed) (struct dmx_demux* demux, | 249 | int (*allocate_ts_feed) (struct dmx_demux* demux, |
250 | struct dmx_ts_feed** feed, | 250 | struct dmx_ts_feed** feed, |
251 | dmx_ts_cb callback); | 251 | dmx_ts_cb callback); |
252 | int (*release_ts_feed) (struct dmx_demux* demux, | 252 | int (*release_ts_feed) (struct dmx_demux* demux, |
253 | struct dmx_ts_feed* feed); | 253 | struct dmx_ts_feed* feed); |
254 | int (*allocate_section_feed) (struct dmx_demux* demux, | 254 | int (*allocate_section_feed) (struct dmx_demux* demux, |
255 | struct dmx_section_feed** feed, | 255 | struct dmx_section_feed** feed, |
256 | dmx_section_cb callback); | 256 | dmx_section_cb callback); |
257 | int (*release_section_feed) (struct dmx_demux* demux, | 257 | int (*release_section_feed) (struct dmx_demux* demux, |
258 | struct dmx_section_feed* feed); | 258 | struct dmx_section_feed* feed); |
259 | int (*add_frontend) (struct dmx_demux* demux, | 259 | int (*add_frontend) (struct dmx_demux* demux, |
260 | struct dmx_frontend* frontend); | 260 | struct dmx_frontend* frontend); |
261 | int (*remove_frontend) (struct dmx_demux* demux, | 261 | int (*remove_frontend) (struct dmx_demux* demux, |
262 | struct dmx_frontend* frontend); | 262 | struct dmx_frontend* frontend); |
263 | struct list_head* (*get_frontends) (struct dmx_demux* demux); | 263 | struct list_head* (*get_frontends) (struct dmx_demux* demux); |
264 | int (*connect_frontend) (struct dmx_demux* demux, | 264 | int (*connect_frontend) (struct dmx_demux* demux, |
265 | struct dmx_frontend* frontend); | 265 | struct dmx_frontend* frontend); |
266 | int (*disconnect_frontend) (struct dmx_demux* demux); | 266 | int (*disconnect_frontend) (struct dmx_demux* demux); |
267 | 267 | ||
268 | int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); | 268 | int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); |
269 | 269 | ||
270 | int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps); | 270 | int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps); |
271 | 271 | ||
272 | int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src); | 272 | int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src); |
273 | 273 | ||
274 | int (*get_stc) (struct dmx_demux* demux, unsigned int num, | 274 | int (*get_stc) (struct dmx_demux* demux, unsigned int num, |
275 | u64 *stc, unsigned int *base); | 275 | u64 *stc, unsigned int *base); |
276 | }; | 276 | }; |
277 | 277 | ||
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index 8028c3a5e287..7b8373ad121b 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -947,7 +947,7 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, | |||
947 | 947 | ||
948 | case DMX_GET_STC: | 948 | case DMX_GET_STC: |
949 | if (!dmxdev->demux->get_stc) { | 949 | if (!dmxdev->demux->get_stc) { |
950 | ret=-EINVAL; | 950 | ret=-EINVAL; |
951 | break; | 951 | break; |
952 | } | 952 | } |
953 | ret = dmxdev->demux->get_stc(dmxdev->demux, | 953 | ret = dmxdev->demux->get_stc(dmxdev->demux, |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.h b/drivers/media/dvb/dvb-core/dmxdev.h index 395a9cd75012..fd72920c2199 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.h +++ b/drivers/media/dvb/dvb-core/dmxdev.h | |||
@@ -53,51 +53,51 @@ enum dmxdev_state { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct dmxdev_buffer { | 55 | struct dmxdev_buffer { |
56 | u8 *data; | 56 | u8 *data; |
57 | int size; | 57 | int size; |
58 | int pread; | 58 | int pread; |
59 | int pwrite; | 59 | int pwrite; |
60 | wait_queue_head_t queue; | 60 | wait_queue_head_t queue; |
61 | int error; | 61 | int error; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | struct dmxdev_filter { | 64 | struct dmxdev_filter { |
65 | struct dvb_device *dvbdev; | 65 | struct dvb_device *dvbdev; |
66 | 66 | ||
67 | union { | 67 | union { |
68 | struct dmx_section_filter *sec; | 68 | struct dmx_section_filter *sec; |
69 | } filter; | 69 | } filter; |
70 | 70 | ||
71 | union { | 71 | union { |
72 | struct dmx_ts_feed *ts; | 72 | struct dmx_ts_feed *ts; |
73 | struct dmx_section_feed *sec; | 73 | struct dmx_section_feed *sec; |
74 | } feed; | 74 | } feed; |
75 | 75 | ||
76 | union { | 76 | union { |
77 | struct dmx_sct_filter_params sec; | 77 | struct dmx_sct_filter_params sec; |
78 | struct dmx_pes_filter_params pes; | 78 | struct dmx_pes_filter_params pes; |
79 | } params; | 79 | } params; |
80 | 80 | ||
81 | int type; | 81 | int type; |
82 | enum dmxdev_state state; | 82 | enum dmxdev_state state; |
83 | struct dmxdev *dev; | 83 | struct dmxdev *dev; |
84 | struct dmxdev_buffer buffer; | 84 | struct dmxdev_buffer buffer; |
85 | 85 | ||
86 | struct semaphore mutex; | 86 | struct semaphore mutex; |
87 | 87 | ||
88 | /* only for sections */ | 88 | /* only for sections */ |
89 | struct timer_list timer; | 89 | struct timer_list timer; |
90 | int todo; | 90 | int todo; |
91 | u8 secheader[3]; | 91 | u8 secheader[3]; |
92 | 92 | ||
93 | u16 pid; | 93 | u16 pid; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | 96 | ||
97 | struct dmxdev_dvr { | 97 | struct dmxdev_dvr { |
98 | int state; | 98 | int state; |
99 | struct dmxdev *dev; | 99 | struct dmxdev *dev; |
100 | struct dmxdev_buffer buffer; | 100 | struct dmxdev_buffer buffer; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | 103 | ||
@@ -105,16 +105,16 @@ struct dmxdev { | |||
105 | struct dvb_device *dvbdev; | 105 | struct dvb_device *dvbdev; |
106 | struct dvb_device *dvr_dvbdev; | 106 | struct dvb_device *dvr_dvbdev; |
107 | 107 | ||
108 | struct dmxdev_filter *filter; | 108 | struct dmxdev_filter *filter; |
109 | struct dmxdev_dvr *dvr; | 109 | struct dmxdev_dvr *dvr; |
110 | struct dmx_demux *demux; | 110 | struct dmx_demux *demux; |
111 | 111 | ||
112 | int filternum; | 112 | int filternum; |
113 | int capabilities; | 113 | int capabilities; |
114 | #define DMXDEV_CAP_DUPLEX 1 | 114 | #define DMXDEV_CAP_DUPLEX 1 |
115 | struct dmx_frontend *dvr_orig_fe; | 115 | struct dmx_frontend *dvr_orig_fe; |
116 | 116 | ||
117 | struct dmxdev_buffer dvr_buffer; | 117 | struct dmxdev_buffer dvr_buffer; |
118 | #define DVR_BUFFER_SIZE (10*188*1024) | 118 | #define DVR_BUFFER_SIZE (10*188*1024) |
119 | 119 | ||
120 | struct semaphore mutex; | 120 | struct semaphore mutex; |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index cb2e7d6ba283..5956c35d34ac 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
@@ -498,7 +498,7 @@ static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) | |||
498 | /* process the CFTABLE_ENTRY tuples, and any after those */ | 498 | /* process the CFTABLE_ENTRY tuples, and any after those */ |
499 | while ((!end_chain) && (address < 0x1000)) { | 499 | while ((!end_chain) && (address < 0x1000)) { |
500 | if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, | 500 | if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, |
501 | &tupleLength, tuple)) < 0) | 501 | &tupleLength, tuple)) < 0) |
502 | return status; | 502 | return status; |
503 | switch (tupleType) { | 503 | switch (tupleType) { |
504 | case 0x1B: // CISTPL_CFTABLE_ENTRY | 504 | case 0x1B: // CISTPL_CFTABLE_ENTRY |
diff --git a/drivers/media/dvb/dvb-core/dvb_filter.c b/drivers/media/dvb/dvb-core/dvb_filter.c index bd5143906084..c49fd0bd7181 100644 --- a/drivers/media/dvb/dvb-core/dvb_filter.c +++ b/drivers/media/dvb/dvb-core/dvb_filter.c | |||
@@ -72,12 +72,12 @@ static int read_picture_header(u8 *headr, struct mpg_picture *pic, int field, in | |||
72 | u8 pct; | 72 | u8 pct; |
73 | 73 | ||
74 | if (pr) printk( "Pic header: "); | 74 | if (pr) printk( "Pic header: "); |
75 | pic->temporal_reference[field] = (( headr[0] << 2 ) | | 75 | pic->temporal_reference[field] = (( headr[0] << 2 ) | |
76 | (headr[1] & 0x03) )& 0x03ff; | 76 | (headr[1] & 0x03) )& 0x03ff; |
77 | if (pr) printk( " temp ref: 0x%04x", pic->temporal_reference[field]); | 77 | if (pr) printk( " temp ref: 0x%04x", pic->temporal_reference[field]); |
78 | 78 | ||
79 | pct = ( headr[1] >> 2 ) & 0x07; | 79 | pct = ( headr[1] >> 2 ) & 0x07; |
80 | pic->picture_coding_type[field] = pct; | 80 | pic->picture_coding_type[field] = pct; |
81 | if (pr) { | 81 | if (pr) { |
82 | switch(pct){ | 82 | switch(pct){ |
83 | case I_FRAME: | 83 | case I_FRAME: |
@@ -93,17 +93,17 @@ static int read_picture_header(u8 *headr, struct mpg_picture *pic, int field, in | |||
93 | } | 93 | } |
94 | 94 | ||
95 | 95 | ||
96 | pic->vinfo.vbv_delay = (( headr[1] >> 5 ) | ( headr[2] << 3) | | 96 | pic->vinfo.vbv_delay = (( headr[1] >> 5 ) | ( headr[2] << 3) | |
97 | ( (headr[3] & 0x1F) << 11) ) & 0xffff; | 97 | ( (headr[3] & 0x1F) << 11) ) & 0xffff; |
98 | 98 | ||
99 | if (pr) printk( " vbv delay: 0x%04x", pic->vinfo.vbv_delay); | 99 | if (pr) printk( " vbv delay: 0x%04x", pic->vinfo.vbv_delay); |
100 | 100 | ||
101 | pic->picture_header_parameter = ( headr[3] & 0xe0 ) | | 101 | pic->picture_header_parameter = ( headr[3] & 0xe0 ) | |
102 | ((headr[4] & 0x80) >> 3); | 102 | ((headr[4] & 0x80) >> 3); |
103 | 103 | ||
104 | if ( pct == B_FRAME ){ | 104 | if ( pct == B_FRAME ){ |
105 | pic->picture_header_parameter |= ( headr[4] >> 3 ) & 0x0f; | 105 | pic->picture_header_parameter |= ( headr[4] >> 3 ) & 0x0f; |
106 | } | 106 | } |
107 | if (pr) printk( " pic head param: 0x%x", | 107 | if (pr) printk( " pic head param: 0x%x", |
108 | pic->picture_header_parameter); | 108 | pic->picture_header_parameter); |
109 | 109 | ||
@@ -124,18 +124,18 @@ static int read_gop_header(u8 *headr, struct mpg_picture *pic, int pr) | |||
124 | ((headr[0]<<4)& 0x30)| ((headr[1]>>4)& 0x0F), | 124 | ((headr[0]<<4)& 0x30)| ((headr[1]>>4)& 0x0F), |
125 | ((headr[1]<<3)& 0x38)| ((headr[2]>>5)& 0x0F)); | 125 | ((headr[1]<<3)& 0x38)| ((headr[2]>>5)& 0x0F)); |
126 | 126 | ||
127 | if ( ( headr[3] & 0x40 ) != 0 ){ | 127 | if ( ( headr[3] & 0x40 ) != 0 ){ |
128 | pic->closed_gop = 1; | 128 | pic->closed_gop = 1; |
129 | } else { | 129 | } else { |
130 | pic->closed_gop = 0; | 130 | pic->closed_gop = 0; |
131 | } | 131 | } |
132 | if (pr) printk("closed: %d", pic->closed_gop); | 132 | if (pr) printk("closed: %d", pic->closed_gop); |
133 | 133 | ||
134 | if ( ( headr[3] & 0x20 ) != 0 ){ | 134 | if ( ( headr[3] & 0x20 ) != 0 ){ |
135 | pic->broken_link = 1; | 135 | pic->broken_link = 1; |
136 | } else { | 136 | } else { |
137 | pic->broken_link = 0; | 137 | pic->broken_link = 0; |
138 | } | 138 | } |
139 | if (pr) printk(" broken: %d\n", pic->broken_link); | 139 | if (pr) printk(" broken: %d\n", pic->broken_link); |
140 | 140 | ||
141 | return 0; | 141 | return 0; |
@@ -146,7 +146,7 @@ static int read_gop_header(u8 *headr, struct mpg_picture *pic, int pr) | |||
146 | /* needs 8 byte input */ | 146 | /* needs 8 byte input */ |
147 | static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) | 147 | static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) |
148 | { | 148 | { |
149 | int sw; | 149 | int sw; |
150 | int form = -1; | 150 | int form = -1; |
151 | 151 | ||
152 | if (pr) printk("Reading sequence header\n"); | 152 | if (pr) printk("Reading sequence header\n"); |
@@ -154,9 +154,9 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) | |||
154 | vi->horizontal_size = ((headr[1] &0xF0) >> 4) | (headr[0] << 4); | 154 | vi->horizontal_size = ((headr[1] &0xF0) >> 4) | (headr[0] << 4); |
155 | vi->vertical_size = ((headr[1] &0x0F) << 8) | (headr[2]); | 155 | vi->vertical_size = ((headr[1] &0x0F) << 8) | (headr[2]); |
156 | 156 | ||
157 | sw = (int)((headr[3]&0xF0) >> 4) ; | 157 | sw = (int)((headr[3]&0xF0) >> 4) ; |
158 | 158 | ||
159 | switch( sw ){ | 159 | switch( sw ){ |
160 | case 1: | 160 | case 1: |
161 | if (pr) | 161 | if (pr) |
162 | printk("Videostream: ASPECT: 1:1"); | 162 | printk("Videostream: ASPECT: 1:1"); |
@@ -165,84 +165,84 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) | |||
165 | case 2: | 165 | case 2: |
166 | if (pr) | 166 | if (pr) |
167 | printk("Videostream: ASPECT: 4:3"); | 167 | printk("Videostream: ASPECT: 4:3"); |
168 | vi->aspect_ratio = 133; | 168 | vi->aspect_ratio = 133; |
169 | break; | 169 | break; |
170 | case 3: | 170 | case 3: |
171 | if (pr) | 171 | if (pr) |
172 | printk("Videostream: ASPECT: 16:9"); | 172 | printk("Videostream: ASPECT: 16:9"); |
173 | vi->aspect_ratio = 177; | 173 | vi->aspect_ratio = 177; |
174 | break; | 174 | break; |
175 | case 4: | 175 | case 4: |
176 | if (pr) | 176 | if (pr) |
177 | printk("Videostream: ASPECT: 2.21:1"); | 177 | printk("Videostream: ASPECT: 2.21:1"); |
178 | vi->aspect_ratio = 221; | 178 | vi->aspect_ratio = 221; |
179 | break; | 179 | break; |
180 | 180 | ||
181 | case 5 ... 15: | 181 | case 5 ... 15: |
182 | if (pr) | 182 | if (pr) |
183 | printk("Videostream: ASPECT: reserved"); | 183 | printk("Videostream: ASPECT: reserved"); |
184 | vi->aspect_ratio = 0; | 184 | vi->aspect_ratio = 0; |
185 | break; | 185 | break; |
186 | 186 | ||
187 | default: | 187 | default: |
188 | vi->aspect_ratio = 0; | 188 | vi->aspect_ratio = 0; |
189 | return -1; | 189 | return -1; |
190 | } | 190 | } |
191 | 191 | ||
192 | if (pr) | 192 | if (pr) |
193 | printk(" Size = %dx%d",vi->horizontal_size,vi->vertical_size); | 193 | printk(" Size = %dx%d",vi->horizontal_size,vi->vertical_size); |
194 | 194 | ||
195 | sw = (int)(headr[3]&0x0F); | 195 | sw = (int)(headr[3]&0x0F); |
196 | 196 | ||
197 | switch ( sw ) { | 197 | switch ( sw ) { |
198 | case 1: | 198 | case 1: |
199 | if (pr) | 199 | if (pr) |
200 | printk(" FRate: 23.976 fps"); | 200 | printk(" FRate: 23.976 fps"); |
201 | vi->framerate = 23976; | 201 | vi->framerate = 23976; |
202 | form = -1; | 202 | form = -1; |
203 | break; | 203 | break; |
204 | case 2: | 204 | case 2: |
205 | if (pr) | 205 | if (pr) |
206 | printk(" FRate: 24 fps"); | 206 | printk(" FRate: 24 fps"); |
207 | vi->framerate = 24000; | 207 | vi->framerate = 24000; |
208 | form = -1; | 208 | form = -1; |
209 | break; | 209 | break; |
210 | case 3: | 210 | case 3: |
211 | if (pr) | 211 | if (pr) |
212 | printk(" FRate: 25 fps"); | 212 | printk(" FRate: 25 fps"); |
213 | vi->framerate = 25000; | 213 | vi->framerate = 25000; |
214 | form = VIDEO_MODE_PAL; | 214 | form = VIDEO_MODE_PAL; |
215 | break; | 215 | break; |
216 | case 4: | 216 | case 4: |
217 | if (pr) | 217 | if (pr) |
218 | printk(" FRate: 29.97 fps"); | 218 | printk(" FRate: 29.97 fps"); |
219 | vi->framerate = 29970; | 219 | vi->framerate = 29970; |
220 | form = VIDEO_MODE_NTSC; | 220 | form = VIDEO_MODE_NTSC; |
221 | break; | 221 | break; |
222 | case 5: | 222 | case 5: |
223 | if (pr) | 223 | if (pr) |
224 | printk(" FRate: 30 fps"); | 224 | printk(" FRate: 30 fps"); |
225 | vi->framerate = 30000; | 225 | vi->framerate = 30000; |
226 | form = VIDEO_MODE_NTSC; | 226 | form = VIDEO_MODE_NTSC; |
227 | break; | 227 | break; |
228 | case 6: | 228 | case 6: |
229 | if (pr) | 229 | if (pr) |
230 | printk(" FRate: 50 fps"); | 230 | printk(" FRate: 50 fps"); |
231 | vi->framerate = 50000; | 231 | vi->framerate = 50000; |
232 | form = VIDEO_MODE_PAL; | 232 | form = VIDEO_MODE_PAL; |
233 | break; | 233 | break; |
234 | case 7: | 234 | case 7: |
235 | if (pr) | 235 | if (pr) |
236 | printk(" FRate: 60 fps"); | 236 | printk(" FRate: 60 fps"); |
237 | vi->framerate = 60000; | 237 | vi->framerate = 60000; |
238 | form = VIDEO_MODE_NTSC; | 238 | form = VIDEO_MODE_NTSC; |
239 | break; | 239 | break; |
240 | } | 240 | } |
241 | 241 | ||
242 | vi->bit_rate = (headr[4] << 10) | (headr[5] << 2) | (headr[6] & 0x03); | 242 | vi->bit_rate = (headr[4] << 10) | (headr[5] << 2) | (headr[6] & 0x03); |
243 | 243 | ||
244 | vi->vbv_buffer_size | 244 | vi->vbv_buffer_size |
245 | = (( headr[6] & 0xF8) >> 3 ) | (( headr[7] & 0x1F )<< 5); | 245 | = (( headr[6] & 0xF8) >> 3 ) | (( headr[7] & 0x1F )<< 5); |
246 | 246 | ||
247 | if (pr){ | 247 | if (pr){ |
248 | printk(" BRate: %d Mbit/s",4*(vi->bit_rate)/10000); | 248 | printk(" BRate: %d Mbit/s",4*(vi->bit_rate)/10000); |
@@ -250,7 +250,7 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) | |||
250 | printk("\n"); | 250 | printk("\n"); |
251 | } | 251 | } |
252 | 252 | ||
253 | vi->video_format = form; | 253 | vi->video_format = form; |
254 | 254 | ||
255 | return 0; | 255 | return 0; |
256 | } | 256 | } |
@@ -308,7 +308,7 @@ static int get_ainfo(u8 *mbuf, int count, struct dvb_audio_info *ai, int pr) | |||
308 | if (!found) return -1; | 308 | if (!found) return -1; |
309 | 309 | ||
310 | if (c+3 >= count) return -1; | 310 | if (c+3 >= count) return -1; |
311 | headr = mbuf+c; | 311 | headr = mbuf+c; |
312 | 312 | ||
313 | ai->layer = (headr[1] & 0x06) >> 1; | 313 | ai->layer = (headr[1] & 0x06) >> 1; |
314 | 314 | ||
@@ -368,7 +368,7 @@ int dvb_filter_get_ac3info(u8 *mbuf, int count, struct dvb_audio_info *ai, int p | |||
368 | if (c+5 >= count) return -1; | 368 | if (c+5 >= count) return -1; |
369 | 369 | ||
370 | ai->layer = 0; // 0 for AC3 | 370 | ai->layer = 0; // 0 for AC3 |
371 | headr = mbuf+c+2; | 371 | headr = mbuf+c+2; |
372 | 372 | ||
373 | frame = (headr[2]&0x3f); | 373 | frame = (headr[2]&0x3f); |
374 | ai->bit_rate = ac3_bitrates[frame >> 1]*1000; | 374 | ai->bit_rate = ac3_bitrates[frame >> 1]*1000; |
@@ -396,159 +396,159 @@ EXPORT_SYMBOL(dvb_filter_get_ac3info); | |||
396 | #if 0 | 396 | #if 0 |
397 | static u8 *skip_pes_header(u8 **bufp) | 397 | static u8 *skip_pes_header(u8 **bufp) |
398 | { | 398 | { |
399 | u8 *inbuf = *bufp; | 399 | u8 *inbuf = *bufp; |
400 | u8 *buf = inbuf; | 400 | u8 *buf = inbuf; |
401 | u8 *pts = NULL; | 401 | u8 *pts = NULL; |
402 | int skip = 0; | 402 | int skip = 0; |
403 | 403 | ||
404 | static const int mpeg1_skip_table[16] = { | 404 | static const int mpeg1_skip_table[16] = { |
405 | 1, 0xffff, 5, 10, 0xffff, 0xffff, 0xffff, 0xffff, | 405 | 1, 0xffff, 5, 10, 0xffff, 0xffff, 0xffff, 0xffff, |
406 | 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff | 406 | 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff |
407 | }; | 407 | }; |
408 | 408 | ||
409 | 409 | ||
410 | if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */ | 410 | if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */ |
411 | if (buf[7] & PTS_ONLY) | 411 | if (buf[7] & PTS_ONLY) |
412 | pts = buf+9; | 412 | pts = buf+9; |
413 | else pts = NULL; | 413 | else pts = NULL; |
414 | buf = inbuf + 9 + inbuf[8]; | 414 | buf = inbuf + 9 + inbuf[8]; |
415 | } else { /* mpeg1 */ | 415 | } else { /* mpeg1 */ |
416 | for (buf = inbuf + 6; *buf == 0xff; buf++) | 416 | for (buf = inbuf + 6; *buf == 0xff; buf++) |
417 | if (buf == inbuf + 6 + 16) { | 417 | if (buf == inbuf + 6 + 16) { |
418 | break; | 418 | break; |
419 | } | 419 | } |
420 | if ((*buf & 0xc0) == 0x40) | 420 | if ((*buf & 0xc0) == 0x40) |
421 | buf += 2; | 421 | buf += 2; |
422 | skip = mpeg1_skip_table [*buf >> 4]; | 422 | skip = mpeg1_skip_table [*buf >> 4]; |
423 | if (skip == 5 || skip == 10) pts = buf; | 423 | if (skip == 5 || skip == 10) pts = buf; |
424 | else pts = NULL; | 424 | else pts = NULL; |
425 | 425 | ||
426 | buf += mpeg1_skip_table [*buf >> 4]; | 426 | buf += mpeg1_skip_table [*buf >> 4]; |
427 | } | 427 | } |
428 | 428 | ||
429 | *bufp = buf; | 429 | *bufp = buf; |
430 | return pts; | 430 | return pts; |
431 | } | 431 | } |
432 | #endif | 432 | #endif |
433 | 433 | ||
434 | #if 0 | 434 | #if 0 |
435 | static void initialize_quant_matrix( u32 *matrix ) | 435 | static void initialize_quant_matrix( u32 *matrix ) |
436 | { | 436 | { |
437 | int i; | 437 | int i; |
438 | 438 | ||
439 | matrix[0] = 0x08101013; | 439 | matrix[0] = 0x08101013; |
440 | matrix[1] = 0x10131616; | 440 | matrix[1] = 0x10131616; |
441 | matrix[2] = 0x16161616; | 441 | matrix[2] = 0x16161616; |
442 | matrix[3] = 0x1a181a1b; | 442 | matrix[3] = 0x1a181a1b; |
443 | matrix[4] = 0x1b1b1a1a; | 443 | matrix[4] = 0x1b1b1a1a; |
444 | matrix[5] = 0x1a1a1b1b; | 444 | matrix[5] = 0x1a1a1b1b; |
445 | matrix[6] = 0x1b1d1d1d; | 445 | matrix[6] = 0x1b1d1d1d; |
446 | matrix[7] = 0x2222221d; | 446 | matrix[7] = 0x2222221d; |
447 | matrix[8] = 0x1d1d1b1b; | 447 | matrix[8] = 0x1d1d1b1b; |
448 | matrix[9] = 0x1d1d2020; | 448 | matrix[9] = 0x1d1d2020; |
449 | matrix[10] = 0x22222526; | 449 | matrix[10] = 0x22222526; |
450 | matrix[11] = 0x25232322; | 450 | matrix[11] = 0x25232322; |
451 | matrix[12] = 0x23262628; | 451 | matrix[12] = 0x23262628; |
452 | matrix[13] = 0x28283030; | 452 | matrix[13] = 0x28283030; |
453 | matrix[14] = 0x2e2e3838; | 453 | matrix[14] = 0x2e2e3838; |
454 | matrix[15] = 0x3a454553; | 454 | matrix[15] = 0x3a454553; |
455 | 455 | ||
456 | for ( i = 16 ; i < 32 ; i++ ) | 456 | for ( i = 16 ; i < 32 ; i++ ) |
457 | matrix[i] = 0x10101010; | 457 | matrix[i] = 0x10101010; |
458 | } | 458 | } |
459 | #endif | 459 | #endif |
460 | 460 | ||
461 | #if 0 | 461 | #if 0 |
462 | static void initialize_mpg_picture(struct mpg_picture *pic) | 462 | static void initialize_mpg_picture(struct mpg_picture *pic) |
463 | { | 463 | { |
464 | int i; | 464 | int i; |
465 | 465 | ||
466 | /* set MPEG1 */ | 466 | /* set MPEG1 */ |
467 | pic->mpeg1_flag = 1; | 467 | pic->mpeg1_flag = 1; |
468 | pic->profile_and_level = 0x4A ; /* MP@LL */ | 468 | pic->profile_and_level = 0x4A ; /* MP@LL */ |
469 | pic->progressive_sequence = 1; | 469 | pic->progressive_sequence = 1; |
470 | pic->low_delay = 0; | 470 | pic->low_delay = 0; |
471 | 471 | ||
472 | pic->sequence_display_extension_flag = 0; | 472 | pic->sequence_display_extension_flag = 0; |
473 | for ( i = 0 ; i < 4 ; i++ ){ | 473 | for ( i = 0 ; i < 4 ; i++ ){ |
474 | pic->frame_centre_horizontal_offset[i] = 0; | 474 | pic->frame_centre_horizontal_offset[i] = 0; |
475 | pic->frame_centre_vertical_offset[i] = 0; | 475 | pic->frame_centre_vertical_offset[i] = 0; |
476 | } | 476 | } |
477 | pic->last_frame_centre_horizontal_offset = 0; | 477 | pic->last_frame_centre_horizontal_offset = 0; |
478 | pic->last_frame_centre_vertical_offset = 0; | 478 | pic->last_frame_centre_vertical_offset = 0; |
479 | 479 | ||
480 | pic->picture_display_extension_flag[0] = 0; | 480 | pic->picture_display_extension_flag[0] = 0; |
481 | pic->picture_display_extension_flag[1] = 0; | 481 | pic->picture_display_extension_flag[1] = 0; |
482 | pic->sequence_header_flag = 0; | 482 | pic->sequence_header_flag = 0; |
483 | pic->gop_flag = 0; | 483 | pic->gop_flag = 0; |
484 | pic->sequence_end_flag = 0; | 484 | pic->sequence_end_flag = 0; |
485 | } | 485 | } |
486 | #endif | 486 | #endif |
487 | 487 | ||
488 | #if 0 | 488 | #if 0 |
489 | static void mpg_set_picture_parameter( int32_t field_type, struct mpg_picture *pic ) | 489 | static void mpg_set_picture_parameter( int32_t field_type, struct mpg_picture *pic ) |
490 | { | 490 | { |
491 | int16_t last_h_offset; | 491 | int16_t last_h_offset; |
492 | int16_t last_v_offset; | 492 | int16_t last_v_offset; |
493 | 493 | ||
494 | int16_t *p_h_offset; | 494 | int16_t *p_h_offset; |
495 | int16_t *p_v_offset; | 495 | int16_t *p_v_offset; |
496 | 496 | ||
497 | if ( pic->mpeg1_flag ){ | 497 | if ( pic->mpeg1_flag ){ |
498 | pic->picture_structure[field_type] = VIDEO_FRAME_PICTURE; | 498 | pic->picture_structure[field_type] = VIDEO_FRAME_PICTURE; |
499 | pic->top_field_first = 0; | 499 | pic->top_field_first = 0; |
500 | pic->repeat_first_field = 0; | 500 | pic->repeat_first_field = 0; |
501 | pic->progressive_frame = 1; | 501 | pic->progressive_frame = 1; |
502 | pic->picture_coding_parameter = 0x000010; | 502 | pic->picture_coding_parameter = 0x000010; |
503 | } | 503 | } |
504 | 504 | ||
505 | /* Reset flag */ | 505 | /* Reset flag */ |
506 | pic->picture_display_extension_flag[field_type] = 0; | 506 | pic->picture_display_extension_flag[field_type] = 0; |
507 | 507 | ||
508 | last_h_offset = pic->last_frame_centre_horizontal_offset; | 508 | last_h_offset = pic->last_frame_centre_horizontal_offset; |
509 | last_v_offset = pic->last_frame_centre_vertical_offset; | 509 | last_v_offset = pic->last_frame_centre_vertical_offset; |
510 | if ( field_type == FIRST_FIELD ){ | 510 | if ( field_type == FIRST_FIELD ){ |
511 | p_h_offset = pic->frame_centre_horizontal_offset; | 511 | p_h_offset = pic->frame_centre_horizontal_offset; |
512 | p_v_offset = pic->frame_centre_vertical_offset; | 512 | p_v_offset = pic->frame_centre_vertical_offset; |
513 | *p_h_offset = last_h_offset; | 513 | *p_h_offset = last_h_offset; |
514 | *(p_h_offset + 1) = last_h_offset; | 514 | *(p_h_offset + 1) = last_h_offset; |
515 | *(p_h_offset + 2) = last_h_offset; | 515 | *(p_h_offset + 2) = last_h_offset; |
516 | *p_v_offset = last_v_offset; | 516 | *p_v_offset = last_v_offset; |
517 | *(p_v_offset + 1) = last_v_offset; | 517 | *(p_v_offset + 1) = last_v_offset; |
518 | *(p_v_offset + 2) = last_v_offset; | 518 | *(p_v_offset + 2) = last_v_offset; |
519 | } else { | 519 | } else { |
520 | pic->frame_centre_horizontal_offset[3] = last_h_offset; | 520 | pic->frame_centre_horizontal_offset[3] = last_h_offset; |
521 | pic->frame_centre_vertical_offset[3] = last_v_offset; | 521 | pic->frame_centre_vertical_offset[3] = last_v_offset; |
522 | } | 522 | } |
523 | } | 523 | } |
524 | #endif | 524 | #endif |
525 | 525 | ||
526 | #if 0 | 526 | #if 0 |
527 | static void init_mpg_picture( struct mpg_picture *pic, int chan, int32_t field_type) | 527 | static void init_mpg_picture( struct mpg_picture *pic, int chan, int32_t field_type) |
528 | { | 528 | { |
529 | pic->picture_header = 0; | 529 | pic->picture_header = 0; |
530 | pic->sequence_header_data | 530 | pic->sequence_header_data |
531 | = ( INIT_HORIZONTAL_SIZE << 20 ) | 531 | = ( INIT_HORIZONTAL_SIZE << 20 ) |
532 | | ( INIT_VERTICAL_SIZE << 8 ) | 532 | | ( INIT_VERTICAL_SIZE << 8 ) |
533 | | ( INIT_ASPECT_RATIO << 4 ) | 533 | | ( INIT_ASPECT_RATIO << 4 ) |
534 | | ( INIT_FRAME_RATE ); | 534 | | ( INIT_FRAME_RATE ); |
535 | pic->mpeg1_flag = 0; | 535 | pic->mpeg1_flag = 0; |
536 | pic->vinfo.horizontal_size | 536 | pic->vinfo.horizontal_size |
537 | = INIT_DISP_HORIZONTAL_SIZE; | 537 | = INIT_DISP_HORIZONTAL_SIZE; |
538 | pic->vinfo.vertical_size | 538 | pic->vinfo.vertical_size |
539 | = INIT_DISP_VERTICAL_SIZE; | 539 | = INIT_DISP_VERTICAL_SIZE; |
540 | pic->picture_display_extension_flag[field_type] | 540 | pic->picture_display_extension_flag[field_type] |
541 | = 0; | 541 | = 0; |
542 | pic->pts_flag[field_type] = 0; | 542 | pic->pts_flag[field_type] = 0; |
543 | 543 | ||
544 | pic->sequence_gop_header = 0; | 544 | pic->sequence_gop_header = 0; |
545 | pic->picture_header = 0; | 545 | pic->picture_header = 0; |
546 | pic->sequence_header_flag = 0; | 546 | pic->sequence_header_flag = 0; |
547 | pic->gop_flag = 0; | 547 | pic->gop_flag = 0; |
548 | pic->sequence_end_flag = 0; | 548 | pic->sequence_end_flag = 0; |
549 | pic->sequence_display_extension_flag = 0; | 549 | pic->sequence_display_extension_flag = 0; |
550 | pic->last_frame_centre_horizontal_offset = 0; | 550 | pic->last_frame_centre_horizontal_offset = 0; |
551 | pic->last_frame_centre_vertical_offset = 0; | 551 | pic->last_frame_centre_vertical_offset = 0; |
552 | pic->channel = chan; | 552 | pic->channel = chan; |
553 | } | 553 | } |
554 | #endif | 554 | #endif |
@@ -588,11 +588,11 @@ int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, | |||
588 | buf[1]&=~0x40; | 588 | buf[1]&=~0x40; |
589 | } | 589 | } |
590 | if (!len) | 590 | if (!len) |
591 | return 0; | 591 | return 0; |
592 | buf[3]=0x30|((p2ts->cc++)&0x0f); | 592 | buf[3]=0x30|((p2ts->cc++)&0x0f); |
593 | rest=183-len; | 593 | rest=183-len; |
594 | if (rest) { | 594 | if (rest) { |
595 | buf[5]=0x00; | 595 | buf[5]=0x00; |
596 | if (rest-1) | 596 | if (rest-1) |
597 | memset(buf+6, 0xff, rest-1); | 597 | memset(buf+6, 0xff, rest-1); |
598 | } | 598 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_filter.h b/drivers/media/dvb/dvb-core/dvb_filter.h index b0848f7836b7..375e3be184b1 100644 --- a/drivers/media/dvb/dvb-core/dvb_filter.h +++ b/drivers/media/dvb/dvb-core/dvb_filter.h | |||
@@ -29,8 +29,8 @@ typedef int (dvb_filter_pes2ts_cb_t) (void *, unsigned char *); | |||
29 | 29 | ||
30 | struct dvb_filter_pes2ts { | 30 | struct dvb_filter_pes2ts { |
31 | unsigned char buf[188]; | 31 | unsigned char buf[188]; |
32 | unsigned char cc; | 32 | unsigned char cc; |
33 | dvb_filter_pes2ts_cb_t *cb; | 33 | dvb_filter_pes2ts_cb_t *cb; |
34 | void *priv; | 34 | void *priv; |
35 | }; | 35 | }; |
36 | 36 | ||
@@ -162,7 +162,7 @@ struct dvb_video_info { | |||
162 | u32 bit_rate; | 162 | u32 bit_rate; |
163 | u32 comp_bit_rate; | 163 | u32 comp_bit_rate; |
164 | u32 vbv_buffer_size; | 164 | u32 vbv_buffer_size; |
165 | s16 vbv_delay; | 165 | s16 vbv_delay; |
166 | u32 CSPF; | 166 | u32 CSPF; |
167 | u32 off; | 167 | u32 off; |
168 | }; | 168 | }; |
@@ -173,60 +173,60 @@ struct dvb_video_info { | |||
173 | #define VIDEO_FRAME_PICTURE 0x03 | 173 | #define VIDEO_FRAME_PICTURE 0x03 |
174 | 174 | ||
175 | struct mpg_picture { | 175 | struct mpg_picture { |
176 | int channel; | 176 | int channel; |
177 | struct dvb_video_info vinfo; | 177 | struct dvb_video_info vinfo; |
178 | u32 *sequence_gop_header; | 178 | u32 *sequence_gop_header; |
179 | u32 *picture_header; | 179 | u32 *picture_header; |
180 | s32 time_code; | 180 | s32 time_code; |
181 | int low_delay; | 181 | int low_delay; |
182 | int closed_gop; | 182 | int closed_gop; |
183 | int broken_link; | 183 | int broken_link; |
184 | int sequence_header_flag; | 184 | int sequence_header_flag; |
185 | int gop_flag; | 185 | int gop_flag; |
186 | int sequence_end_flag; | 186 | int sequence_end_flag; |
187 | 187 | ||
188 | u8 profile_and_level; | 188 | u8 profile_and_level; |
189 | s32 picture_coding_parameter; | 189 | s32 picture_coding_parameter; |
190 | u32 matrix[32]; | 190 | u32 matrix[32]; |
191 | s8 matrix_change_flag; | 191 | s8 matrix_change_flag; |
192 | 192 | ||
193 | u8 picture_header_parameter; | 193 | u8 picture_header_parameter; |
194 | /* bit 0 - 2: bwd f code | 194 | /* bit 0 - 2: bwd f code |
195 | bit 3 : fpb vector | 195 | bit 3 : fpb vector |
196 | bit 4 - 6: fwd f code | 196 | bit 4 - 6: fwd f code |
197 | bit 7 : fpf vector */ | 197 | bit 7 : fpf vector */ |
198 | 198 | ||
199 | int mpeg1_flag; | 199 | int mpeg1_flag; |
200 | int progressive_sequence; | 200 | int progressive_sequence; |
201 | int sequence_display_extension_flag; | 201 | int sequence_display_extension_flag; |
202 | u32 sequence_header_data; | 202 | u32 sequence_header_data; |
203 | s16 last_frame_centre_horizontal_offset; | 203 | s16 last_frame_centre_horizontal_offset; |
204 | s16 last_frame_centre_vertical_offset; | 204 | s16 last_frame_centre_vertical_offset; |
205 | 205 | ||
206 | u32 pts[2]; /* [0] 1st field, [1] 2nd field */ | 206 | u32 pts[2]; /* [0] 1st field, [1] 2nd field */ |
207 | int top_field_first; | 207 | int top_field_first; |
208 | int repeat_first_field; | 208 | int repeat_first_field; |
209 | int progressive_frame; | 209 | int progressive_frame; |
210 | int bank; | 210 | int bank; |
211 | int forward_bank; | 211 | int forward_bank; |
212 | int backward_bank; | 212 | int backward_bank; |
213 | int compress; | 213 | int compress; |
214 | s16 frame_centre_horizontal_offset[OFF_SIZE]; | 214 | s16 frame_centre_horizontal_offset[OFF_SIZE]; |
215 | /* [0-2] 1st field, [3] 2nd field */ | 215 | /* [0-2] 1st field, [3] 2nd field */ |
216 | s16 frame_centre_vertical_offset[OFF_SIZE]; | 216 | s16 frame_centre_vertical_offset[OFF_SIZE]; |
217 | /* [0-2] 1st field, [3] 2nd field */ | 217 | /* [0-2] 1st field, [3] 2nd field */ |
218 | s16 temporal_reference[2]; | 218 | s16 temporal_reference[2]; |
219 | /* [0] 1st field, [1] 2nd field */ | 219 | /* [0] 1st field, [1] 2nd field */ |
220 | 220 | ||
221 | s8 picture_coding_type[2]; | 221 | s8 picture_coding_type[2]; |
222 | /* [0] 1st field, [1] 2nd field */ | 222 | /* [0] 1st field, [1] 2nd field */ |
223 | s8 picture_structure[2]; | 223 | s8 picture_structure[2]; |
224 | /* [0] 1st field, [1] 2nd field */ | 224 | /* [0] 1st field, [1] 2nd field */ |
225 | s8 picture_display_extension_flag[2]; | 225 | s8 picture_display_extension_flag[2]; |
226 | /* [0] 1st field, [1] 2nd field */ | 226 | /* [0] 1st field, [1] 2nd field */ |
227 | /* picture_display_extenion() 0:no 1:exit*/ | 227 | /* picture_display_extenion() 0:no 1:exit*/ |
228 | s8 pts_flag[2]; | 228 | s8 pts_flag[2]; |
229 | /* [0] 1st field, [1] 2nd field */ | 229 | /* [0] 1st field, [1] 2nd field */ |
230 | }; | 230 | }; |
231 | 231 | ||
232 | struct dvb_audio_info { | 232 | struct dvb_audio_info { |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 6ffa6b216363..95ea5095e07e 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -372,10 +372,10 @@ static int dvb_frontend_thread(void *data) | |||
372 | 372 | ||
373 | snprintf (name, sizeof(name), "kdvb-fe-%i", fe->dvb->num); | 373 | snprintf (name, sizeof(name), "kdvb-fe-%i", fe->dvb->num); |
374 | 374 | ||
375 | lock_kernel(); | 375 | lock_kernel(); |
376 | daemonize(name); | 376 | daemonize(name); |
377 | sigfillset(¤t->blocked); | 377 | sigfillset(¤t->blocked); |
378 | unlock_kernel(); | 378 | unlock_kernel(); |
379 | 379 | ||
380 | fepriv->status = 0; | 380 | fepriv->status = 0; |
381 | dvb_frontend_init(fe); | 381 | dvb_frontend_init(fe); |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h index 348c9b0b988a..1e0840d02f1f 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h | |||
@@ -41,10 +41,10 @@ | |||
41 | #include "dvbdev.h" | 41 | #include "dvbdev.h" |
42 | 42 | ||
43 | struct dvb_frontend_tune_settings { | 43 | struct dvb_frontend_tune_settings { |
44 | int min_delay_ms; | 44 | int min_delay_ms; |
45 | int step_size; | 45 | int step_size; |
46 | int max_drift; | 46 | int max_drift; |
47 | struct dvb_frontend_parameters parameters; | 47 | struct dvb_frontend_parameters parameters; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | struct dvb_frontend; | 50 | struct dvb_frontend; |
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index df536bd2e103..86bba81e851e 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -713,7 +713,7 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, | |||
713 | if (buffer1_len > 32768) | 713 | if (buffer1_len > 32768) |
714 | printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); | 714 | printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); |
715 | /* printk("TS callback: %u bytes, %u TS cells @ %p.\n", | 715 | /* printk("TS callback: %u bytes, %u TS cells @ %p.\n", |
716 | buffer1_len, buffer1_len / TS_SZ, buffer1); */ | 716 | buffer1_len, buffer1_len / TS_SZ, buffer1); */ |
717 | dvb_net_ule(dev, buffer1, buffer1_len); | 717 | dvb_net_ule(dev, buffer1, buffer1_len); |
718 | return 0; | 718 | return 0; |
719 | } | 719 | } |
@@ -721,8 +721,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, | |||
721 | 721 | ||
722 | static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) | 722 | static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) |
723 | { | 723 | { |
724 | u8 *eth; | 724 | u8 *eth; |
725 | struct sk_buff *skb; | 725 | struct sk_buff *skb; |
726 | struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats); | 726 | struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats); |
727 | int snap = 0; | 727 | int snap = 0; |
728 | 728 | ||
@@ -754,7 +754,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) | |||
754 | return; | 754 | return; |
755 | } | 755 | } |
756 | snap = 8; | 756 | snap = 8; |
757 | } | 757 | } |
758 | if (pkt[7]) { | 758 | if (pkt[7]) { |
759 | /* FIXME: assemble datagram from multiple sections */ | 759 | /* FIXME: assemble datagram from multiple sections */ |
760 | stats->rx_errors++; | 760 | stats->rx_errors++; |
@@ -778,14 +778,14 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) | |||
778 | memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap); | 778 | memcpy(eth + 14, pkt + 12 + snap, pkt_len - 12 - 4 - snap); |
779 | 779 | ||
780 | /* create ethernet header: */ | 780 | /* create ethernet header: */ |
781 | eth[0]=pkt[0x0b]; | 781 | eth[0]=pkt[0x0b]; |
782 | eth[1]=pkt[0x0a]; | 782 | eth[1]=pkt[0x0a]; |
783 | eth[2]=pkt[0x09]; | 783 | eth[2]=pkt[0x09]; |
784 | eth[3]=pkt[0x08]; | 784 | eth[3]=pkt[0x08]; |
785 | eth[4]=pkt[0x04]; | 785 | eth[4]=pkt[0x04]; |
786 | eth[5]=pkt[0x03]; | 786 | eth[5]=pkt[0x03]; |
787 | 787 | ||
788 | eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0; | 788 | eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0; |
789 | 789 | ||
790 | if (snap) { | 790 | if (snap) { |
791 | eth[12] = pkt[18]; | 791 | eth[12] = pkt[18]; |
@@ -807,7 +807,7 @@ static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) | |||
807 | 807 | ||
808 | stats->rx_packets++; | 808 | stats->rx_packets++; |
809 | stats->rx_bytes+=skb->len; | 809 | stats->rx_bytes+=skb->len; |
810 | netif_rx(skb); | 810 | netif_rx(skb); |
811 | } | 811 | } |
812 | 812 | ||
813 | static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, | 813 | static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, |
@@ -815,7 +815,7 @@ static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, | |||
815 | struct dmx_section_filter *filter, | 815 | struct dmx_section_filter *filter, |
816 | enum dmx_success success) | 816 | enum dmx_success success) |
817 | { | 817 | { |
818 | struct net_device *dev = filter->priv; | 818 | struct net_device *dev = filter->priv; |
819 | 819 | ||
820 | /** | 820 | /** |
821 | * we rely on the DVB API definition where exactly one complete | 821 | * we rely on the DVB API definition where exactly one complete |
@@ -885,8 +885,8 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
885 | { | 885 | { |
886 | int ret = 0, i; | 886 | int ret = 0, i; |
887 | struct dvb_net_priv *priv = dev->priv; | 887 | struct dvb_net_priv *priv = dev->priv; |
888 | struct dmx_demux *demux = priv->demux; | 888 | struct dmx_demux *demux = priv->demux; |
889 | unsigned char *mac = (unsigned char *) dev->dev_addr; | 889 | unsigned char *mac = (unsigned char *) dev->dev_addr; |
890 | 890 | ||
891 | dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); | 891 | dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); |
892 | down(&priv->mutex); | 892 | down(&priv->mutex); |
@@ -1129,12 +1129,12 @@ static int dvb_net_stop(struct net_device *dev) | |||
1129 | struct dvb_net_priv *priv = dev->priv; | 1129 | struct dvb_net_priv *priv = dev->priv; |
1130 | 1130 | ||
1131 | priv->in_use--; | 1131 | priv->in_use--; |
1132 | return dvb_net_feed_stop(dev); | 1132 | return dvb_net_feed_stop(dev); |
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | static struct net_device_stats * dvb_net_get_stats(struct net_device *dev) | 1135 | static struct net_device_stats * dvb_net_get_stats(struct net_device *dev) |
1136 | { | 1136 | { |
1137 | return &((struct dvb_net_priv*) dev->priv)->stats; | 1137 | return &((struct dvb_net_priv*) dev->priv)->stats; |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | static void dvb_net_setup(struct net_device *dev) | 1140 | static void dvb_net_setup(struct net_device *dev) |
@@ -1360,10 +1360,10 @@ static struct file_operations dvb_net_fops = { | |||
1360 | }; | 1360 | }; |
1361 | 1361 | ||
1362 | static struct dvb_device dvbdev_net = { | 1362 | static struct dvb_device dvbdev_net = { |
1363 | .priv = NULL, | 1363 | .priv = NULL, |
1364 | .users = 1, | 1364 | .users = 1, |
1365 | .writers = 1, | 1365 | .writers = 1, |
1366 | .fops = &dvb_net_fops, | 1366 | .fops = &dvb_net_fops, |
1367 | }; | 1367 | }; |
1368 | 1368 | ||
1369 | 1369 | ||
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c index fb6d94a69d71..283c6e9339a4 100644 --- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c +++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c | |||
@@ -42,216 +42,216 @@ | |||
42 | 42 | ||
43 | void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) | 43 | void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) |
44 | { | 44 | { |
45 | rbuf->pread=rbuf->pwrite=0; | 45 | rbuf->pread=rbuf->pwrite=0; |
46 | rbuf->data=data; | 46 | rbuf->data=data; |
47 | rbuf->size=len; | 47 | rbuf->size=len; |
48 | 48 | ||
49 | init_waitqueue_head(&rbuf->queue); | 49 | init_waitqueue_head(&rbuf->queue); |
50 | 50 | ||
51 | spin_lock_init(&(rbuf->lock)); | 51 | spin_lock_init(&(rbuf->lock)); |
52 | } | 52 | } |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf) | 56 | int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf) |
57 | { | 57 | { |
58 | return (rbuf->pread==rbuf->pwrite); | 58 | return (rbuf->pread==rbuf->pwrite); |
59 | } | 59 | } |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf) | 63 | ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf) |
64 | { | 64 | { |
65 | ssize_t free; | 65 | ssize_t free; |
66 | 66 | ||
67 | free = rbuf->pread - rbuf->pwrite; | 67 | free = rbuf->pread - rbuf->pwrite; |
68 | if (free <= 0) | 68 | if (free <= 0) |
69 | free += rbuf->size; | 69 | free += rbuf->size; |
70 | return free-1; | 70 | return free-1; |
71 | } | 71 | } |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf) | 75 | ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf) |
76 | { | 76 | { |
77 | ssize_t avail; | 77 | ssize_t avail; |
78 | 78 | ||
79 | avail = rbuf->pwrite - rbuf->pread; | 79 | avail = rbuf->pwrite - rbuf->pread; |
80 | if (avail < 0) | 80 | if (avail < 0) |
81 | avail += rbuf->size; | 81 | avail += rbuf->size; |
82 | return avail; | 82 | return avail; |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
86 | 86 | ||
87 | void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) | 87 | void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) |
88 | { | 88 | { |
89 | rbuf->pread = rbuf->pwrite; | 89 | rbuf->pread = rbuf->pwrite; |
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | 93 | ||
94 | void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf) | 94 | void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf) |
95 | { | 95 | { |
96 | unsigned long flags; | 96 | unsigned long flags; |
97 | 97 | ||
98 | spin_lock_irqsave(&rbuf->lock, flags); | 98 | spin_lock_irqsave(&rbuf->lock, flags); |
99 | dvb_ringbuffer_flush(rbuf); | 99 | dvb_ringbuffer_flush(rbuf); |
100 | spin_unlock_irqrestore(&rbuf->lock, flags); | 100 | spin_unlock_irqrestore(&rbuf->lock, flags); |
101 | 101 | ||
102 | wake_up(&rbuf->queue); | 102 | wake_up(&rbuf->queue); |
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, int usermem) | 107 | ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, int usermem) |
108 | { | 108 | { |
109 | size_t todo = len; | 109 | size_t todo = len; |
110 | size_t split; | 110 | size_t split; |
111 | 111 | ||
112 | split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; | 112 | split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; |
113 | if (split > 0) { | 113 | if (split > 0) { |
114 | if (!usermem) | 114 | if (!usermem) |
115 | memcpy(buf, rbuf->data+rbuf->pread, split); | 115 | memcpy(buf, rbuf->data+rbuf->pread, split); |
116 | else | 116 | else |
117 | if (copy_to_user(buf, rbuf->data+rbuf->pread, split)) | 117 | if (copy_to_user(buf, rbuf->data+rbuf->pread, split)) |
118 | return -EFAULT; | 118 | return -EFAULT; |
119 | buf += split; | 119 | buf += split; |
120 | todo -= split; | 120 | todo -= split; |
121 | rbuf->pread = 0; | 121 | rbuf->pread = 0; |
122 | } | 122 | } |
123 | if (!usermem) | 123 | if (!usermem) |
124 | memcpy(buf, rbuf->data+rbuf->pread, todo); | 124 | memcpy(buf, rbuf->data+rbuf->pread, todo); |
125 | else | 125 | else |
126 | if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) | 126 | if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) |
127 | return -EFAULT; | 127 | return -EFAULT; |
128 | 128 | ||
129 | rbuf->pread = (rbuf->pread + todo) % rbuf->size; | 129 | rbuf->pread = (rbuf->pread + todo) % rbuf->size; |
130 | 130 | ||
131 | return len; | 131 | return len; |
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | 135 | ||
136 | ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len) | 136 | ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len) |
137 | { | 137 | { |
138 | size_t todo = len; | 138 | size_t todo = len; |
139 | size_t split; | 139 | size_t split; |
140 | 140 | ||
141 | split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0; | 141 | split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0; |
142 | 142 | ||
143 | if (split > 0) { | 143 | if (split > 0) { |
144 | memcpy(rbuf->data+rbuf->pwrite, buf, split); | 144 | memcpy(rbuf->data+rbuf->pwrite, buf, split); |
145 | buf += split; | 145 | buf += split; |
146 | todo -= split; | 146 | todo -= split; |
147 | rbuf->pwrite = 0; | 147 | rbuf->pwrite = 0; |
148 | } | 148 | } |
149 | memcpy(rbuf->data+rbuf->pwrite, buf, todo); | 149 | memcpy(rbuf->data+rbuf->pwrite, buf, todo); |
150 | rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; | 150 | rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; |
151 | 151 | ||
152 | return len; | 152 | return len; |
153 | } | 153 | } |
154 | 154 | ||
155 | ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len) | 155 | ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len) |
156 | { | 156 | { |
157 | int status; | 157 | int status; |
158 | ssize_t oldpwrite = rbuf->pwrite; | 158 | ssize_t oldpwrite = rbuf->pwrite; |
159 | 159 | ||
160 | DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8); | 160 | DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8); |
161 | DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff); | 161 | DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff); |
162 | DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY); | 162 | DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY); |
163 | status = dvb_ringbuffer_write(rbuf, buf, len); | 163 | status = dvb_ringbuffer_write(rbuf, buf, len); |
164 | 164 | ||
165 | if (status < 0) rbuf->pwrite = oldpwrite; | 165 | if (status < 0) rbuf->pwrite = oldpwrite; |
166 | return status; | 166 | return status; |
167 | } | 167 | } |
168 | 168 | ||
169 | ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, | 169 | ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, |
170 | int offset, u8* buf, size_t len, int usermem) | 170 | int offset, u8* buf, size_t len, int usermem) |
171 | { | 171 | { |
172 | size_t todo; | 172 | size_t todo; |
173 | size_t split; | 173 | size_t split; |
174 | size_t pktlen; | 174 | size_t pktlen; |
175 | 175 | ||
176 | pktlen = rbuf->data[idx] << 8; | 176 | pktlen = rbuf->data[idx] << 8; |
177 | pktlen |= rbuf->data[(idx + 1) % rbuf->size]; | 177 | pktlen |= rbuf->data[(idx + 1) % rbuf->size]; |
178 | if (offset > pktlen) return -EINVAL; | 178 | if (offset > pktlen) return -EINVAL; |
179 | if ((offset + len) > pktlen) len = pktlen - offset; | 179 | if ((offset + len) > pktlen) len = pktlen - offset; |
180 | 180 | ||
181 | idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size; | 181 | idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size; |
182 | todo = len; | 182 | todo = len; |
183 | split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0; | 183 | split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0; |
184 | if (split > 0) { | 184 | if (split > 0) { |
185 | if (!usermem) | 185 | if (!usermem) |
186 | memcpy(buf, rbuf->data+idx, split); | 186 | memcpy(buf, rbuf->data+idx, split); |
187 | else | 187 | else |
188 | if (copy_to_user(buf, rbuf->data+idx, split)) | 188 | if (copy_to_user(buf, rbuf->data+idx, split)) |
189 | return -EFAULT; | 189 | return -EFAULT; |
190 | buf += split; | 190 | buf += split; |
191 | todo -= split; | 191 | todo -= split; |
192 | idx = 0; | 192 | idx = 0; |
193 | } | 193 | } |
194 | if (!usermem) | 194 | if (!usermem) |
195 | memcpy(buf, rbuf->data+idx, todo); | 195 | memcpy(buf, rbuf->data+idx, todo); |
196 | else | 196 | else |
197 | if (copy_to_user(buf, rbuf->data+idx, todo)) | 197 | if (copy_to_user(buf, rbuf->data+idx, todo)) |
198 | return -EFAULT; | 198 | return -EFAULT; |
199 | 199 | ||
200 | return len; | 200 | return len; |
201 | } | 201 | } |
202 | 202 | ||
203 | void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx) | 203 | void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx) |
204 | { | 204 | { |
205 | size_t pktlen; | 205 | size_t pktlen; |
206 | 206 | ||
207 | rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED; | 207 | rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED; |
208 | 208 | ||
209 | // clean up disposed packets | 209 | // clean up disposed packets |
210 | while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) { | 210 | while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) { |
211 | if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) { | 211 | if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) { |
212 | pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8; | 212 | pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8; |
213 | pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1); | 213 | pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1); |
214 | DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE); | 214 | DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE); |
215 | } else { | 215 | } else { |
216 | // first packet is not disposed, so we stop cleaning now | 216 | // first packet is not disposed, so we stop cleaning now |
217 | break; | 217 | break; |
218 | } | 218 | } |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen) | 222 | ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen) |
223 | { | 223 | { |
224 | int consumed; | 224 | int consumed; |
225 | int curpktlen; | 225 | int curpktlen; |
226 | int curpktstatus; | 226 | int curpktstatus; |
227 | 227 | ||
228 | if (idx == -1) { | 228 | if (idx == -1) { |
229 | idx = rbuf->pread; | 229 | idx = rbuf->pread; |
230 | } else { | 230 | } else { |
231 | curpktlen = rbuf->data[idx] << 8; | 231 | curpktlen = rbuf->data[idx] << 8; |
232 | curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; | 232 | curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; |
233 | idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; | 233 | idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; |
234 | } | 234 | } |
235 | 235 | ||
236 | consumed = (idx - rbuf->pread) % rbuf->size; | 236 | consumed = (idx - rbuf->pread) % rbuf->size; |
237 | 237 | ||
238 | while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) { | 238 | while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) { |
239 | 239 | ||
240 | curpktlen = rbuf->data[idx] << 8; | 240 | curpktlen = rbuf->data[idx] << 8; |
241 | curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; | 241 | curpktlen |= rbuf->data[(idx + 1) % rbuf->size]; |
242 | curpktstatus = rbuf->data[(idx + 2) % rbuf->size]; | 242 | curpktstatus = rbuf->data[(idx + 2) % rbuf->size]; |
243 | 243 | ||
244 | if (curpktstatus == PKT_READY) { | 244 | if (curpktstatus == PKT_READY) { |
245 | *pktlen = curpktlen; | 245 | *pktlen = curpktlen; |
246 | return idx; | 246 | return idx; |
247 | } | 247 | } |
248 | 248 | ||
249 | consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE; | 249 | consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE; |
250 | idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; | 250 | idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size; |
251 | } | 251 | } |
252 | 252 | ||
253 | // no packets available | 253 | // no packets available |
254 | return -1; | 254 | return -1; |
255 | } | 255 | } |
256 | 256 | ||
257 | 257 | ||
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h index d18e9c4ba9ea..fa476f662f82 100644 --- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h +++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h | |||
@@ -31,13 +31,13 @@ | |||
31 | #include <linux/wait.h> | 31 | #include <linux/wait.h> |
32 | 32 | ||
33 | struct dvb_ringbuffer { | 33 | struct dvb_ringbuffer { |
34 | u8 *data; | 34 | u8 *data; |
35 | ssize_t size; | 35 | ssize_t size; |
36 | ssize_t pread; | 36 | ssize_t pread; |
37 | ssize_t pwrite; | 37 | ssize_t pwrite; |
38 | 38 | ||
39 | wait_queue_head_t queue; | 39 | wait_queue_head_t queue; |
40 | spinlock_t lock; | 40 | spinlock_t lock; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #define DVB_RINGBUFFER_PKTHDRSIZE 3 | 43 | #define DVB_RINGBUFFER_PKTHDRSIZE 3 |
@@ -106,7 +106,7 @@ extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf); | |||
106 | ** returns number of bytes transferred or -EFAULT | 106 | ** returns number of bytes transferred or -EFAULT |
107 | */ | 107 | */ |
108 | extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, | 108 | extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, |
109 | size_t len, int usermem); | 109 | size_t len, int usermem); |
110 | 110 | ||
111 | 111 | ||
112 | /* write routines & macros */ | 112 | /* write routines & macros */ |
@@ -121,7 +121,7 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, | |||
121 | ** returns number of bytes transferred or -EFAULT | 121 | ** returns number of bytes transferred or -EFAULT |
122 | */ | 122 | */ |
123 | extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, | 123 | extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, |
124 | size_t len); | 124 | size_t len); |
125 | 125 | ||
126 | 126 | ||
127 | /** | 127 | /** |
@@ -133,7 +133,7 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, | |||
133 | * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL. | 133 | * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL. |
134 | */ | 134 | */ |
135 | extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, | 135 | extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, |
136 | size_t len); | 136 | size_t len); |
137 | 137 | ||
138 | /** | 138 | /** |
139 | * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this | 139 | * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this |
@@ -149,7 +149,7 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, | |||
149 | * returns Number of bytes read, or -EFAULT. | 149 | * returns Number of bytes read, or -EFAULT. |
150 | */ | 150 | */ |
151 | extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, | 151 | extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, |
152 | int offset, u8* buf, size_t len, int usermem); | 152 | int offset, u8* buf, size_t len, int usermem); |
153 | 153 | ||
154 | /** | 154 | /** |
155 | * Dispose of a packet in the ring buffer. | 155 | * Dispose of a packet in the ring buffer. |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 477b4fa56430..a4aee8665854 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -47,7 +47,7 @@ static LIST_HEAD(dvb_adapter_list); | |||
47 | static DECLARE_MUTEX(dvbdev_register_lock); | 47 | static DECLARE_MUTEX(dvbdev_register_lock); |
48 | 48 | ||
49 | static const char * const dnames[] = { | 49 | static const char * const dnames[] = { |
50 | "video", "audio", "sec", "frontend", "demux", "dvr", "ca", | 50 | "video", "audio", "sec", "frontend", "demux", "dvr", "ca", |
51 | "net", "osd" | 51 | "net", "osd" |
52 | }; | 52 | }; |
53 | 53 | ||
@@ -90,15 +90,15 @@ static int dvb_device_open(struct inode *inode, struct file *file) | |||
90 | 90 | ||
91 | file->private_data = dvbdev; | 91 | file->private_data = dvbdev; |
92 | old_fops = file->f_op; | 92 | old_fops = file->f_op; |
93 | file->f_op = fops_get(dvbdev->fops); | 93 | file->f_op = fops_get(dvbdev->fops); |
94 | if(file->f_op->open) | 94 | if(file->f_op->open) |
95 | err = file->f_op->open(inode,file); | 95 | err = file->f_op->open(inode,file); |
96 | if (err) { | 96 | if (err) { |
97 | fops_put(file->f_op); | 97 | fops_put(file->f_op); |
98 | file->f_op = fops_get(old_fops); | 98 | file->f_op = fops_get(old_fops); |
99 | } | 99 | } |
100 | fops_put(old_fops); | 100 | fops_put(old_fops); |
101 | return err; | 101 | return err; |
102 | } | 102 | } |
103 | return -ENODEV; | 103 | return -ENODEV; |
104 | } | 104 | } |
@@ -117,21 +117,21 @@ static struct cdev dvb_device_cdev = { | |||
117 | 117 | ||
118 | int dvb_generic_open(struct inode *inode, struct file *file) | 118 | int dvb_generic_open(struct inode *inode, struct file *file) |
119 | { | 119 | { |
120 | struct dvb_device *dvbdev = file->private_data; | 120 | struct dvb_device *dvbdev = file->private_data; |
121 | 121 | ||
122 | if (!dvbdev) | 122 | if (!dvbdev) |
123 | return -ENODEV; | 123 | return -ENODEV; |
124 | 124 | ||
125 | if (!dvbdev->users) | 125 | if (!dvbdev->users) |
126 | return -EBUSY; | 126 | return -EBUSY; |
127 | 127 | ||
128 | if ((file->f_flags & O_ACCMODE) == O_RDONLY) { | 128 | if ((file->f_flags & O_ACCMODE) == O_RDONLY) { |
129 | if (!dvbdev->readers) | 129 | if (!dvbdev->readers) |
130 | return -EBUSY; | 130 | return -EBUSY; |
131 | dvbdev->readers--; | 131 | dvbdev->readers--; |
132 | } else { | 132 | } else { |
133 | if (!dvbdev->writers) | 133 | if (!dvbdev->writers) |
134 | return -EBUSY; | 134 | return -EBUSY; |
135 | dvbdev->writers--; | 135 | dvbdev->writers--; |
136 | } | 136 | } |
137 | 137 | ||
@@ -143,10 +143,10 @@ EXPORT_SYMBOL(dvb_generic_open); | |||
143 | 143 | ||
144 | int dvb_generic_release(struct inode *inode, struct file *file) | 144 | int dvb_generic_release(struct inode *inode, struct file *file) |
145 | { | 145 | { |
146 | struct dvb_device *dvbdev = file->private_data; | 146 | struct dvb_device *dvbdev = file->private_data; |
147 | 147 | ||
148 | if (!dvbdev) | 148 | if (!dvbdev) |
149 | return -ENODEV; | 149 | return -ENODEV; |
150 | 150 | ||
151 | if ((file->f_flags & O_ACCMODE) == O_RDONLY) { | 151 | if ((file->f_flags & O_ACCMODE) == O_RDONLY) { |
152 | dvbdev->readers++; | 152 | dvbdev->readers++; |
@@ -163,10 +163,10 @@ EXPORT_SYMBOL(dvb_generic_release); | |||
163 | int dvb_generic_ioctl(struct inode *inode, struct file *file, | 163 | int dvb_generic_ioctl(struct inode *inode, struct file *file, |
164 | unsigned int cmd, unsigned long arg) | 164 | unsigned int cmd, unsigned long arg) |
165 | { | 165 | { |
166 | struct dvb_device *dvbdev = file->private_data; | 166 | struct dvb_device *dvbdev = file->private_data; |
167 | 167 | ||
168 | if (!dvbdev) | 168 | if (!dvbdev) |
169 | return -ENODEV; | 169 | return -ENODEV; |
170 | 170 | ||
171 | if (!dvbdev->kernel_ioctl) | 171 | if (!dvbdev->kernel_ioctl) |
172 | return -EINVAL; | 172 | return -EINVAL; |
@@ -334,63 +334,63 @@ EXPORT_SYMBOL(dvb_unregister_adapter); | |||
334 | to the v4l "videodev.o" module, which is unnecessary for some | 334 | to the v4l "videodev.o" module, which is unnecessary for some |
335 | cards (ie. the budget dvb-cards don't need the v4l module...) */ | 335 | cards (ie. the budget dvb-cards don't need the v4l module...) */ |
336 | int dvb_usercopy(struct inode *inode, struct file *file, | 336 | int dvb_usercopy(struct inode *inode, struct file *file, |
337 | unsigned int cmd, unsigned long arg, | 337 | unsigned int cmd, unsigned long arg, |
338 | int (*func)(struct inode *inode, struct file *file, | 338 | int (*func)(struct inode *inode, struct file *file, |
339 | unsigned int cmd, void *arg)) | 339 | unsigned int cmd, void *arg)) |
340 | { | 340 | { |
341 | char sbuf[128]; | 341 | char sbuf[128]; |
342 | void *mbuf = NULL; | 342 | void *mbuf = NULL; |
343 | void *parg = NULL; | 343 | void *parg = NULL; |
344 | int err = -EINVAL; | 344 | int err = -EINVAL; |
345 | 345 | ||
346 | /* Copy arguments into temp kernel buffer */ | 346 | /* Copy arguments into temp kernel buffer */ |
347 | switch (_IOC_DIR(cmd)) { | 347 | switch (_IOC_DIR(cmd)) { |
348 | case _IOC_NONE: | 348 | case _IOC_NONE: |
349 | /* | 349 | /* |
350 | * For this command, the pointer is actually an integer | 350 | * For this command, the pointer is actually an integer |
351 | * argument. | 351 | * argument. |
352 | */ | 352 | */ |
353 | parg = (void *) arg; | 353 | parg = (void *) arg; |
354 | break; | 354 | break; |
355 | case _IOC_READ: /* some v4l ioctls are marked wrong ... */ | 355 | case _IOC_READ: /* some v4l ioctls are marked wrong ... */ |
356 | case _IOC_WRITE: | 356 | case _IOC_WRITE: |
357 | case (_IOC_WRITE | _IOC_READ): | 357 | case (_IOC_WRITE | _IOC_READ): |
358 | if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { | 358 | if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { |
359 | parg = sbuf; | 359 | parg = sbuf; |
360 | } else { | 360 | } else { |
361 | /* too big to allocate from stack */ | 361 | /* too big to allocate from stack */ |
362 | mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); | 362 | mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); |
363 | if (NULL == mbuf) | 363 | if (NULL == mbuf) |
364 | return -ENOMEM; | 364 | return -ENOMEM; |
365 | parg = mbuf; | 365 | parg = mbuf; |
366 | } | 366 | } |
367 | 367 | ||
368 | err = -EFAULT; | 368 | err = -EFAULT; |
369 | if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) | 369 | if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) |
370 | goto out; | 370 | goto out; |
371 | break; | 371 | break; |
372 | } | 372 | } |
373 | 373 | ||
374 | /* call driver */ | 374 | /* call driver */ |
375 | if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) | 375 | if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) |
376 | err = -EINVAL; | 376 | err = -EINVAL; |
377 | 377 | ||
378 | if (err < 0) | 378 | if (err < 0) |
379 | goto out; | 379 | goto out; |
380 | 380 | ||
381 | /* Copy results into user buffer */ | 381 | /* Copy results into user buffer */ |
382 | switch (_IOC_DIR(cmd)) | 382 | switch (_IOC_DIR(cmd)) |
383 | { | 383 | { |
384 | case _IOC_READ: | 384 | case _IOC_READ: |
385 | case (_IOC_WRITE | _IOC_READ): | 385 | case (_IOC_WRITE | _IOC_READ): |
386 | if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) | 386 | if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) |
387 | err = -EFAULT; | 387 | err = -EFAULT; |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | 390 | ||
391 | out: | 391 | out: |
392 | kfree(mbuf); | 392 | kfree(mbuf); |
393 | return err; | 393 | return err; |
394 | } | 394 | } |
395 | 395 | ||
396 | static int __init init_dvbdev(void) | 396 | static int __init init_dvbdev(void) |
@@ -427,10 +427,10 @@ error: | |||
427 | 427 | ||
428 | static void __exit exit_dvbdev(void) | 428 | static void __exit exit_dvbdev(void) |
429 | { | 429 | { |
430 | devfs_remove("dvb"); | 430 | devfs_remove("dvb"); |
431 | class_destroy(dvb_class); | 431 | class_destroy(dvb_class); |
432 | cdev_del(&dvb_device_cdev); | 432 | cdev_del(&dvb_device_cdev); |
433 | unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); | 433 | unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); |
434 | } | 434 | } |
435 | 435 | ||
436 | module_init(init_dvbdev); | 436 | module_init(init_dvbdev); |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h index a251867f30f1..0cc6e4a0e27c 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.h +++ b/drivers/media/dvb/dvb-core/dvbdev.h | |||
@@ -68,8 +68,8 @@ struct dvb_device { | |||
68 | int writers; | 68 | int writers; |
69 | int users; | 69 | int users; |
70 | 70 | ||
71 | /* don't really need those !? -- FIXME: use video_usercopy */ | 71 | /* don't really need those !? -- FIXME: use video_usercopy */ |
72 | int (*kernel_ioctl)(struct inode *inode, struct file *file, | 72 | int (*kernel_ioctl)(struct inode *inode, struct file *file, |
73 | unsigned int cmd, void *arg); | 73 | unsigned int cmd, void *arg); |
74 | 74 | ||
75 | void *priv; | 75 | void *priv; |
@@ -97,7 +97,7 @@ we simply define out own dvb_usercopy(), which will hopefully become | |||
97 | generic_usercopy() someday... */ | 97 | generic_usercopy() someday... */ |
98 | 98 | ||
99 | extern int dvb_usercopy(struct inode *inode, struct file *file, | 99 | extern int dvb_usercopy(struct inode *inode, struct file *file, |
100 | unsigned int cmd, unsigned long arg, | 100 | unsigned int cmd, unsigned long arg, |
101 | int (*func)(struct inode *inode, struct file *file, | 101 | int (*func)(struct inode *inode, struct file *file, |
102 | unsigned int cmd, void *arg)); | 102 | unsigned int cmd, void *arg)); |
103 | 103 | ||