mei: me: add cannon point device ids
[linux/fpc-iii.git] / drivers / media / dvb-core / dmxdev.h
blob5e795f5f0f41826db706bb3371172332f8d2e903
1 /*
2 * dmxdev.h
4 * Copyright (C) 2000 Ralph Metzler & Marcus Metzler
5 * for convergence integrated media GmbH
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
19 #ifndef _DMXDEV_H_
20 #define _DMXDEV_H_
22 #include <linux/types.h>
23 #include <linux/spinlock.h>
24 #include <linux/kernel.h>
25 #include <linux/time.h>
26 #include <linux/timer.h>
27 #include <linux/wait.h>
28 #include <linux/fs.h>
29 #include <linux/string.h>
30 #include <linux/mutex.h>
31 #include <linux/slab.h>
33 #include <linux/dvb/dmx.h>
35 #include "dvbdev.h"
36 #include "demux.h"
37 #include "dvb_ringbuffer.h"
39 /**
40 * enum dmxdev_type - type of demux filter type.
42 * @DMXDEV_TYPE_NONE: no filter set.
43 * @DMXDEV_TYPE_SEC: section filter.
44 * @DMXDEV_TYPE_PES: Program Elementary Stream (PES) filter.
46 enum dmxdev_type {
47 DMXDEV_TYPE_NONE,
48 DMXDEV_TYPE_SEC,
49 DMXDEV_TYPE_PES,
52 /**
53 * enum dmxdev_state - state machine for the dmxdev.
55 * @DMXDEV_STATE_FREE: indicates that the filter is freed.
56 * @DMXDEV_STATE_ALLOCATED: indicates that the filter was allocated
57 * to be used.
58 * @DMXDEV_STATE_SET: indicates that the filter parameters are set.
59 * @DMXDEV_STATE_GO: indicates that the filter is running.
60 * @DMXDEV_STATE_DONE: indicates that a packet was already filtered
61 * and the filter is now disabled.
62 * Set only if %DMX_ONESHOT. See
63 * &dmx_sct_filter_params.
64 * @DMXDEV_STATE_TIMEDOUT: Indicates a timeout condition.
66 enum dmxdev_state {
67 DMXDEV_STATE_FREE,
68 DMXDEV_STATE_ALLOCATED,
69 DMXDEV_STATE_SET,
70 DMXDEV_STATE_GO,
71 DMXDEV_STATE_DONE,
72 DMXDEV_STATE_TIMEDOUT
75 /**
76 * struct dmxdev_feed - digital TV dmxdev feed
78 * @pid: Program ID to be filtered
79 * @ts: pointer to &struct dmx_ts_feed
80 * @next: &struct list_head pointing to the next feed.
83 struct dmxdev_feed {
84 u16 pid;
85 struct dmx_ts_feed *ts;
86 struct list_head next;
89 /**
90 * struct dmxdev_filter - digital TV dmxdev filter
92 * @filter: a dmxdev filter. Currently used only for section filter:
93 * if the filter is Section, it contains a
94 * &struct dmx_section_filter @sec pointer.
95 * @feed: a dmxdev feed. Depending on the feed type, it can be:
96 * for TS feed: a &struct list_head @ts list of TS and PES
97 * feeds;
98 * for section feed: a &struct dmx_section_feed @sec pointer.
99 * @params: dmxdev filter parameters. Depending on the feed type, it
100 * can be:
101 * for section filter: a &struct dmx_sct_filter_params @sec
102 * embedded struct;
103 * for a TS filter: a &struct dmx_pes_filter_params @pes
104 * embedded struct.
105 * @type: type of the dmxdev filter, as defined by &enum dmxdev_type.
106 * @state: state of the dmxdev filter, as defined by &enum dmxdev_state.
107 * @dev: pointer to &struct dmxdev.
108 * @buffer: an embedded &struct dvb_ringbuffer buffer.
109 * @mutex: protects the access to &struct dmxdev_filter.
110 * @timer: &struct timer_list embedded timer, used to check for
111 * feed timeouts.
112 * Only for section filter.
113 * @todo: index for the @secheader.
114 * Only for section filter.
115 * @secheader: buffer cache to parse the section header.
116 * Only for section filter.
118 struct dmxdev_filter {
119 union {
120 struct dmx_section_filter *sec;
121 } filter;
123 union {
124 /* list of TS and PES feeds (struct dmxdev_feed) */
125 struct list_head ts;
126 struct dmx_section_feed *sec;
127 } feed;
129 union {
130 struct dmx_sct_filter_params sec;
131 struct dmx_pes_filter_params pes;
132 } params;
134 enum dmxdev_type type;
135 enum dmxdev_state state;
136 struct dmxdev *dev;
137 struct dvb_ringbuffer buffer;
139 struct mutex mutex;
141 /* only for sections */
142 struct timer_list timer;
143 int todo;
144 u8 secheader[3];
148 * struct dmxdev - Describes a digital TV demux device.
150 * @dvbdev: pointer to &struct dvb_device associated with
151 * the demux device node.
152 * @dvr_dvbdev: pointer to &struct dvb_device associated with
153 * the dvr device node.
154 * @filter: pointer to &struct dmxdev_filter.
155 * @demux: pointer to &struct dmx_demux.
156 * @filternum: number of filters.
157 * @capabilities: demux capabilities as defined by &enum dmx_demux_caps.
158 * @exit: flag to indicate that the demux is being released.
159 * @dvr_orig_fe: pointer to &struct dmx_frontend.
160 * @dvr_buffer: embedded &struct dvb_ringbuffer for DVB output.
161 * @mutex: protects the usage of this structure.
162 * @lock: protects access to &dmxdev->filter->data.
164 struct dmxdev {
165 struct dvb_device *dvbdev;
166 struct dvb_device *dvr_dvbdev;
168 struct dmxdev_filter *filter;
169 struct dmx_demux *demux;
171 int filternum;
172 int capabilities;
174 unsigned int exit:1;
175 #define DMXDEV_CAP_DUPLEX 1
176 struct dmx_frontend *dvr_orig_fe;
178 struct dvb_ringbuffer dvr_buffer;
179 #define DVR_BUFFER_SIZE (10*188*1024)
181 struct mutex mutex;
182 spinlock_t lock;
186 * dvb_dmxdev_init - initializes a digital TV demux and registers both demux
187 * and DVR devices.
189 * @dmxdev: pointer to &struct dmxdev.
190 * @adap: pointer to &struct dvb_adapter.
192 int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *adap);
195 * dvb_dmxdev_release - releases a digital TV demux and unregisters it.
197 * @dmxdev: pointer to &struct dmxdev.
199 void dvb_dmxdev_release(struct dmxdev *dmxdev);
201 #endif /* _DMXDEV_H_ */