videobuf2-dvb.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _VIDEOBUF2_DVB_H_
  2. #define _VIDEOBUF2_DVB_H_
  3. #include <dvbdev.h>
  4. #include <dmxdev.h>
  5. #include <dvb_demux.h>
  6. #include <dvb_net.h>
  7. #include <dvb_frontend.h>
  8. #include <media/videobuf2-v4l2.h>
  9. /* We don't actually need to include media-device.h here */
  10. struct media_device;
  11. /*
  12. * TODO: This header file should be replaced with videobuf2-core.h
  13. * Currently, vb2_thread is not a stuff of videobuf2-core,
  14. * since vb2_thread has many dependencies on videobuf2-v4l2.
  15. */
  16. struct vb2_dvb {
  17. /* filling that the job of the driver */
  18. char *name;
  19. struct dvb_frontend *frontend;
  20. struct vb2_queue dvbq;
  21. /* video-buf-dvb state info */
  22. struct mutex lock;
  23. int nfeeds;
  24. /* vb2_dvb_(un)register manages this */
  25. struct dvb_demux demux;
  26. struct dmxdev dmxdev;
  27. struct dmx_frontend fe_hw;
  28. struct dmx_frontend fe_mem;
  29. struct dvb_net net;
  30. };
  31. struct vb2_dvb_frontend {
  32. struct list_head felist;
  33. int id;
  34. struct vb2_dvb dvb;
  35. };
  36. struct vb2_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. int vb2_dvb_register_bus(struct vb2_dvb_frontends *f,
  44. struct module *module,
  45. void *adapter_priv,
  46. struct device *device,
  47. struct media_device *mdev,
  48. short *adapter_nr,
  49. int mfe_shared);
  50. void vb2_dvb_unregister_bus(struct vb2_dvb_frontends *f);
  51. struct vb2_dvb_frontend *vb2_dvb_alloc_frontend(struct vb2_dvb_frontends *f, int id);
  52. void vb2_dvb_dealloc_frontends(struct vb2_dvb_frontends *f);
  53. struct vb2_dvb_frontend *vb2_dvb_get_frontend(struct vb2_dvb_frontends *f, int id);
  54. int vb2_dvb_find_frontend(struct vb2_dvb_frontends *f, struct dvb_frontend *p);
  55. #endif /* _VIDEOBUF2_DVB_H_ */