1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
6 #ifndef __PVRUSB2_CONTEXT_H
7 #define __PVRUSB2_CONTEXT_H
9 #include <linux/mutex.h>
10 #include <linux/usb.h>
11 #include <linux/workqueue.h>
13 struct pvr2_hdw
; /* hardware interface - defined elsewhere */
14 struct pvr2_stream
; /* stream interface - defined elsewhere */
16 struct pvr2_context
; /* All central state */
17 struct pvr2_channel
; /* One I/O pathway to a user */
18 struct pvr2_context_stream
; /* Wrapper for a stream */
19 struct pvr2_ioread
; /* Low level stream structure */
21 struct pvr2_context_stream
{
22 struct pvr2_channel
*user
;
23 struct pvr2_stream
*stream
;
27 struct pvr2_channel
*mc_first
;
28 struct pvr2_channel
*mc_last
;
29 struct pvr2_context
*exist_next
;
30 struct pvr2_context
*exist_prev
;
31 struct pvr2_context
*notify_next
;
32 struct pvr2_context
*notify_prev
;
34 struct pvr2_context_stream video_stream
;
40 /* Called after pvr2_context initialization is complete */
41 void (*setup_func
)(struct pvr2_context
*);
46 struct pvr2_context
*mc_head
;
47 struct pvr2_channel
*mc_next
;
48 struct pvr2_channel
*mc_prev
;
49 struct pvr2_context_stream
*stream
;
51 unsigned int input_mask
;
52 void (*check_func
)(struct pvr2_channel
*);
55 struct pvr2_context
*pvr2_context_create(struct usb_interface
*intf
,
56 const struct usb_device_id
*devid
,
57 void (*setup_func
)(struct pvr2_context
*));
58 void pvr2_context_disconnect(struct pvr2_context
*);
60 void pvr2_channel_init(struct pvr2_channel
*,struct pvr2_context
*);
61 void pvr2_channel_done(struct pvr2_channel
*);
62 int pvr2_channel_limit_inputs(struct pvr2_channel
*,unsigned int);
63 unsigned int pvr2_channel_get_limited_inputs(struct pvr2_channel
*);
64 int pvr2_channel_claim_stream(struct pvr2_channel
*,
65 struct pvr2_context_stream
*);
66 struct pvr2_ioread
*pvr2_channel_create_mpeg_stream(
67 struct pvr2_context_stream
*);
69 int pvr2_context_global_init(void);
70 void pvr2_context_global_done(void);
72 #endif /* __PVRUSB2_CONTEXT_H */