mantis_link.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. enum mantis_sbuf_status {
  20. MANTIS_SBUF_DATA_AVAIL = 1,
  21. MANTIS_SBUF_DATA_EMPTY = 2,
  22. MANTIS_SBUF_DATA_OVFLW = 3
  23. };
  24. struct mantis_slot {
  25. u32 timeout;
  26. u32 slave_cfg;
  27. u32 bar;
  28. };
  29. /* Physical layer */
  30. enum mantis_slot_state {
  31. MODULE_INSERTED = 3,
  32. MODULE_XTRACTED = 4
  33. };
  34. struct mantis_ca {
  35. struct mantis_slot slot[4];
  36. struct work_struct hif_evm_work;
  37. u32 hif_event;
  38. wait_queue_head_t hif_opdone_wq;
  39. wait_queue_head_t hif_brrdyw_wq;
  40. wait_queue_head_t hif_data_wq;
  41. u32 hif_job_queue;
  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. };
  47. /* CA */
  48. extern void mantis_event_cam_plugin(struct mantis_ca *ca);
  49. extern void mantis_event_cam_unplug(struct mantis_ca *ca);
  50. extern int mantis_pcmcia_init(struct mantis_ca *ca);
  51. extern void mantis_pcmcia_exit(struct mantis_ca *ca);
  52. extern int mantis_evmgr_init(struct mantis_ca *ca);
  53. extern void mantis_evmgr_exit(struct mantis_ca *ca);
  54. /* HIF */
  55. extern int mantis_hif_init(struct mantis_ca *ca);
  56. extern void mantis_hif_exit(struct mantis_ca *ca);
  57. extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr);
  58. extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data);
  59. extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr, u32 count, u32 *data);
  60. extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u32 data);
  61. #endif // __MANTIS_LINK_H