diagfwd_hsic.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef DIAGFWD_HSIC_H
  13. #define DIAGFWD_HSIC_H
  14. #include <mach/diag_bridge.h>
  15. #define N_MDM_WRITE 8
  16. #define N_MDM_READ 1
  17. #define NUM_HSIC_BUF_TBL_ENTRIES N_MDM_WRITE
  18. #define MAX_HSIC_CH 4
  19. #define REOPEN_HSIC 1
  20. #define DONT_REOPEN_HSIC 0
  21. int diagfwd_write_complete_hsic(struct diag_request *, int index);
  22. int diagfwd_cancel_hsic(int reopen);
  23. void diag_read_usb_hsic_work_fn(struct work_struct *work);
  24. void diag_usb_read_complete_hsic_fn(struct work_struct *w);
  25. extern struct diag_bridge_ops hsic_diag_bridge_ops[MAX_HSIC_CH];
  26. extern struct platform_driver msm_hsic_ch_driver;
  27. void diag_hsic_close(int);
  28. /* Diag-HSIC structure, n HSIC bridges can be used at same time
  29. * for instance HSIC(0), HS-USB(1) working at same time
  30. */
  31. struct diag_hsic_dev {
  32. int id;
  33. int hsic_ch;
  34. int hsic_inited;
  35. int hsic_device_enabled;
  36. int hsic_device_opened;
  37. int hsic_suspend;
  38. int hsic_data_requested;
  39. int in_busy_hsic_read_on_device;
  40. int in_busy_hsic_write;
  41. struct work_struct diag_read_hsic_work;
  42. int count_hsic_pool;
  43. int count_hsic_write_pool;
  44. unsigned int poolsize_hsic;
  45. unsigned int poolsize_hsic_write;
  46. unsigned int itemsize_hsic;
  47. unsigned int itemsize_hsic_write;
  48. mempool_t *diag_hsic_pool;
  49. mempool_t *diag_hsic_write_pool;
  50. int num_hsic_buf_tbl_entries;
  51. struct diag_write_device *hsic_buf_tbl;
  52. spinlock_t hsic_spinlock;
  53. };
  54. #endif