target_if_cfr.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * Copyright (c) 2019 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. #ifndef _TARGET_IF_CFR_H_
  19. #define _TARGET_IF_CFR_H_
  20. #include <wlan_objmgr_cmn.h>
  21. #include <wlan_objmgr_psoc_obj.h>
  22. #include <wlan_objmgr_pdev_obj.h>
  23. #include <wlan_objmgr_vdev_obj.h>
  24. #include <wlan_objmgr_peer_obj.h>
  25. #define PEER_CFR_CAPTURE_ENABLE 1
  26. #define PEER_CFR_CAPTURE_DISABLE 0
  27. /**
  28. * target_if_cfr_init_pdev() - Inits cfr pdev and registers necessary handlers.
  29. * @psoc: pointer to psoc object
  30. * @pdev: pointer to pdev object
  31. *
  32. * Return: Registration status for necessary handlers
  33. */
  34. int target_if_cfr_init_pdev(struct wlan_objmgr_psoc *psoc,
  35. struct wlan_objmgr_pdev *pdev);
  36. /**
  37. * target_if_cfr_deinit_pdev() - De-inits corresponding pdev and handlers.
  38. * @psoc: pointer to psoc object
  39. * @pdev: pointer to pdev object
  40. *
  41. * Return: De-registration status for necessary handlers
  42. */
  43. int target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc,
  44. struct wlan_objmgr_pdev *pdev);
  45. /**
  46. * target_if_cfr_tx_ops_register() - Registers tx ops for cfr module
  47. * @tx_ops - pointer to tx_ops structure.
  48. */
  49. void target_if_cfr_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops);
  50. /**
  51. * target_if_cfr_enable_cfr_timer() - Enables cfr timer
  52. * @pdev: pointer to pdev object
  53. * @cfr_timer: Amount of time this timer has to run
  54. *
  55. * Return: status of timer
  56. */
  57. int target_if_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev,
  58. uint32_t cfr_timer);
  59. /**
  60. * target_if_cfr_pdev_set_param() - Function to set params for cfr config
  61. * @pdev: pointer to pdev object
  62. * @param_id: param id which has to be set
  63. * @param_value: value of param being set
  64. *
  65. * Return: success/failure of setting param
  66. */
  67. int target_if_cfr_pdev_set_param(struct wlan_objmgr_pdev *pdev,
  68. uint32_t param_id, uint32_t param_value);
  69. /**
  70. * target_if_cfr_start_capture() - Function to start cfr capture for a peer
  71. * @pdev: pointer to pdev object
  72. * @peer: pointer to peer object
  73. * @cfr_params: capture parameters for this peer
  74. *
  75. * Return: success/failure status of start capture
  76. */
  77. int target_if_cfr_start_capture(struct wlan_objmgr_pdev *pdev,
  78. struct wlan_objmgr_peer *peer,
  79. struct cfr_capture_params *cfr_params);
  80. /**
  81. * target_if_cfr_stop_capture() - Function to stop cfr capture for a peer
  82. * @pdev: pointer to pdev object
  83. * @peer: pointer to peer object
  84. *
  85. * Return: success/failure status of stop capture
  86. */
  87. int target_if_cfr_stop_capture(struct wlan_objmgr_pdev *pdev,
  88. struct wlan_objmgr_peer *peer);
  89. /**
  90. * target_if_cfr_get_target_type() - Function to get target type
  91. * @psoc: pointer to psoc object
  92. *
  93. * Return: target type of target
  94. */
  95. int target_if_cfr_get_target_type(struct wlan_objmgr_psoc *psoc);
  96. /**
  97. * target_if_cfr_set_cfr_support() - Function to set cfr support
  98. * @psoc: pointer to psoc object
  99. * @value: value to be set
  100. */
  101. void target_if_cfr_set_cfr_support(struct wlan_objmgr_psoc *psoc,
  102. uint8_t value);
  103. /**
  104. * target_if_cfr_info_send() - Function to send cfr info to upper layers
  105. * @pdev: pointer to pdev object
  106. * @head: pointer to cfr info head
  107. * @hlen: head len
  108. * @data: pointer to cfr info data
  109. * @dlen: data len
  110. * @tail: pointer to cfr info tail
  111. * @tlen: tail len
  112. */
  113. void target_if_cfr_info_send(struct wlan_objmgr_pdev *pdev, void *head,
  114. size_t hlen, void *data, size_t dlen, void *tail,
  115. size_t tlen);
  116. /**
  117. * cfr_wifi2_0_init_pdev() - Function to init legacy pdev
  118. * @psoc: pointer to psoc object
  119. * @pdev: pointer to pdev object
  120. *
  121. * Return: success/failure status of init
  122. */
  123. QDF_STATUS cfr_wifi2_0_init_pdev(struct wlan_objmgr_psoc *psoc,
  124. struct wlan_objmgr_pdev *pdev);
  125. /**
  126. * cfr_wifi2_0_deinit_pdev() - Function to deinit legacy pdev
  127. * @psoc: pointer to psoc object
  128. * @pdev: pointer to pdev object
  129. *
  130. * Return: success/failure status of deinit
  131. */
  132. QDF_STATUS cfr_wifi2_0_deinit_pdev(struct wlan_objmgr_psoc *psoc,
  133. struct wlan_objmgr_pdev *pdev);
  134. #endif