wmi_unified_p2p_api.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * Copyright (c) 2013-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: Implement API's specific to P2P component.
  20. */
  21. #include <wmi_unified_priv.h>
  22. #include <wmi_unified_p2p_api.h>
  23. QDF_STATUS wmi_unified_set_p2pgo_oppps_req(void *wmi_hdl,
  24. struct p2p_ps_params *oppps)
  25. {
  26. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  27. if (wmi_handle->ops->send_set_p2pgo_oppps_req_cmd)
  28. return wmi_handle->ops->send_set_p2pgo_oppps_req_cmd(wmi_handle,
  29. oppps);
  30. return QDF_STATUS_E_FAILURE;
  31. }
  32. QDF_STATUS wmi_unified_set_p2pgo_noa_req_cmd(void *wmi_hdl,
  33. struct p2p_ps_params *noa)
  34. {
  35. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  36. if (wmi_handle->ops->send_set_p2pgo_noa_req_cmd)
  37. return wmi_handle->ops->send_set_p2pgo_noa_req_cmd(wmi_handle,
  38. noa);
  39. return QDF_STATUS_E_FAILURE;
  40. }
  41. QDF_STATUS wmi_extract_p2p_noa_ev_param(void *wmi_hdl, void *evt_buf,
  42. struct p2p_noa_info *param)
  43. {
  44. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  45. if (!wmi_handle) {
  46. WMI_LOGE("wmi handle is null");
  47. return QDF_STATUS_E_INVAL;
  48. }
  49. if (wmi_handle->ops->extract_p2p_noa_ev_param)
  50. return wmi_handle->ops->extract_p2p_noa_ev_param(
  51. wmi_handle, evt_buf, param);
  52. return QDF_STATUS_E_FAILURE;
  53. }
  54. QDF_STATUS
  55. wmi_send_set_mac_addr_rx_filter_cmd(void *wmi_hdl,
  56. struct p2p_set_mac_filter *param)
  57. {
  58. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  59. if (!wmi_handle) {
  60. WMI_LOGE("wmi handle is null");
  61. return QDF_STATUS_E_INVAL;
  62. }
  63. if (wmi_handle->ops->set_mac_addr_rx_filter)
  64. return wmi_handle->ops->set_mac_addr_rx_filter(
  65. wmi_handle, param);
  66. return QDF_STATUS_E_FAILURE;
  67. }
  68. QDF_STATUS
  69. wmi_extract_mac_addr_rx_filter_evt_param(void *wmi_hdl, void *evt_buf,
  70. struct p2p_set_mac_filter_evt *param)
  71. {
  72. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  73. if (!wmi_handle) {
  74. WMI_LOGE("wmi handle is null");
  75. return QDF_STATUS_E_INVAL;
  76. }
  77. if (wmi_handle->ops->extract_mac_addr_rx_filter_evt_param)
  78. return wmi_handle->ops->extract_mac_addr_rx_filter_evt_param(
  79. wmi_handle, evt_buf, param);
  80. return QDF_STATUS_E_FAILURE;
  81. }
  82. #ifdef FEATURE_P2P_LISTEN_OFFLOAD
  83. QDF_STATUS wmi_unified_p2p_lo_start_cmd(void *wmi_hdl,
  84. struct p2p_lo_start *param)
  85. {
  86. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  87. if (!wmi_handle) {
  88. WMI_LOGE("wmi handle is null");
  89. return QDF_STATUS_E_INVAL;
  90. }
  91. if (wmi_handle->ops->send_p2p_lo_start_cmd)
  92. return wmi_handle->ops->send_p2p_lo_start_cmd(wmi_handle,
  93. param);
  94. return QDF_STATUS_E_FAILURE;
  95. }
  96. QDF_STATUS wmi_unified_p2p_lo_stop_cmd(void *wmi_hdl, uint8_t vdev_id)
  97. {
  98. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  99. if (!wmi_handle) {
  100. WMI_LOGE("wmi handle is null");
  101. return QDF_STATUS_E_INVAL;
  102. }
  103. if (wmi_handle->ops->send_p2p_lo_stop_cmd)
  104. return wmi_handle->ops->send_p2p_lo_stop_cmd(wmi_handle,
  105. vdev_id);
  106. return QDF_STATUS_E_FAILURE;
  107. }
  108. QDF_STATUS wmi_extract_p2p_lo_stop_ev_param(void *wmi_hdl, void *evt_buf,
  109. struct p2p_lo_event *param)
  110. {
  111. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  112. if (!wmi_handle) {
  113. WMI_LOGE("wmi handle is null");
  114. return QDF_STATUS_E_INVAL;
  115. }
  116. if (wmi_handle->ops->extract_p2p_lo_stop_ev_param)
  117. return wmi_handle->ops->extract_p2p_lo_stop_ev_param(
  118. wmi_handle, evt_buf, param);
  119. return QDF_STATUS_E_FAILURE;
  120. }
  121. #endif /* End of FEATURE_P2P_LISTEN_OFFLOAD*/