mantis_link.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. Mantis PCI bridge driver
  3. Copyright (C) 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/mutex.h>
  19. #include <linux/workqueue.h>
  20. #include <media/dvb_ca_en50221.h>
  21. enum mantis_sbuf_status {
  22. MANTIS_SBUF_DATA_AVAIL = 1,
  23. MANTIS_SBUF_DATA_EMPTY = 2,
  24. MANTIS_SBUF_DATA_OVFLW = 3
  25. };
  26. struct mantis_slot {
  27. u32 timeout;
  28. u32 slave_cfg;
  29. u32 bar;
  30. };
  31. /* Physical layer */
  32. enum mantis_slot_state {
  33. MODULE_INSERTED = 3,
  34. MODULE_XTRACTED = 4
  35. };
  36. struct mantis_ca {
  37. struct mantis_slot slot[4];
  38. struct work_struct hif_evm_work;
  39. u32 hif_event;
  40. wait_queue_head_t hif_opdone_wq;
  41. wait_queue_head_t hif_brrdyw_wq;
  42. wait_queue_head_t hif_data_wq;
  43. wait_queue_head_t hif_write_wq; /* HIF Write op */
  44. enum mantis_sbuf_status sbuf_status;
  45. enum mantis_slot_state slot_state;
  46. void *ca_priv;
  47. struct dvb_ca_en50221 en50221;
  48. struct mutex ca_lock;
  49. };
  50. /* CA */
  51. extern void mantis_event_cam_plugin(struct mantis_ca *ca);
  52. extern void mantis_event_cam_unplug(struct mantis_ca *ca);
  53. extern int mantis_pcmcia_init(struct mantis_ca *ca);
  54. extern void mantis_pcmcia_exit(struct mantis_ca *ca);
  55. extern int mantis_evmgr_init(struct mantis_ca *ca);
  56. extern void mantis_evmgr_exit(struct mantis_ca *ca);
  57. /* HIF */
  58. extern int mantis_hif_init(struct mantis_ca *ca);
  59. extern void mantis_hif_exit(struct mantis_ca *ca);
  60. extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr);
  61. extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data);
  62. extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr);
  63. extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u8 data);
  64. #endif /* __MANTIS_LINK_H */