as102_drv.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Abilis Systems Single DVB-T Receiver
  3. * Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2, or (at your option)
  8. * any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef _AS102_DRV_H
  16. #define _AS102_DRV_H
  17. #include <linux/usb.h>
  18. #include <dvb_demux.h>
  19. #include <dvb_frontend.h>
  20. #include <dmxdev.h>
  21. #include "as10x_handle.h"
  22. #include "as10x_cmd.h"
  23. #include "as102_usb_drv.h"
  24. #define DRIVER_FULL_NAME "Abilis Systems as10x usb driver"
  25. #define DRIVER_NAME "as10x_usb"
  26. #define debug as102_debug
  27. extern struct usb_driver as102_usb_driver;
  28. extern int elna_enable;
  29. #define AS102_DEVICE_MAJOR 192
  30. #define AS102_USB_BUF_SIZE 512
  31. #define MAX_STREAM_URB 32
  32. struct as10x_bus_adapter_t {
  33. struct usb_device *usb_dev;
  34. /* bus token lock */
  35. struct mutex lock;
  36. /* low level interface for bus adapter */
  37. union as10x_bus_token_t {
  38. /* usb token */
  39. struct as10x_usb_token_cmd_t usb;
  40. } token;
  41. /* token cmd xfer id */
  42. uint16_t cmd_xid;
  43. /* as10x command and response for dvb interface*/
  44. struct as10x_cmd_t *cmd, *rsp;
  45. /* bus adapter private ops callback */
  46. struct as102_priv_ops_t *ops;
  47. };
  48. struct as102_dev_t {
  49. const char *name;
  50. struct as10x_bus_adapter_t bus_adap;
  51. struct list_head device_entry;
  52. struct kref kref;
  53. uint8_t elna_cfg;
  54. struct dvb_adapter dvb_adap;
  55. struct dvb_frontend *dvb_fe;
  56. struct dvb_demux dvb_dmx;
  57. struct dmxdev dvb_dmxdev;
  58. /* timer handle to trig ts stream download */
  59. struct timer_list timer_handle;
  60. struct mutex sem;
  61. dma_addr_t dma_addr;
  62. void *stream;
  63. int streaming;
  64. struct urb *stream_urb[MAX_STREAM_URB];
  65. };
  66. int as102_dvb_register(struct as102_dev_t *dev);
  67. void as102_dvb_unregister(struct as102_dev_t *dev);
  68. #endif