1
2
3
4
5
6#ifndef __PVRUSB2_IO_H
7#define __PVRUSB2_IO_H
8
9#include <linux/usb.h>
10#include <linux/list.h>
11
12typedef void (*pvr2_stream_callback)(void *);
13
14enum pvr2_buffer_state {
15 pvr2_buffer_state_none = 0,
16 pvr2_buffer_state_idle = 1,
17 pvr2_buffer_state_queued = 2,
18 pvr2_buffer_state_ready = 3,
19};
20
21struct pvr2_stream;
22struct pvr2_buffer;
23
24struct pvr2_stream_stats {
25 unsigned int buffers_in_queue;
26 unsigned int buffers_in_idle;
27 unsigned int buffers_in_ready;
28 unsigned int buffers_processed;
29 unsigned int buffers_failed;
30 unsigned int bytes_processed;
31};
32
33
34struct pvr2_stream *pvr2_stream_create(void);
35void pvr2_stream_destroy(struct pvr2_stream *);
36void pvr2_stream_setup(struct pvr2_stream *,
37 struct usb_device *dev,int endpoint,
38 unsigned int tolerance);
39void pvr2_stream_set_callback(struct pvr2_stream *,
40 pvr2_stream_callback func,
41 void *data);
42void pvr2_stream_get_stats(struct pvr2_stream *,
43 struct pvr2_stream_stats *,
44 int zero_counts);
45
46
47int pvr2_stream_get_buffer_count(struct pvr2_stream *);
48int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);
49
50
51
52struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *);
53struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *);
54struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id);
55
56
57int pvr2_stream_get_ready_count(struct pvr2_stream *);
58
59
60
61void pvr2_stream_kill(struct pvr2_stream *);
62
63
64int pvr2_buffer_set_buffer(struct pvr2_buffer *,void *ptr,unsigned int cnt);
65
66
67unsigned int pvr2_buffer_get_count(struct pvr2_buffer *);
68
69
70int pvr2_buffer_get_status(struct pvr2_buffer *);
71
72
73int pvr2_buffer_get_id(struct pvr2_buffer *);
74
75
76int pvr2_buffer_queue(struct pvr2_buffer *);
77
78#endif
79