vserver 1.9.5.x5
[linux-2.6.git] / drivers / media / dvb / dvb-core / dvbdev.h
1 /* 
2  * dvbdev.h
3  *
4  * Copyright (C) 2000 Ralph Metzler & Marcus Metzler
5  *                    for convergence integrated media GmbH
6  *
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.
11  *
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.
16  *
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.
20  *
21  */
22
23 #ifndef _DVBDEV_H_
24 #define _DVBDEV_H_
25
26 #include <linux/types.h>
27 #include <linux/poll.h>
28 #include <linux/fs.h>
29 #include <linux/list.h>
30 #include <linux/devfs_fs_kernel.h>
31 #include <linux/smp_lock.h>
32
33 #define DVB_MAJOR 212
34
35 #define DVB_DEVICE_VIDEO      0
36 #define DVB_DEVICE_AUDIO      1
37 #define DVB_DEVICE_SEC        2
38 #define DVB_DEVICE_FRONTEND   3
39 #define DVB_DEVICE_DEMUX      4
40 #define DVB_DEVICE_DVR        5
41 #define DVB_DEVICE_CA         6
42 #define DVB_DEVICE_NET        7
43 #define DVB_DEVICE_OSD        8
44
45
46 struct dvb_adapter {
47         int num;
48         struct list_head list_head;
49         struct list_head device_list;
50         const char *name;
51         u8 proposed_mac [6];
52         void* priv;
53
54         struct module *module;
55 };
56
57
58 struct dvb_device {
59         struct list_head list_head;
60         struct file_operations *fops;
61  
62  
63  
64         struct dvb_adapter *adapter;
65         int type;
66         u32 id;
67
68         /* in theory, 'users' can vanish now,
69            but I don't want to change too much now... */
70         int readers;
71         int writers;
72         int users;
73
74         /* don't really need those !? -- FIXME: use video_usercopy  */
75         int (*kernel_ioctl)(struct inode *inode, struct file *file,
76                             unsigned int cmd, void *arg);
77
78         void *priv;
79 };
80
81
82 extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name, struct module *module);
83 extern int dvb_unregister_adapter (struct dvb_adapter *adap);
84
85 extern int dvb_register_device (struct dvb_adapter *adap,
86                                 struct dvb_device **pdvbdev, 
87                                 const struct dvb_device *template,
88                                 void *priv,
89                                 int type);
90
91 extern void dvb_unregister_device (struct dvb_device *dvbdev);
92
93 extern int dvb_generic_open (struct inode *inode, struct file *file);
94 extern int dvb_generic_release (struct inode *inode, struct file *file);
95 extern int dvb_generic_ioctl (struct inode *inode, struct file *file,
96                               unsigned int cmd, unsigned long arg);
97
98 /* we don't mess with video_usercopy() any more,
99 we simply define out own dvb_usercopy(), which will hopefully become
100 generic_usercopy()  someday... */
101
102 extern int dvb_usercopy(struct inode *inode, struct file *file,
103                             unsigned int cmd, unsigned long arg,
104                             int (*func)(struct inode *inode, struct file *file,
105                             unsigned int cmd, void *arg));
106
107 #endif /* #ifndef _DVBDEV_H_ */
108