1 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/compat.h linux-2.6.18/drivers/media/dvb/dvb-core/compat.h
2 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/compat.h 2010-09-10 02:00:59.000000000 +0000
3 +++ linux-2.6.18/drivers/media/dvb/dvb-core/compat.h 2010-09-15 00:00:00.000000000 +0000
8 -#include <linux/i2c-id.h>
9 -#include <linux/version.h>
10 -#include <linux/utsname.h>
12 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
13 -# define class_device_create(a, b, c, d, e, f, g, h) class_simple_device_add(a, c, d, e, f, g, h)
14 -# define class_device_destroy(a, b...) class_simple_device_remove(b)
15 -# define class_create class_simple_create
16 -# define class_destroy class_simple_destroy
17 -# define class class_simple
18 -# define try_to_freeze() do { if (current->flags & PF_FREEZE) refrigerator(PF_FREEZE); } while(0)
19 -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
20 -# define class_device_create(a, b, c, d, e, f, g, h) class_device_create(a, c, d, e, f, g, h)
25 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/demux.h linux-2.6.18/drivers/media/dvb/dvb-core/demux.h
26 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/demux.h 2006-09-20 03:42:06.000000000 +0000
27 +++ linux-2.6.18/drivers/media/dvb/dvb-core/demux.h 2010-09-09 12:38:50.000000000 +0000
29 #define TS_PAYLOAD_ONLY 2 /* in case TS_PACKET is set, only send the TS
30 payload (<=184 bytes per packet) to callback */
31 #define TS_DECODER 4 /* send stream to built-in decoder (if present) */
32 +#define TS_DEMUX 8 /* in case TS_PACKET is set, send the TS to
33 + the demux device, not to the dvr device */
35 /* PES type for filters which write to built-in decoder */
36 /* these should be kept identical to the types in dmx.h */
38 void* priv; /* Pointer to private data of the API client */
39 int (*open) (struct dmx_demux* demux);
40 int (*close) (struct dmx_demux* demux);
41 - int (*write) (struct dmx_demux* demux, const char* buf, size_t count);
42 + int (*write) (struct dmx_demux* demux, const char __user *buf, size_t count);
43 int (*allocate_ts_feed) (struct dmx_demux* demux,
44 struct dmx_ts_feed** feed,
46 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dmxdev.h linux-2.6.18/drivers/media/dvb/dvb-core/dmxdev.h
47 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dmxdev.h 2006-09-20 03:42:06.000000000 +0000
48 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dmxdev.h 2010-09-09 12:38:50.000000000 +0000
50 #include <linux/wait.h>
52 #include <linux/string.h>
54 #include <linux/mutex.h>
55 +#include <linux/slab.h>
57 #include <linux/dvb/dmx.h>
65 + struct dmx_ts_feed *ts;
66 + struct list_head next;
69 struct dmxdev_filter {
71 struct dmx_section_filter *sec;
75 - struct dmx_ts_feed *ts;
76 + /* list of TS and PES feeds (struct dmxdev_feed) */
77 + struct list_head ts;
78 struct dmx_section_feed *sec;
86 + unsigned int exit:1;
87 #define DMXDEV_CAP_DUPLEX 1
88 struct dmx_frontend *dvr_orig_fe;
90 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_ca_en50221.h linux-2.6.18/drivers/media/dvb/dvb-core/dvb_ca_en50221.h
91 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_ca_en50221.h 2006-09-20 03:42:06.000000000 +0000
92 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dvb_ca_en50221.h 2010-09-09 12:38:50.000000000 +0000
94 /* the module owning this structure */
97 - /* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
98 - * they may be called from several threads at once */
99 + /* NOTE: the read_*, write_* and poll_slot_status functions will be
100 + * called for different slots concurrently and need to use locks where
101 + * and if appropriate. There will be no concurrent access to one slot.
104 /* functions for accessing attribute memory on the CAM */
105 int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
106 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_demux.h linux-2.6.18/drivers/media/dvb/dvb-core/dvb_demux.h
107 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_demux.h 2006-09-20 03:42:06.000000000 +0000
108 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dvb_demux.h 2010-09-09 12:38:50.000000000 +0000
110 #include <linux/time.h>
111 #include <linux/timer.h>
112 #include <linux/spinlock.h>
114 #include <linux/mutex.h>
119 #define DVB_DEMUX_MASK_MAX 18
121 +#define MAX_PID 0x1fff
123 +#define SPEED_PKTS_INTERVAL 50000
125 struct dvb_demux_filter {
126 struct dmx_section_filter filter;
127 u8 maskandmode[DMX_MAX_FILTER_SIZE];
133 + uint8_t *cnt_storage; /* for TS continuity check */
135 + struct timespec speed_last_time; /* for TS speed check */
136 + uint32_t speed_pkts_cnt; /* for TS speed check */
139 int dvb_dmx_init(struct dvb_demux *dvbdemux);
140 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvbdev.h linux-2.6.18/drivers/media/dvb/dvb-core/dvbdev.h
141 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvbdev.h 2006-09-20 03:42:06.000000000 +0000
142 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dvbdev.h 2010-09-09 12:38:50.000000000 +0000
144 #include <linux/poll.h>
145 #include <linux/fs.h>
146 #include <linux/list.h>
147 -#include <linux/smp_lock.h>
149 #define DVB_MAJOR 212
151 +#if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
152 + #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
154 + #define DVB_MAX_ADAPTERS 8
157 +#define DVB_UNSET (-1)
159 #define DVB_DEVICE_VIDEO 0
160 #define DVB_DEVICE_AUDIO 1
161 #define DVB_DEVICE_SEC 2
163 #define DVB_DEVICE_NET 7
164 #define DVB_DEVICE_OSD 8
166 +#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
167 + static short adapter_nr[] = \
168 + {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
169 + module_param_array(adapter_nr, short, NULL, 0444); \
170 + MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
172 +struct dvb_frontend;
177 struct device *device;
179 struct module *module;
181 + int mfe_shared; /* indicates mutually exclusive frontends */
182 + struct dvb_device *mfe_dvbdev; /* frontend device in use */
183 + struct mutex mfe_lock; /* access lock for thread creation */
185 + /* Allow the adapter/bridge driver to perform an action before and/or
186 + * after the core handles an ioctl:
188 + * DVB_FE_IOCTL_PRE indicates that the ioctl has not yet been handled.
189 + * DVB_FE_IOCTL_POST indicates that the ioctl has been handled.
191 + * When DVB_FE_IOCTL_PRE is passed to the callback as the stage arg:
193 + * return 0 to allow dvb-core to handle the ioctl.
194 + * return a positive int to prevent dvb-core from handling the ioctl,
195 + * and exit without error.
196 + * return a negative int to prevent dvb-core from handling the ioctl,
197 + * and return that value as an error.
199 + * When DVB_FE_IOCTL_POST is passed to the callback as the stage arg:
201 + * return 0 to allow the dvb_frontend ioctl handler to exit normally.
202 + * return a negative int to cause the dvb_frontend ioctl handler to
203 + * return that value as an error.
205 +#define DVB_FE_IOCTL_PRE 0
206 +#define DVB_FE_IOCTL_POST 1
207 + int (*fe_ioctl_override)(struct dvb_frontend *fe,
208 + unsigned int cmd, void *parg,
209 + unsigned int stage);
214 struct list_head list_head;
215 - struct file_operations *fops;
216 + const struct file_operations *fops;
217 struct dvb_adapter *adapter;
222 /* in theory, 'users' can vanish now,
227 + wait_queue_head_t wait_queue;
228 /* don't really need those !? -- FIXME: use video_usercopy */
229 int (*kernel_ioctl)(struct inode *inode, struct file *file,
230 unsigned int cmd, void *arg);
235 -extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
236 +extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
237 + struct module *module, struct device *device,
238 + short *adapter_nums);
239 extern int dvb_unregister_adapter (struct dvb_adapter *adap);
241 extern int dvb_register_device (struct dvb_adapter *adap,
243 int (*func)(struct inode *inode, struct file *file,
244 unsigned int cmd, void *arg));
246 +/** generic DVB attach function. */
247 +#ifdef CONFIG_MEDIA_ATTACH
248 +#define dvb_attach(FUNCTION, ARGS...) ({ \
249 + void *__r = NULL; \
250 + typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
252 + __r = (void *) __a(ARGS); \
254 + symbol_put(FUNCTION); \
256 + printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \
262 +#define dvb_attach(FUNCTION, ARGS...) ({ \
268 #endif /* #ifndef _DVBDEV_H_ */
269 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_frontend.h linux-2.6.18/drivers/media/dvb/dvb-core/dvb_frontend.h
270 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_frontend.h 2006-09-20 03:42:06.000000000 +0000
271 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dvb_frontend.h 2010-09-09 12:38:50.000000000 +0000
273 #include <linux/module.h>
274 #include <linux/errno.h>
275 #include <linux/delay.h>
276 +#include <linux/mutex.h>
277 +#include <linux/slab.h>
279 #include <linux/dvb/frontend.h>
285 +struct analog_parameters {
286 + unsigned int frequency;
288 + unsigned int audmode;
293 + DVBFE_MODCOD_DUMMY_PLFRAME = 0,
294 + DVBFE_MODCOD_QPSK_1_4,
295 + DVBFE_MODCOD_QPSK_1_3,
296 + DVBFE_MODCOD_QPSK_2_5,
297 + DVBFE_MODCOD_QPSK_1_2,
298 + DVBFE_MODCOD_QPSK_3_5,
299 + DVBFE_MODCOD_QPSK_2_3,
300 + DVBFE_MODCOD_QPSK_3_4,
301 + DVBFE_MODCOD_QPSK_4_5,
302 + DVBFE_MODCOD_QPSK_5_6,
303 + DVBFE_MODCOD_QPSK_8_9,
304 + DVBFE_MODCOD_QPSK_9_10,
305 + DVBFE_MODCOD_8PSK_3_5,
306 + DVBFE_MODCOD_8PSK_2_3,
307 + DVBFE_MODCOD_8PSK_3_4,
308 + DVBFE_MODCOD_8PSK_5_6,
309 + DVBFE_MODCOD_8PSK_8_9,
310 + DVBFE_MODCOD_8PSK_9_10,
311 + DVBFE_MODCOD_16APSK_2_3,
312 + DVBFE_MODCOD_16APSK_3_4,
313 + DVBFE_MODCOD_16APSK_4_5,
314 + DVBFE_MODCOD_16APSK_5_6,
315 + DVBFE_MODCOD_16APSK_8_9,
316 + DVBFE_MODCOD_16APSK_9_10,
317 + DVBFE_MODCOD_32APSK_3_4,
318 + DVBFE_MODCOD_32APSK_4_5,
319 + DVBFE_MODCOD_32APSK_5_6,
320 + DVBFE_MODCOD_32APSK_8_9,
321 + DVBFE_MODCOD_32APSK_9_10,
322 + DVBFE_MODCOD_RESERVED_1,
323 + DVBFE_MODCOD_BPSK_1_3,
324 + DVBFE_MODCOD_BPSK_1_4,
325 + DVBFE_MODCOD_RESERVED_2
329 + DVBFE_TUNER_FREQUENCY = (1 << 0),
330 + DVBFE_TUNER_TUNERSTEP = (1 << 1),
331 + DVBFE_TUNER_IFFREQ = (1 << 2),
332 + DVBFE_TUNER_BANDWIDTH = (1 << 3),
333 + DVBFE_TUNER_REFCLOCK = (1 << 4),
334 + DVBFE_TUNER_IQSENSE = (1 << 5),
335 + DVBFE_TUNER_DUMMY = (1 << 31)
339 + * ALGO_HW: (Hardware Algorithm)
340 + * ----------------------------------------------------------------
341 + * Devices that support this algorithm do everything in hardware
342 + * and no software support is needed to handle them.
343 + * Requesting these devices to LOCK is the only thing required,
344 + * device is supposed to do everything in the hardware.
346 + * ALGO_SW: (Software Algorithm)
347 + * ----------------------------------------------------------------
348 + * These are dumb devices, that require software to do everything
350 + * ALGO_CUSTOM: (Customizable Agorithm)
351 + * ----------------------------------------------------------------
352 + * Devices having this algorithm can be customized to have specific
353 + * algorithms in the frontend driver, rather than simply doing a
354 + * software zig-zag. In this case the zigzag maybe hardware assisted
355 + * or it maybe completely done in hardware. In all cases, usage of
356 + * this algorithm, in conjunction with the search and track
357 + * callbacks, utilizes the driver specific algorithm.
359 + * ALGO_RECOVERY: (Recovery Algorithm)
360 + * ----------------------------------------------------------------
361 + * These devices have AUTO recovery capabilities from LOCK failure
364 + DVBFE_ALGO_HW = (1 << 0),
365 + DVBFE_ALGO_SW = (1 << 1),
366 + DVBFE_ALGO_CUSTOM = (1 << 2),
367 + DVBFE_ALGO_RECOVERY = (1 << 31)
370 +struct tuner_state {
380 + * search callback possible return status
382 + * DVBFE_ALGO_SEARCH_SUCCESS
383 + * The frontend search algorithm completed and returned successfully
385 + * DVBFE_ALGO_SEARCH_ASLEEP
386 + * The frontend search algorithm is sleeping
388 + * DVBFE_ALGO_SEARCH_FAILED
389 + * The frontend search for a signal failed
391 + * DVBFE_ALGO_SEARCH_INVALID
392 + * The frontend search algorith was probably supplied with invalid
393 + * parameters and the search is an invalid one
395 + * DVBFE_ALGO_SEARCH_ERROR
396 + * The frontend search algorithm failed due to some error
398 + * DVBFE_ALGO_SEARCH_AGAIN
399 + * The frontend search algorithm was requested to search again
402 + DVBFE_ALGO_SEARCH_SUCCESS = (1 << 0),
403 + DVBFE_ALGO_SEARCH_ASLEEP = (1 << 1),
404 + DVBFE_ALGO_SEARCH_FAILED = (1 << 2),
405 + DVBFE_ALGO_SEARCH_INVALID = (1 << 3),
406 + DVBFE_ALGO_SEARCH_AGAIN = (1 << 4),
407 + DVBFE_ALGO_SEARCH_ERROR = (1 << 31),
411 struct dvb_tuner_ops {
413 struct dvb_tuner_info info;
416 /** This is for simple PLLs - set all parameters in one go. */
417 int (*set_params)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
418 + int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
420 /** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
421 int (*calc_regs)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p, u8 *buf, int buf_len);
423 + /** This is to allow setting tuner-specific configs */
424 + int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
426 int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
427 int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
429 #define TUNER_STATUS_LOCKED 1
430 +#define TUNER_STATUS_STEREO 2
431 int (*get_status)(struct dvb_frontend *fe, u32 *status);
432 + int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
434 - /** These are provided seperately from set_params in order to facilitate silicon
435 - * tuners which require sophisticated tuning loops, controlling each parameter seperately. */
436 + /** These are provided separately from set_params in order to facilitate silicon
437 + * tuners which require sophisticated tuning loops, controlling each parameter separately. */
438 int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
439 int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
442 + * These are provided separately from set_params in order to facilitate silicon
443 + * tuners which require sophisticated tuning loops, controlling each parameter separately.
445 + int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
446 + int (*get_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
449 +struct analog_demod_info {
453 +struct analog_demod_ops {
455 + struct analog_demod_info info;
457 + void (*set_params)(struct dvb_frontend *fe,
458 + struct analog_parameters *params);
459 + int (*has_signal)(struct dvb_frontend *fe);
460 + int (*is_stereo)(struct dvb_frontend *fe);
461 + int (*get_afc)(struct dvb_frontend *fe);
462 + void (*tuner_status)(struct dvb_frontend *fe);
463 + void (*standby)(struct dvb_frontend *fe);
464 + void (*release)(struct dvb_frontend *fe);
465 + int (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
467 + /** This is to allow setting tuner-specific configuration */
468 + int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
471 struct dvb_frontend_ops {
473 struct dvb_frontend_info info;
475 void (*release)(struct dvb_frontend* fe);
476 + void (*release_sec)(struct dvb_frontend* fe);
478 int (*init)(struct dvb_frontend* fe);
479 int (*sleep)(struct dvb_frontend* fe);
481 + int (*write)(struct dvb_frontend* fe, u8* buf, int len);
483 /* if this is set, it overrides the default swzigzag */
484 int (*tune)(struct dvb_frontend* fe,
485 struct dvb_frontend_parameters* params,
486 unsigned int mode_flags,
488 + unsigned int *delay,
489 fe_status_t *status);
490 /* get frontend tuning algorithm from the module */
491 - int (*get_frontend_algo)(struct dvb_frontend *fe);
492 + enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *fe);
494 /* these two are only used for the swzigzag code */
495 int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
497 int (*enable_high_lnb_voltage)(struct dvb_frontend* fe, long arg);
498 int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd);
499 int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable);
500 + int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
502 + /* These callbacks are for devices that implement their own
503 + * tuning algorithms, rather than a simple swzigzag
505 + enum dvbfe_search (*search)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
506 + int (*track)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
508 struct dvb_tuner_ops tuner_ops;
509 + struct analog_demod_ops analog_ops;
511 + int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
512 + int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
516 @@ -138,22 +315,72 @@
519 wait_queue_head_t wait_queue;
520 - struct semaphore sem;
524 +struct dtv_frontend_properties {
530 + fe_modulation_t modulation;
532 + fe_sec_voltage_t voltage;
533 + fe_sec_tone_mode_t sectone;
534 + fe_spectral_inversion_t inversion;
535 + fe_code_rate_t fec_inner;
536 + fe_transmit_mode_t transmission_mode;
537 + u32 bandwidth_hz; /* 0 = AUTO */
538 + fe_guard_interval_t guard_interval;
539 + fe_hierarchy_t hierarchy;
541 + fe_code_rate_t code_rate_HP;
542 + fe_code_rate_t code_rate_LP;
545 + fe_rolloff_t rolloff;
547 + fe_delivery_system_t delivery_system;
549 + /* ISDB-T specifics */
550 + u8 isdbt_partial_reception;
552 + u8 isdbt_sb_subchannel;
553 + u32 isdbt_sb_segment_idx;
554 + u32 isdbt_sb_segment_count;
555 + u8 isdbt_layer_enabled;
558 + fe_code_rate_t fec;
559 + fe_modulation_t modulation;
563 + /* ISDB-T specifics */
567 struct dvb_frontend {
568 struct dvb_frontend_ops ops;
569 struct dvb_adapter *dvb;
570 - void* demodulator_priv;
572 - void* frontend_priv;
574 + void *demodulator_priv;
576 + void *frontend_priv;
578 + void *analog_demod_priv;
579 + struct dtv_frontend_properties dtv_property_cache;
580 +#define DVB_FRONTEND_COMPONENT_TUNER 0
581 + int (*callback)(void *adapter_priv, int component, int cmd, int arg);
585 -extern int dvb_register_frontend(struct dvb_adapter* dvb,
586 - struct dvb_frontend* fe);
587 +extern int dvb_register_frontend(struct dvb_adapter *dvb,
588 + struct dvb_frontend *fe);
590 +extern int dvb_unregister_frontend(struct dvb_frontend *fe);
592 -extern int dvb_unregister_frontend(struct dvb_frontend* fe);
593 +extern void dvb_frontend_detach(struct dvb_frontend *fe);
595 extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
597 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_net.h linux-2.6.18/drivers/media/dvb/dvb-core/dvb_net.h
598 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_net.h 2006-09-20 03:42:06.000000000 +0000
599 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dvb_net.h 2010-09-09 12:38:50.000000000 +0000
601 struct dvb_device *dvbdev;
602 struct net_device *device[DVB_NET_DEVICES_MAX];
603 int state[DVB_NET_DEVICES_MAX];
604 + unsigned int exit:1;
605 struct dmx_demux *demux;
608 diff -Naur linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_ringbuffer.h linux-2.6.18/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
609 --- linux-2.6.18/drivers/media/dvb.orig/dvb-core/dvb_ringbuffer.h 2006-09-20 03:42:06.000000000 +0000
610 +++ linux-2.6.18/drivers/media/dvb/dvb-core/dvb_ringbuffer.h 2010-09-10 11:57:24.000000000 +0000
614 wait_queue_head_t queue;
620 ** *** read min. 1000, max. <bufsize> bytes ***
621 ** avail = dvb_ringbuffer_avail(rbuf);
622 ** if (avail >= 1000)
623 -** count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize), 0);
624 +** count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
629 ** to lock read or write operations.
630 ** Two or more readers must be locked against each other.
631 ** Flushing the buffer counts as a read operation.
632 +** Resetting the buffer counts as a read and write operation.
633 ** Two or more writers must be locked against each other.
637 extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
641 +** Reset the read and write pointers to zero and flush the buffer
642 +** This counts as a read and write operation
644 +extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
647 /* read routines & macros */
648 /* ---------------------- */
651 ** <usermem> specifies whether <buf> resides in user space
652 ** returns number of bytes transferred or -EFAULT
654 -extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
655 - size_t len, int usermem);
656 +extern ssize_t dvb_ringbuffer_read_user(struct dvb_ringbuffer *rbuf,
657 + u8 __user *buf, size_t len);
658 +extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
659 + u8 *buf, size_t len);
662 /* write routines & macros */
664 * <usermem> Set to 1 if <buf> is in userspace.
665 * returns Number of bytes read, or -EFAULT.
667 +extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx,
668 + int offset, u8 __user *buf, size_t len);
669 extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
670 - int offset, u8* buf, size_t len, int usermem);
671 + int offset, u8 *buf, size_t len);
674 * Dispose of a packet in the ring buffer.