dvbdev.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #ifndef _DVBDEV_H_
  23. #define _DVBDEV_H_
  24. #include <linux/types.h>
  25. #include <linux/poll.h>
  26. #include <linux/fs.h>
  27. #include <linux/list.h>
  28. #include <linux/devfs_fs_kernel.h>
  29. #include <linux/smp_lock.h>
  30. #define DVB_MAJOR 212
  31. #define DVB_DEVICE_VIDEO 0
  32. #define DVB_DEVICE_AUDIO 1
  33. #define DVB_DEVICE_SEC 2
  34. #define DVB_DEVICE_FRONTEND 3
  35. #define DVB_DEVICE_DEMUX 4
  36. #define DVB_DEVICE_DVR 5
  37. #define DVB_DEVICE_CA 6
  38. #define DVB_DEVICE_NET 7
  39. #define DVB_DEVICE_OSD 8
  40. struct dvb_adapter {
  41. int num;
  42. struct list_head list_head;
  43. struct list_head device_list;
  44. const char *name;
  45. u8 proposed_mac [6];
  46. void* priv;
  47. struct module *module;
  48. };
  49. struct dvb_device {
  50. struct list_head list_head;
  51. struct file_operations *fops;
  52. struct dvb_adapter *adapter;
  53. int type;
  54. u32 id;
  55. /* in theory, 'users' can vanish now,
  56. but I don't want to change too much now... */
  57. int readers;
  58. int writers;
  59. int users;
  60. /* don't really need those !? -- FIXME: use video_usercopy */
  61. int (*kernel_ioctl)(struct inode *inode, struct file *file,
  62. unsigned int cmd, void *arg);
  63. void *priv;
  64. };
  65. extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module);
  66. extern int dvb_unregister_adapter (struct dvb_adapter *adap);
  67. extern int dvb_register_device (struct dvb_adapter *adap,
  68. struct dvb_device **pdvbdev,
  69. const struct dvb_device *template,
  70. void *priv,
  71. int type);
  72. extern void dvb_unregister_device (struct dvb_device *dvbdev);
  73. extern int dvb_generic_open (struct inode *inode, struct file *file);
  74. extern int dvb_generic_release (struct inode *inode, struct file *file);
  75. extern int dvb_generic_ioctl (struct inode *inode, struct file *file,
  76. unsigned int cmd, unsigned long arg);
  77. /* we don't mess with video_usercopy() any more,
  78. we simply define out own dvb_usercopy(), which will hopefully become
  79. generic_usercopy() someday... */
  80. extern int dvb_usercopy(struct inode *inode, struct file *file,
  81. unsigned int cmd, unsigned long arg,
  82. int (*func)(struct inode *inode, struct file *file,
  83. unsigned int cmd, void *arg));
  84. #endif /* #ifndef _DVBDEV_H_ */