wmi_unified_p2p_api.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. #ifdef FEATURE_P2P_LISTEN_OFFLOAD
  55. QDF_STATUS wmi_unified_p2p_lo_start_cmd(void *wmi_hdl,
  56. struct p2p_lo_start *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->send_p2p_lo_start_cmd)
  64. return wmi_handle->ops->send_p2p_lo_start_cmd(wmi_handle,
  65. param);
  66. return QDF_STATUS_E_FAILURE;
  67. }
  68. QDF_STATUS wmi_unified_p2p_lo_stop_cmd(void *wmi_hdl, uint8_t vdev_id)
  69. {
  70. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  71. if (!wmi_handle) {
  72. WMI_LOGE("wmi handle is null");
  73. return QDF_STATUS_E_INVAL;
  74. }
  75. if (wmi_handle->ops->send_p2p_lo_stop_cmd)
  76. return wmi_handle->ops->send_p2p_lo_stop_cmd(wmi_handle,
  77. vdev_id);
  78. return QDF_STATUS_E_FAILURE;
  79. }
  80. QDF_STATUS wmi_extract_p2p_lo_stop_ev_param(void *wmi_hdl, void *evt_buf,
  81. struct p2p_lo_event *param)
  82. {
  83. wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
  84. if (!wmi_handle) {
  85. WMI_LOGE("wmi handle is null");
  86. return QDF_STATUS_E_INVAL;
  87. }
  88. if (wmi_handle->ops->extract_p2p_lo_stop_ev_param)
  89. return wmi_handle->ops->extract_p2p_lo_stop_ev_param(
  90. wmi_handle, evt_buf, param);
  91. return QDF_STATUS_E_FAILURE;
  92. }
  93. #endif /* End of FEATURE_P2P_LISTEN_OFFLOAD*/