|
SASC
DVBSoftCAM
|
00001 /* 00002 * dvbdev.h 00003 * 00004 * Copyright (C) 2000 Ralph Metzler & Marcus Metzler 00005 * for convergence integrated media GmbH 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Lesser Public License 00009 * as published by the Free Software Foundation; either version 2.1 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 * 00021 */ 00022 00023 #ifndef _DVBDEV_H_ 00024 #define _DVBDEV_H_ 00025 00026 #include <linux/types.h> 00027 #include <linux/poll.h> 00028 #include <linux/fs.h> 00029 #include <linux/list.h> 00030 #include <linux/smp_lock.h> 00031 00032 #define DVB_MAJOR 212 00033 00034 #define DVB_DEVICE_VIDEO 0 00035 #define DVB_DEVICE_AUDIO 1 00036 #define DVB_DEVICE_SEC 2 00037 #define DVB_DEVICE_FRONTEND 3 00038 #define DVB_DEVICE_DEMUX 4 00039 #define DVB_DEVICE_DVR 5 00040 #define DVB_DEVICE_CA 6 00041 #define DVB_DEVICE_NET 7 00042 #define DVB_DEVICE_OSD 8 00043 00044 00045 struct dvb_adapter { 00046 int num; 00047 struct list_head list_head; 00048 struct list_head device_list; 00049 const char *name; 00050 u8 proposed_mac [6]; 00051 void* priv; 00052 00053 struct device *device; 00054 00055 struct module *module; 00056 }; 00057 00058 00059 struct dvb_device { 00060 struct list_head list_head; 00061 struct file_operations *fops; 00062 struct dvb_adapter *adapter; 00063 int type; 00064 u32 id; 00065 00066 /* in theory, 'users' can vanish now, 00067 but I don't want to change too much now... */ 00068 int readers; 00069 int writers; 00070 int users; 00071 00072 /* don't really need those !? -- FIXME: use video_usercopy */ 00073 int (*kernel_ioctl)(struct inode *inode, struct file *file, 00074 unsigned int cmd, void *arg); 00075 00076 void *priv; 00077 }; 00078 00079 00080 extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device); 00081 extern int dvb_unregister_adapter (struct dvb_adapter *adap); 00082 00083 extern int dvb_register_device (struct dvb_adapter *adap, 00084 struct dvb_device **pdvbdev, 00085 const struct dvb_device *template, 00086 void *priv, 00087 int type); 00088 00089 extern void dvb_unregister_device (struct dvb_device *dvbdev); 00090 00091 extern int dvb_generic_open (struct inode *inode, struct file *file); 00092 extern int dvb_generic_release (struct inode *inode, struct file *file); 00093 extern int dvb_generic_ioctl (struct inode *inode, struct file *file, 00094 unsigned int cmd, unsigned long arg); 00095 00096 /* we don't mess with video_usercopy() any more, 00097 we simply define out own dvb_usercopy(), which will hopefully become 00098 generic_usercopy() someday... */ 00099 00100 extern int dvb_usercopy(struct inode *inode, struct file *file, 00101 unsigned int cmd, unsigned long arg, 00102 int (*func)(struct inode *inode, struct file *file, 00103 unsigned int cmd, void *arg)); 00104 00106 #ifdef CONFIG_DVB_CORE_ATTACH 00107 #define dvb_attach(FUNCTION, ARGS...) ({ \ 00108 void *__r = NULL; \ 00109 typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ 00110 if (__a) { \ 00111 __r = (void *) __a(ARGS); \ 00112 if (__r == NULL) \ 00113 symbol_put(FUNCTION); \ 00114 } else { \ 00115 printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \ 00116 } \ 00117 __r; \ 00118 }) 00119 00120 #else 00121 #define dvb_attach(FUNCTION, ARGS...) ({ \ 00122 FUNCTION(ARGS); \ 00123 }) 00124 00125 #endif 00126 00127 #endif /* #ifndef _DVBDEV_H_ */