target_if_cfr.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. #include "wmi_unified_cfr_api.h"
  26. #include "wmi_unified_param.h"
  27. #include "wmi_unified_cfr_param.h"
  28. #define PEER_CFR_CAPTURE_ENABLE 1
  29. #define PEER_CFR_CAPTURE_DISABLE 0
  30. #define PEER_CFR_CAPTURE_EVT_STATUS_MASK 0x80000000
  31. #define PEER_CFR_CAPTURE_EVT_PS_STATUS_MASK 0x40000000
  32. #define CFR_TX_EVT_STATUS_MASK 0x00000003
  33. /* Status codes used by correlate and relay function */
  34. #define STATUS_STREAM_AND_RELEASE 0
  35. #define STATUS_HOLD 1
  36. #define STATUS_ERROR -1
  37. /* Module IDs using corrlation function */
  38. #define CORRELATE_DBR_MODULE_ID 0
  39. #define CORRELATE_TX_EV_MODULE_ID 1 /* HKV2 */
  40. #define CORRELATE_TXRX_EV_MODULE_ID 1 /* Cypress */
  41. /**
  42. * target_if_cfr_init_pdev() - Inits cfr pdev and registers necessary handlers.
  43. * @psoc: pointer to psoc object
  44. * @pdev: pointer to pdev object
  45. *
  46. * Return: Registration status for necessary handlers
  47. */
  48. int target_if_cfr_init_pdev(struct wlan_objmgr_psoc *psoc,
  49. struct wlan_objmgr_pdev *pdev);
  50. /**
  51. * target_if_cfr_deinit_pdev() - De-inits corresponding pdev and handlers.
  52. * @psoc: pointer to psoc object
  53. * @pdev: pointer to pdev object
  54. *
  55. * Return: De-registration status for necessary handlers
  56. */
  57. int target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc,
  58. struct wlan_objmgr_pdev *pdev);
  59. /**
  60. * target_if_cfr_tx_ops_register() - Registers tx ops for cfr module
  61. * @tx_ops - pointer to tx_ops structure.
  62. */
  63. void target_if_cfr_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops);
  64. /**
  65. * target_if_cfr_enable_cfr_timer() - Enables cfr timer
  66. * @pdev: pointer to pdev object
  67. * @cfr_timer: Amount of time this timer has to run
  68. *
  69. * Return: status of timer
  70. */
  71. int target_if_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev,
  72. uint32_t cfr_timer);
  73. /**
  74. * target_if_cfr_pdev_set_param() - Function to set params for cfr config
  75. * @pdev: pointer to pdev object
  76. * @param_id: param id which has to be set
  77. * @param_value: value of param being set
  78. *
  79. * Return: success/failure of setting param
  80. */
  81. int target_if_cfr_pdev_set_param(struct wlan_objmgr_pdev *pdev,
  82. uint32_t param_id, uint32_t param_value);
  83. /**
  84. * target_if_cfr_start_capture() - Function to start cfr capture for a peer
  85. * @pdev: pointer to pdev object
  86. * @peer: pointer to peer object
  87. * @cfr_params: capture parameters for this peer
  88. *
  89. * Return: success/failure status of start capture
  90. */
  91. int target_if_cfr_start_capture(struct wlan_objmgr_pdev *pdev,
  92. struct wlan_objmgr_peer *peer,
  93. struct cfr_capture_params *cfr_params);
  94. /**
  95. * target_if_cfr_stop_capture() - Function to stop cfr capture for a peer
  96. * @pdev: pointer to pdev object
  97. * @peer: pointer to peer object
  98. *
  99. * Return: success/failure status of stop capture
  100. */
  101. int target_if_cfr_stop_capture(struct wlan_objmgr_pdev *pdev,
  102. struct wlan_objmgr_peer *peer);
  103. /**
  104. * target_if_cfr_get_target_type() - Function to get target type
  105. * @psoc: pointer to psoc object
  106. *
  107. * Return: target type of target
  108. */
  109. int target_if_cfr_get_target_type(struct wlan_objmgr_psoc *psoc);
  110. /**
  111. * target_if_cfr_set_cfr_support() - Function to set cfr support
  112. * @psoc: pointer to psoc object
  113. * @value: value to be set
  114. */
  115. void target_if_cfr_set_cfr_support(struct wlan_objmgr_psoc *psoc,
  116. uint8_t value);
  117. /**
  118. * target_if_cfr_info_send() - Function to send cfr info to upper layers
  119. * @pdev: pointer to pdev object
  120. * @head: pointer to cfr info head
  121. * @hlen: head len
  122. * @data: pointer to cfr info data
  123. * @dlen: data len
  124. * @tail: pointer to cfr info tail
  125. * @tlen: tail len
  126. */
  127. void target_if_cfr_info_send(struct wlan_objmgr_pdev *pdev, void *head,
  128. size_t hlen, void *data, size_t dlen, void *tail,
  129. size_t tlen);
  130. /**
  131. * cfr_wifi2_0_init_pdev() - Function to init legacy pdev
  132. * @psoc: pointer to psoc object
  133. * @pdev: pointer to pdev object
  134. *
  135. * Return: success/failure status of init
  136. */
  137. QDF_STATUS cfr_wifi2_0_init_pdev(struct wlan_objmgr_psoc *psoc,
  138. struct wlan_objmgr_pdev *pdev);
  139. /**
  140. * cfr_wifi2_0_deinit_pdev() - Function to deinit legacy pdev
  141. * @psoc: pointer to psoc object
  142. * @pdev: pointer to pdev object
  143. *
  144. * Return: success/failure status of deinit
  145. */
  146. QDF_STATUS cfr_wifi2_0_deinit_pdev(struct wlan_objmgr_psoc *psoc,
  147. struct wlan_objmgr_pdev *pdev);
  148. #endif