mantis_link.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. Mantis PCI bridge driver
  3. Copyright (C) 2005, 2006 Manu Abraham (abraham.manu@gmail.com)
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef __MANTIS_LINK_H
  17. #define __MANTIS_LINK_H
  18. #include <linux/workqueue.h>
  19. #include "dvb_ca_en50221.h"
  20. enum mantis_sbuf_status {
  21. MANTIS_SBUF_DATA_AVAIL = 1,
  22. MANTIS_SBUF_DATA_EMPTY = 2,
  23. MANTIS_SBUF_DATA_OVFLW = 3
  24. };
  25. struct mantis_slot {
  26. u32 timeout;
  27. u32 slave_cfg;
  28. u32 bar;
  29. };
  30. /* Physical layer */
  31. enum mantis_slot_state {
  32. MODULE_INSERTED = 3,
  33. MODULE_XTRACTED = 4
  34. };
  35. struct mantis_ca {
  36. struct mantis_slot slot[4];
  37. struct work_struct hif_evm_work;
  38. u32 hif_event;
  39. wait_queue_head_t hif_opdone_wq;
  40. wait_queue_head_t hif_brrdyw_wq;
  41. wait_queue_head_t hif_data_wq;
  42. enum mantis_sbuf_status sbuf_status;
  43. enum mantis_slot_state slot_state;
  44. // struct dvb_device *ca_dev;
  45. void *ca_priv;
  46. struct dvb_ca_en50221 en50221;
  47. };
  48. /* CA */
  49. extern void mantis_event_cam_plugin(struct mantis_ca *ca);
  50. extern void mantis_event_cam_unplug(struct mantis_ca *ca);
  51. extern int mantis_pcmcia_init(struct mantis_ca *ca);
  52. extern void mantis_pcmcia_exit(struct mantis_ca *ca);
  53. extern int mantis_evmgr_init(struct mantis_ca *ca);
  54. extern void mantis_evmgr_exit(struct mantis_ca *ca);
  55. /* HIF */
  56. extern int mantis_hif_init(struct mantis_ca *ca);
  57. extern void mantis_hif_exit(struct mantis_ca *ca);
  58. extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr);
  59. extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data);
  60. extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr);
  61. extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u8 data);
  62. #endif // __MANTIS_LINK_H