videobuf2-dvb.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. /*
  10. * TODO: This header file should be replaced with videobuf2-core.h
  11. * Currently, vb2_thread is not a stuff of videobuf2-core,
  12. * since vb2_thread has many dependencies on videobuf2-v4l2.
  13. */
  14. struct vb2_dvb {
  15. /* filling that the job of the driver */
  16. char *name;
  17. struct dvb_frontend *frontend;
  18. struct vb2_queue dvbq;
  19. /* video-buf-dvb state info */
  20. struct mutex lock;
  21. int nfeeds;
  22. /* vb2_dvb_(un)register manages this */
  23. struct dvb_demux demux;
  24. struct dmxdev dmxdev;
  25. struct dmx_frontend fe_hw;
  26. struct dmx_frontend fe_mem;
  27. struct dvb_net net;
  28. };
  29. struct vb2_dvb_frontend {
  30. struct list_head felist;
  31. int id;
  32. struct vb2_dvb dvb;
  33. };
  34. struct vb2_dvb_frontends {
  35. struct list_head felist;
  36. struct mutex lock;
  37. struct dvb_adapter adapter;
  38. int active_fe_id; /* Indicates which frontend in the felist is in use */
  39. int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
  40. };
  41. int vb2_dvb_register_bus(struct vb2_dvb_frontends *f,
  42. struct module *module,
  43. void *adapter_priv,
  44. struct device *device,
  45. short *adapter_nr,
  46. int mfe_shared);
  47. void vb2_dvb_unregister_bus(struct vb2_dvb_frontends *f);
  48. struct vb2_dvb_frontend *vb2_dvb_alloc_frontend(struct vb2_dvb_frontends *f, int id);
  49. void vb2_dvb_dealloc_frontends(struct vb2_dvb_frontends *f);
  50. struct vb2_dvb_frontend *vb2_dvb_get_frontend(struct vb2_dvb_frontends *f, int id);
  51. int vb2_dvb_find_frontend(struct vb2_dvb_frontends *f, struct dvb_frontend *p);
  52. #endif /* _VIDEOBUF2_DVB_H_ */