wmi_unified_coap_api.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: Implement API's specific to CoAP component.
  18. */
  19. #ifndef _WMI_UNIFIED_COAP_API_H_
  20. #define _WMI_UNIFIED_COAP_API_H_
  21. #include <wmi_unified_priv.h>
  22. #ifdef WLAN_FEATURE_COAP
  23. /**
  24. * wmi_unified_coap_add_pattern_cmd() - Add pattern for CoAP offload reply
  25. * @wmi_handle: wmi handle
  26. * @param: parameters for CoAP offload reply
  27. *
  28. * Return: status of operation
  29. */
  30. static inline QDF_STATUS
  31. wmi_unified_coap_add_pattern_cmd(wmi_unified_t wmi_handle,
  32. struct coap_offload_reply_param *param)
  33. {
  34. if (wmi_handle->ops->send_coap_add_pattern_cmd)
  35. return wmi_handle->ops->send_coap_add_pattern_cmd(wmi_handle,
  36. param);
  37. return QDF_STATUS_E_NOSUPPORT;
  38. }
  39. /**
  40. * wmi_unified_coap_del_pattern_cmd() - Delete pattern for CoAP offload reply
  41. * @wmi_handle: wmi handle
  42. * @vdev_id: vdev id
  43. * @pattern_id: pattern id
  44. *
  45. * Return: status of operation
  46. */
  47. static inline QDF_STATUS
  48. wmi_unified_coap_del_pattern_cmd(wmi_unified_t wmi_handle,
  49. uint8_t vdev_id, uint32_t pattern_id)
  50. {
  51. if (wmi_handle->ops->send_coap_del_pattern_cmd)
  52. return wmi_handle->ops->send_coap_del_pattern_cmd(wmi_handle,
  53. vdev_id, pattern_id);
  54. return QDF_STATUS_E_NOSUPPORT;
  55. }
  56. /**
  57. * wmi_unified_coap_add_keepalive_pattern_cmd() - Add pattern for CoAP offload
  58. * periodic transmitting
  59. * @wmi_handle: wmi handle
  60. * @param: parameters for CoAP offload periodic transmitting
  61. *
  62. * Return: status of operation
  63. */
  64. static inline QDF_STATUS
  65. wmi_unified_coap_add_keepalive_pattern_cmd(wmi_unified_t wmi_handle,
  66. struct coap_offload_periodic_tx_param *param)
  67. {
  68. if (wmi_handle->ops->send_coap_add_keepalive_pattern_cmd)
  69. return wmi_handle->ops->send_coap_add_keepalive_pattern_cmd(
  70. wmi_handle, param);
  71. return QDF_STATUS_E_NOSUPPORT;
  72. }
  73. /**
  74. * wmi_unified_coap_del_keepalive_pattern_cmd() - Delete pattern for CoAP
  75. * offload periodic transmitting
  76. * @wmi_handle: wmi handle
  77. * @vdev_id: vdev id
  78. * @pattern_id: pattern id
  79. *
  80. * Return: status of operation
  81. */
  82. static inline QDF_STATUS
  83. wmi_unified_coap_del_keepalive_pattern_cmd(wmi_unified_t wmi_handle,
  84. uint8_t vdev_id,
  85. uint32_t pattern_id)
  86. {
  87. if (wmi_handle->ops->send_coap_del_keepalive_pattern_cmd)
  88. return wmi_handle->ops->send_coap_del_keepalive_pattern_cmd(
  89. wmi_handle, vdev_id, pattern_id);
  90. return QDF_STATUS_E_NOSUPPORT;
  91. }
  92. /**
  93. * wmi_unified_coap_cache_get() - Get cached CoAP messages
  94. * @wmi_handle: wmi handle
  95. * @vdev_id: vdev id
  96. * @pattern_id: pattern id
  97. *
  98. * Return: status of operation
  99. */
  100. static inline QDF_STATUS
  101. wmi_unified_coap_cache_get(wmi_unified_t wmi_handle,
  102. uint8_t vdev_id, uint32_t pattern_id)
  103. {
  104. if (wmi_handle->ops->send_coap_cache_get_cmd)
  105. return wmi_handle->ops->send_coap_cache_get_cmd(wmi_handle,
  106. vdev_id, pattern_id);
  107. return QDF_STATUS_E_NOSUPPORT;
  108. }
  109. /**
  110. * wmi_unified_coap_extract_buf_info() - extract CoAP buf info from event
  111. * @wmi_handle: wmi handle
  112. * @evt_buf: pointer to event buffer
  113. * @info: Pointer to hold CoAP buf info
  114. *
  115. * The caller needs to free any possible nodes in info->info_list
  116. * regardless of failure or success.
  117. *
  118. * Return: status of operation
  119. */
  120. static inline QDF_STATUS
  121. wmi_unified_coap_extract_buf_info(wmi_unified_t wmi_handle, void *evt_buf,
  122. struct coap_buf_info *info)
  123. {
  124. if (wmi_handle->ops->extract_coap_buf_info) {
  125. return wmi_handle->ops->extract_coap_buf_info(wmi_handle,
  126. evt_buf,
  127. info);
  128. }
  129. return QDF_STATUS_E_NOSUPPORT;
  130. }
  131. #endif
  132. #endif /* _WMI_UNIFIED_ROAM_API_H_ */