ccif.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef __CCIF_H__
  2. #define __CCIF_H__
  3. /* CCIF common macro definition */
  4. #define CCIF_INTR_MAX_RE_ENTER_CNT (5)
  5. struct ccif_statistics_t {
  6. unsigned long long irq_cnt;
  7. unsigned int re_enter_cnt;
  8. unsigned int max_re_enter_cnt;
  9. };
  10. enum ccif_state_bit_t {
  11. CCIF_TOP_HALF_RUNNING = 0x0,
  12. CCIF_BOTTOM_HALF_RUNNING,
  13. CCIF_CALL_BACK_FUNC_LOCKED,
  14. CCIF_ISR_INFO_CALL_BACK_LOCKED,
  15. };
  16. struct ccif_msg_t {
  17. unsigned int data[2];
  18. unsigned int channel;
  19. unsigned int reserved;
  20. };
  21. typedef int (*ccif_push_func_t) (struct ccif_msg_t *);
  22. typedef int (*ccif_notify_funct_t) (void);
  23. struct ccif_t {
  24. unsigned long m_reg_base;
  25. unsigned long m_md_reg_base;
  26. unsigned long m_status;
  27. unsigned int m_rx_idx;
  28. unsigned int m_tx_idx;
  29. unsigned int m_irq_id;
  30. unsigned int m_irq_attr;
  31. unsigned int m_ccif_type;
  32. struct ccif_statistics_t m_statistics;
  33. spinlock_t m_lock;
  34. void *m_logic_ctl_block;
  35. unsigned int m_irq_dis_cnt;
  36. unsigned int m_md_id;
  37. int (*push_msg)(struct ccif_msg_t *, void *);
  38. void (*notify_push_done)(void *);
  39. void (*isr_notify)(int);
  40. int (*register_call_back_func)(struct ccif_t *,
  41. int (*push_func)(struct ccif_msg_t *, void *),
  42. void (*notify_func)(void *));
  43. int (*register_isr_notify_func)(struct ccif_t *, void (*additional)(int));
  44. int (*ccif_init)(struct ccif_t *);
  45. int (*ccif_de_init)(struct ccif_t *);
  46. int (*ccif_register_intr)(struct ccif_t *);
  47. int (*ccif_en_intr)(struct ccif_t *);
  48. void (*ccif_dis_intr)(struct ccif_t *);
  49. int (*ccif_dump_reg)(struct ccif_t *, unsigned int buf[], int len);
  50. int (*ccif_read_phy_ch_data)(struct ccif_t *, int ch,
  51. unsigned int buf[]);
  52. int (*ccif_write_phy_ch_data)(struct ccif_t *, unsigned int buf[],
  53. int retry_en);
  54. int (*ccif_get_rx_ch)(struct ccif_t *);
  55. int (*ccif_get_busy_state)(struct ccif_t *);
  56. void (*ccif_set_busy_state)(struct ccif_t *, unsigned int val);
  57. int (*ccif_ack_phy_ch)(struct ccif_t *, int ch);
  58. int (*ccif_clear_sram)(struct ccif_t *);
  59. int (*ccif_write_runtime_data)(struct ccif_t *, unsigned int buf[], int len);
  60. int (*ccif_intr_handler)(struct ccif_t *);
  61. int (*ccif_reset)(struct ccif_t *);
  62. };
  63. #endif /* __CCIF_H__ */