wmi_unified_ocb_api.c 4.4 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 DSRC component.
  20. */
  21. #include <wmi_unified_priv.h>
  22. #include <wlan_ocb_public_structs.h>
  23. #include <wmi_unified_ocb_api.h>
  24. QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_hdl,
  25. struct ocb_timing_advert_param *timing_advert)
  26. {
  27. if (wmi_hdl->ops->send_ocb_start_timing_advert_cmd)
  28. return wmi_hdl->ops->send_ocb_start_timing_advert_cmd(wmi_hdl,
  29. timing_advert);
  30. return QDF_STATUS_E_FAILURE;
  31. }
  32. QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_hdl,
  33. struct ocb_timing_advert_param *timing_advert)
  34. {
  35. if (wmi_hdl->ops->send_ocb_stop_timing_advert_cmd)
  36. return wmi_hdl->ops->send_ocb_stop_timing_advert_cmd(wmi_hdl,
  37. timing_advert);
  38. return QDF_STATUS_E_FAILURE;
  39. }
  40. QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_hdl,
  41. struct ocb_utc_param *utc)
  42. {
  43. if (wmi_hdl->ops->send_ocb_set_utc_time_cmd)
  44. return wmi_hdl->ops->send_ocb_set_utc_time_cmd(wmi_hdl, utc);
  45. return QDF_STATUS_E_FAILURE;
  46. }
  47. QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_hdl,
  48. struct ocb_get_tsf_timer_param *req)
  49. {
  50. if (wmi_hdl->ops->send_ocb_get_tsf_timer_cmd)
  51. return wmi_hdl->ops->send_ocb_get_tsf_timer_cmd(wmi_hdl,
  52. req->vdev_id);
  53. return QDF_STATUS_E_FAILURE;
  54. }
  55. QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_hdl,
  56. struct ocb_dcc_get_stats_param *get_stats_param)
  57. {
  58. if (wmi_hdl->ops->send_dcc_get_stats_cmd)
  59. return wmi_hdl->ops->send_dcc_get_stats_cmd(wmi_hdl,
  60. get_stats_param);
  61. return QDF_STATUS_E_FAILURE;
  62. }
  63. QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_hdl,
  64. struct ocb_dcc_clear_stats_param *clear_stats_param)
  65. {
  66. if (wmi_hdl->ops->send_dcc_clear_stats_cmd)
  67. return wmi_hdl->ops->send_dcc_clear_stats_cmd(wmi_hdl,
  68. clear_stats_param->vdev_id,
  69. clear_stats_param->dcc_stats_bitmap);
  70. return QDF_STATUS_E_FAILURE;
  71. }
  72. QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_hdl,
  73. struct ocb_dcc_update_ndl_param *update_ndl_param)
  74. {
  75. if (wmi_hdl->ops->send_dcc_update_ndl_cmd)
  76. return wmi_hdl->ops->send_dcc_update_ndl_cmd(wmi_hdl,
  77. update_ndl_param);
  78. return QDF_STATUS_E_FAILURE;
  79. }
  80. QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_hdl,
  81. struct ocb_config *config)
  82. {
  83. if (wmi_hdl->ops->send_ocb_set_config_cmd)
  84. return wmi_hdl->ops->send_ocb_set_config_cmd(wmi_hdl,
  85. config);
  86. return QDF_STATUS_E_FAILURE;
  87. }
  88. QDF_STATUS
  89. wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_hdl,
  90. void *evt_buf,
  91. uint32_t *status)
  92. {
  93. if (wmi_hdl->ops->extract_ocb_chan_config_resp)
  94. return wmi_hdl->ops->extract_ocb_chan_config_resp(wmi_hdl,
  95. evt_buf,
  96. status);
  97. return QDF_STATUS_E_FAILURE;
  98. }
  99. QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_hdl,
  100. void *evt_buf,
  101. struct ocb_get_tsf_timer_response *resp)
  102. {
  103. if (wmi_hdl->ops->extract_ocb_tsf_timer)
  104. return wmi_hdl->ops->extract_ocb_tsf_timer(wmi_hdl,
  105. evt_buf,
  106. resp);
  107. return QDF_STATUS_E_FAILURE;
  108. }
  109. QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_hdl,
  110. void *evt_buf, struct ocb_dcc_update_ndl_response *resp)
  111. {
  112. if (wmi_hdl->ops->extract_dcc_update_ndl_resp)
  113. return wmi_hdl->ops->extract_dcc_update_ndl_resp(wmi_hdl,
  114. evt_buf,
  115. resp);
  116. return QDF_STATUS_E_FAILURE;
  117. }
  118. QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_hdl,
  119. void *evt_buf,
  120. struct ocb_dcc_get_stats_response **resp)
  121. {
  122. if (wmi_hdl->ops->extract_dcc_stats)
  123. return wmi_hdl->ops->extract_dcc_stats(wmi_hdl,
  124. evt_buf,
  125. resp);
  126. return QDF_STATUS_E_FAILURE;
  127. }