0001
0002
0003
0004
0005
0006 #ifndef __PVRUSB2_CONTEXT_H
0007 #define __PVRUSB2_CONTEXT_H
0008
0009 #include <linux/mutex.h>
0010 #include <linux/usb.h>
0011 #include <linux/workqueue.h>
0012
0013 struct pvr2_hdw;
0014 struct pvr2_stream;
0015
0016 struct pvr2_context;
0017 struct pvr2_channel;
0018 struct pvr2_context_stream;
0019 struct pvr2_ioread;
0020
0021 struct pvr2_context_stream {
0022 struct pvr2_channel *user;
0023 struct pvr2_stream *stream;
0024 };
0025
0026 struct pvr2_context {
0027 struct pvr2_channel *mc_first;
0028 struct pvr2_channel *mc_last;
0029 struct pvr2_context *exist_next;
0030 struct pvr2_context *exist_prev;
0031 struct pvr2_context *notify_next;
0032 struct pvr2_context *notify_prev;
0033 struct pvr2_hdw *hdw;
0034 struct pvr2_context_stream video_stream;
0035 struct mutex mutex;
0036 int notify_flag;
0037 int initialized_flag;
0038 int disconnect_flag;
0039
0040
0041 void (*setup_func)(struct pvr2_context *);
0042
0043 };
0044
0045 struct pvr2_channel {
0046 struct pvr2_context *mc_head;
0047 struct pvr2_channel *mc_next;
0048 struct pvr2_channel *mc_prev;
0049 struct pvr2_context_stream *stream;
0050 struct pvr2_hdw *hdw;
0051 unsigned int input_mask;
0052 void (*check_func)(struct pvr2_channel *);
0053 };
0054
0055 struct pvr2_context *pvr2_context_create(struct usb_interface *intf,
0056 const struct usb_device_id *devid,
0057 void (*setup_func)(struct pvr2_context *));
0058 void pvr2_context_disconnect(struct pvr2_context *);
0059
0060 void pvr2_channel_init(struct pvr2_channel *,struct pvr2_context *);
0061 void pvr2_channel_done(struct pvr2_channel *);
0062 int pvr2_channel_limit_inputs(struct pvr2_channel *,unsigned int);
0063 unsigned int pvr2_channel_get_limited_inputs(struct pvr2_channel *);
0064 int pvr2_channel_claim_stream(struct pvr2_channel *,
0065 struct pvr2_context_stream *);
0066 struct pvr2_ioread *pvr2_channel_create_mpeg_stream(
0067 struct pvr2_context_stream *);
0068
0069 int pvr2_context_global_init(void);
0070 void pvr2_context_global_done(void);
0071
0072 #endif