^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2005 Mike Isely <isely@pobox.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __PVRUSB2_CONTEXT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __PVRUSB2_CONTEXT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/usb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct pvr2_hdw; /* hardware interface - defined elsewhere */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct pvr2_stream; /* stream interface - defined elsewhere */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct pvr2_context; /* All central state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct pvr2_channel; /* One I/O pathway to a user */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct pvr2_context_stream; /* Wrapper for a stream */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct pvr2_ioread; /* Low level stream structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct pvr2_context_stream {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct pvr2_channel *user;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct pvr2_stream *stream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct pvr2_context {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct pvr2_channel *mc_first;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) struct pvr2_channel *mc_last;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct pvr2_context *exist_next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct pvr2_context *exist_prev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct pvr2_context *notify_next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct pvr2_context *notify_prev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct pvr2_hdw *hdw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct pvr2_context_stream video_stream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct mutex mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) int notify_flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) int initialized_flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) int disconnect_flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /* Called after pvr2_context initialization is complete */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void (*setup_func)(struct pvr2_context *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct pvr2_channel {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct pvr2_context *mc_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct pvr2_channel *mc_next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) struct pvr2_channel *mc_prev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct pvr2_context_stream *stream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct pvr2_hdw *hdw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) unsigned int input_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) void (*check_func)(struct pvr2_channel *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct pvr2_context *pvr2_context_create(struct usb_interface *intf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) const struct usb_device_id *devid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) void (*setup_func)(struct pvr2_context *));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) void pvr2_context_disconnect(struct pvr2_context *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) void pvr2_channel_init(struct pvr2_channel *,struct pvr2_context *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) void pvr2_channel_done(struct pvr2_channel *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) int pvr2_channel_limit_inputs(struct pvr2_channel *,unsigned int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) unsigned int pvr2_channel_get_limited_inputs(struct pvr2_channel *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) int pvr2_channel_claim_stream(struct pvr2_channel *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) struct pvr2_context_stream *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct pvr2_ioread *pvr2_channel_create_mpeg_stream(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct pvr2_context_stream *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) int pvr2_context_global_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) void pvr2_context_global_done(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #endif /* __PVRUSB2_CONTEXT_H */