modem_ccif.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef __MODEM_CCIF_H__
  2. #define __MODEM_CCIF_H__
  3. #include <linux/wakelock.h>
  4. #include <linux/dmapool.h>
  5. #include <linux/atomic.h>
  6. #include <mt-plat/mt_ccci_common.h>
  7. #include "ccci_config.h"
  8. #include "ccci_ringbuf.h"
  9. #include "ccci_core.h"
  10. #define QUEUE_NUM 8
  11. struct ccif_sram_layout {
  12. struct ccci_header dl_header;
  13. struct md_query_ap_feature md_rt_data;
  14. struct ccci_header up_header;
  15. struct ap_query_md_feature ap_rt_data;
  16. };
  17. struct md_ccif_queue {
  18. DIRECTION dir;
  19. unsigned char index;
  20. atomic_t rx_on_going;
  21. unsigned char debug_id;
  22. int budget;
  23. unsigned int ccif_ch;
  24. struct ccci_modem *modem;
  25. struct ccci_port *napi_port;
  26. struct ccci_ringbuf *ringbuf;
  27. spinlock_t rx_lock; /* lock for the counter, only for rx */
  28. spinlock_t tx_lock; /* lock for the counter, only for Tx */
  29. wait_queue_head_t req_wq; /* only for Tx */
  30. struct work_struct qwork;
  31. struct workqueue_struct *worker;
  32. };
  33. struct md_ccif_ctrl {
  34. struct md_ccif_queue txq[QUEUE_NUM];
  35. struct md_ccif_queue rxq[QUEUE_NUM];
  36. unsigned int total_smem_size;
  37. atomic_t reset_on_going;
  38. volatile unsigned long channel_id; /* CCIF channel */
  39. unsigned int ccif_irq_id;
  40. unsigned int md_wdt_irq_id;
  41. unsigned int sram_size;
  42. struct ccif_sram_layout *ccif_sram_layout;
  43. struct wake_lock trm_wake_lock;
  44. char wakelock_name[32];
  45. struct work_struct ccif_sram_work;
  46. struct tasklet_struct ccif_irq_task;
  47. struct timer_list bus_timeout_timer;
  48. void __iomem *ccif_ap_base;
  49. void __iomem *ccif_md_base;
  50. void __iomem *md_rgu_base;
  51. void __iomem *md_boot_slave_Vector;
  52. void __iomem *md_boot_slave_Key;
  53. void __iomem *md_boot_slave_En;
  54. struct md_hw_info *hw_info;
  55. };
  56. /* always keep this in mind: what if there are more than 1 modems using CLDMA... */
  57. extern void mt_irq_set_sens(unsigned int irq, unsigned int sens);
  58. extern void mt_irq_set_polarity(unsigned int irq, unsigned int polarity);
  59. /* used for throttling feature - start */
  60. extern unsigned long ccci_modem_boot_count[];
  61. /* used for throttling feature - end */
  62. #endif /* __MODEM_CCIF_H__ */