wlan_ipa_ucfg_api.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright (c) 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Declare public API related to the wlan ipa called by north bound
  20. */
  21. #ifndef _WLAN_IPA_UCFG_API_H_
  22. #define _WLAN_IPA_UCFG_API_H_
  23. #include "wlan_ipa_public_struct.h"
  24. #include "wlan_ipa_obj_mgmt_api.h"
  25. #include "wlan_objmgr_pdev_obj.h"
  26. #ifdef IPA_OFFLOAD
  27. /**
  28. * ucfg_ipa_is_present() - get IPA hw status
  29. *
  30. * ipa_uc_reg_rdyCB is not directly designed to check
  31. * ipa hw status. This is an undocumented function which
  32. * has confirmed with IPA team.
  33. *
  34. * Return: true - ipa hw present
  35. * false - ipa hw not present
  36. */
  37. bool ucfg_ipa_is_present(void);
  38. /**
  39. * ucfg_ipa_update_config() - Update IPA component config
  40. *
  41. * Return: None
  42. */
  43. void ucfg_ipa_update_config(struct wlan_ipa_config *config);
  44. /**
  45. * ucfg_ipa_set_dp_handle() - register DP handle
  46. * @psoc: psoc handle
  47. * @dp_soc: data path soc handle
  48. *
  49. * Return: None
  50. */
  51. void ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc *psoc,
  52. void *dp_soc);
  53. /**
  54. * ucfg_ipa_set_txrx_handle() - register pdev txrx handler
  55. * @psoc: psoc handle
  56. * @txrx_handle: data path pdev txrx handle
  57. *
  58. * Return: None
  59. */
  60. void ucfg_ipa_set_txrx_handle(struct wlan_objmgr_psoc *psoc,
  61. void *txrx_handle);
  62. /**
  63. * ucfg_ipa_set_perf_level() - Set IPA perf level
  64. * @pdev: Pdev obj handle
  65. * @tx_packets: Number of packets transmitted in the last sample period
  66. * @rx_packets: Number of packets received in the last sample period
  67. *
  68. * Return: QDF_STATUS_SUCCESS on success
  69. */
  70. QDF_STATUS ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev *pdev,
  71. uint64_t tx_packets, uint64_t rx_packets);
  72. #else
  73. static inline bool ucfg_ipa_is_present(void)
  74. {
  75. return false;
  76. }
  77. static inline void ucfg_ipa_update_config(struct wlan_ipa_config *config)
  78. {
  79. }
  80. static inline
  81. QDF_STATUS ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc *psoc,
  82. void *dp_soc)
  83. {
  84. return QDF_STATUS_SUCCESS;
  85. }
  86. static inline
  87. QDF_STATUS ucfg_ipa_set_txrx_handle(struct wlan_objmgr_psoc *psoc,
  88. void *txrx_handle)
  89. {
  90. return QDF_STATUS_SUCCESS;
  91. }
  92. static inline
  93. QDF_STATUS ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev *pdev,
  94. uint64_t tx_packets, uint64_t rx_packets)
  95. {
  96. return QDF_STATUS_SUCCESS;
  97. }
  98. #endif /* IPA_OFFLOAD */
  99. #endif /* _WLAN_IPA_UCFG_API_H_ */