ipa_odl.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _IPA3_ODL_H_
  6. #define _IPA3_ODL_H_
  7. #define IPA_ODL_AGGR_BYTE_LIMIT (15 * 1024)
  8. #define IPA_ODL_RX_RING_SIZE 192
  9. #define MAX_QUEUE_TO_ODL 1024
  10. #define CONFIG_SUCCESS 1
  11. #define ODL_EP_TYPE_HSUSB 2
  12. #define ODL_EP_PERIPHERAL_IFACE_ID 3
  13. struct ipa3_odlstats {
  14. u32 odl_rx_pkt;
  15. u32 odl_tx_diag_pkt;
  16. u32 odl_drop_pkt;
  17. atomic_t numer_in_queue;
  18. };
  19. struct odl_state_bit_mask {
  20. u32 odl_init:1;
  21. u32 odl_open:1;
  22. u32 adpl_open:1;
  23. u32 aggr_byte_limit_sent:1;
  24. u32 odl_ep_setup:1;
  25. u32 odl_setup_done_sent:1;
  26. u32 odl_ep_info_sent:1;
  27. u32 odl_connected:1;
  28. u32 odl_disconnected:1;
  29. u32:0;
  30. };
  31. /**
  32. * struct ipa3_odl_char_device_context - IPA ODL character device
  33. * @class: pointer to the struct class
  34. * @dev_num: device number
  35. * @dev: the dev_t of the device
  36. * @cdev: cdev of the device
  37. */
  38. struct ipa3_odl_char_device_context {
  39. struct class *class;
  40. dev_t dev_num;
  41. struct device *dev;
  42. struct cdev cdev;
  43. };
  44. struct ipa_odl_context {
  45. struct ipa3_odl_char_device_context odl_cdev[2];
  46. struct list_head adpl_msg_list;
  47. struct mutex adpl_msg_lock;
  48. struct ipa_sys_connect_params odl_sys_param;
  49. u32 odl_client_hdl;
  50. struct odl_state_bit_mask odl_state;
  51. bool odl_ctl_msg_wq_flag;
  52. struct ipa3_odlstats stats;
  53. };
  54. struct ipa3_push_msg_odl {
  55. void *buff;
  56. int len;
  57. struct list_head link;
  58. };
  59. extern struct ipa_odl_context *ipa3_odl_ctx;
  60. int ipa_odl_init(void);
  61. void ipa3_odl_pipe_cleanup(bool is_ssr);
  62. int ipa3_odl_pipe_open(void);
  63. #endif /* _IPA3_ODL_H_ */