blob: a14ac7711c925adc93ae504f666e312622bf53ca [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* SPDX-License-Identifier: GPL-2.0 */
2#include <dvbdev.h>
3#include <dmxdev.h>
4#include <dvb_demux.h>
5#include <dvb_net.h>
6#include <dvb_frontend.h>
7
8#ifndef _VIDEOBUF_DVB_H_
9#define _VIDEOBUF_DVB_H_
10
11struct videobuf_dvb {
12 /* filling that the job of the driver */
13 char *name;
14 struct dvb_frontend *frontend;
15 struct videobuf_queue dvbq;
16
17 /* video-buf-dvb state info */
18 struct mutex lock;
19 struct task_struct *thread;
20 int nfeeds;
21
22 /* videobuf_dvb_(un)register manges this */
23 struct dvb_demux demux;
24 struct dmxdev dmxdev;
25 struct dmx_frontend fe_hw;
26 struct dmx_frontend fe_mem;
27 struct dvb_net net;
28};
29
30struct videobuf_dvb_frontend {
31 struct list_head felist;
32 int id;
33 struct videobuf_dvb dvb;
34};
35
36struct videobuf_dvb_frontends {
37 struct list_head felist;
38 struct mutex lock;
39 struct dvb_adapter adapter;
40 int active_fe_id; /* Indicates which frontend in the felist is in use */
41 int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
42};
43
44int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
45 struct module *module,
46 void *adapter_priv,
47 struct device *device,
48 short *adapter_nr,
49 int mfe_shared);
50
51void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
52
53struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id);
54void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f);
55
56struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id);
57int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p);
58
59#endif /* _VIDEOBUF_DVB_H_ */