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 General Lesser 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.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #include <linux/types.h>
27 #include <linux/poll.h>
29 #include <linux/list.h>
30 #include <linux/smp_lock.h>
34 #define DVB_MAX_ADAPTERS 8
36 #define DVB_UNSET (-1)
38 #define DVB_DEVICE_VIDEO 0
39 #define DVB_DEVICE_AUDIO 1
40 #define DVB_DEVICE_SEC 2
41 #define DVB_DEVICE_FRONTEND 3
42 #define DVB_DEVICE_DEMUX 4
43 #define DVB_DEVICE_DVR 5
44 #define DVB_DEVICE_CA 6
45 #define DVB_DEVICE_NET 7
46 #define DVB_DEVICE_OSD 8
48 #define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
49 static short adapter_nr[] = \
50 {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
51 module_param_array(adapter_nr, short, NULL, 0444); \
52 MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
56 struct list_head list_head
;
57 struct list_head device_list
;
62 struct device
*device
;
64 struct module
*module
;
66 int mfe_shared
; /* indicates mutually exclusive frontends */
67 struct dvb_device
*mfe_dvbdev
; /* frontend device in use */
68 struct mutex mfe_lock
; /* access lock for thread creation */
73 struct list_head list_head
;
74 struct file_operations
*fops
;
75 struct dvb_adapter
*adapter
;
80 /* in theory, 'users' can vanish now,
81 but I don't want to change too much now... */
86 wait_queue_head_t wait_queue
;
87 /* don't really need those !? -- FIXME: use video_usercopy */
88 int (*kernel_ioctl
)(struct inode
*inode
, struct file
*file
,
89 unsigned int cmd
, void *arg
);
95 extern int dvb_register_adapter(struct dvb_adapter
*adap
, const char *name
,
96 struct module
*module
, struct device
*device
,
98 extern int dvb_unregister_adapter (struct dvb_adapter
*adap
);
100 extern int dvb_register_device (struct dvb_adapter
*adap
,
101 struct dvb_device
**pdvbdev
,
102 const struct dvb_device
*template,
106 extern void dvb_unregister_device (struct dvb_device
*dvbdev
);
108 extern int dvb_generic_open (struct inode
*inode
, struct file
*file
);
109 extern int dvb_generic_release (struct inode
*inode
, struct file
*file
);
110 extern int dvb_generic_ioctl (struct inode
*inode
, struct file
*file
,
111 unsigned int cmd
, unsigned long arg
);
113 /* we don't mess with video_usercopy() any more,
114 we simply define out own dvb_usercopy(), which will hopefully become
115 generic_usercopy() someday... */
117 extern int dvb_usercopy(struct inode
*inode
, struct file
*file
,
118 unsigned int cmd
, unsigned long arg
,
119 int (*func
)(struct inode
*inode
, struct file
*file
,
120 unsigned int cmd
, void *arg
));
122 /** generic DVB attach function. */
123 #ifdef CONFIG_MEDIA_ATTACH
124 #define dvb_attach(FUNCTION, ARGS...) ({ \
126 typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
128 __r = (void *) __a(ARGS); \
130 symbol_put(FUNCTION); \
132 printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \
138 #define dvb_attach(FUNCTION, ARGS...) ({ \
144 #endif /* #ifndef _DVBDEV_H_ */