wmi_unified_reg_api.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. *
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: Implement API's specific to Regulatory component.
  21. */
  22. #include <qdf_status.h>
  23. #include <qdf_module.h>
  24. #include <wmi_unified_api.h>
  25. #include <wmi_unified_priv.h>
  26. #include <wmi_unified_reg_api.h>
  27. QDF_STATUS wmi_extract_reg_chan_list_update_event(
  28. wmi_unified_t wmi_handle,
  29. uint8_t *evt_buf,
  30. struct cur_regulatory_info *reg_info,
  31. uint32_t len)
  32. {
  33. if (wmi_handle && wmi_handle->ops->extract_reg_chan_list_update_event)
  34. return wmi_handle->ops->extract_reg_chan_list_update_event
  35. (wmi_handle,
  36. evt_buf, reg_info, len);
  37. return QDF_STATUS_E_FAILURE;
  38. }
  39. qdf_export_symbol(wmi_extract_reg_chan_list_update_event);
  40. #ifdef CONFIG_BAND_6GHZ
  41. QDF_STATUS wmi_extract_reg_chan_list_ext_update_event(
  42. wmi_unified_t wmi_handle,
  43. uint8_t *evt_buf,
  44. struct cur_regulatory_info *reg_info,
  45. uint32_t len)
  46. {
  47. if (wmi_handle &&
  48. wmi_handle->ops->extract_reg_chan_list_ext_update_event)
  49. return wmi_handle->ops->extract_reg_chan_list_ext_update_event
  50. (wmi_handle, evt_buf, reg_info, len);
  51. return QDF_STATUS_E_FAILURE;
  52. }
  53. qdf_export_symbol(wmi_extract_reg_chan_list_ext_update_event);
  54. #ifdef CONFIG_AFC_SUPPORT
  55. QDF_STATUS wmi_extract_afc_event(wmi_unified_t wmi_handle,
  56. uint8_t *evt_buf,
  57. struct afc_regulatory_info *afc_info,
  58. uint32_t len)
  59. {
  60. if (wmi_handle &&
  61. wmi_handle->ops->extract_afc_event)
  62. return wmi_handle->ops->extract_afc_event(wmi_handle, evt_buf,
  63. afc_info, len);
  64. return QDF_STATUS_E_FAILURE;
  65. }
  66. qdf_export_symbol(wmi_extract_afc_event);
  67. #endif
  68. #endif
  69. /*
  70. * wmi_unified_send_start_11d_scan_cmd() - start 11d scan
  71. * @wmi_handle: wmi handle
  72. * @start_11d_scan: pointer to 11d scan start req.
  73. *
  74. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  75. */
  76. QDF_STATUS wmi_unified_send_start_11d_scan_cmd(wmi_unified_t wmi_handle,
  77. struct reg_start_11d_scan_req *start_11d_scan)
  78. {
  79. if (wmi_handle->ops->send_start_11d_scan_cmd)
  80. return wmi_handle->ops->send_start_11d_scan_cmd(wmi_handle,
  81. start_11d_scan);
  82. return QDF_STATUS_E_FAILURE;
  83. }
  84. qdf_export_symbol(wmi_unified_send_start_11d_scan_cmd);
  85. /*
  86. * wmi_unified_send_stop_11d_scan_cmd() - stop 11d scan
  87. * @wmi_handle: wmi handle
  88. * @stop_11d_scan: pointer to 11d scan stop req.
  89. *
  90. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  91. */
  92. QDF_STATUS wmi_unified_send_stop_11d_scan_cmd(wmi_unified_t wmi_handle,
  93. struct reg_stop_11d_scan_req *stop_11d_scan)
  94. {
  95. if (wmi_handle->ops->send_stop_11d_scan_cmd)
  96. return wmi_handle->ops->send_stop_11d_scan_cmd(wmi_handle,
  97. stop_11d_scan);
  98. return QDF_STATUS_E_FAILURE;
  99. }
  100. qdf_export_symbol(wmi_unified_send_stop_11d_scan_cmd);
  101. QDF_STATUS wmi_extract_reg_11d_new_cc_event(
  102. wmi_unified_t wmi_handle,
  103. uint8_t *evt_buf,
  104. struct reg_11d_new_country *reg_11d_new_cc,
  105. uint32_t len)
  106. {
  107. if (wmi_handle && wmi_handle->ops->extract_reg_11d_new_country_event)
  108. return wmi_handle->ops->extract_reg_11d_new_country_event(
  109. wmi_handle, evt_buf, reg_11d_new_cc, len);
  110. return QDF_STATUS_E_FAILURE;
  111. }
  112. qdf_export_symbol(wmi_extract_reg_11d_new_cc_event);
  113. QDF_STATUS wmi_unified_set_user_country_code_cmd_send(
  114. wmi_unified_t wmi_handle,
  115. uint8_t pdev_id, struct cc_regdmn_s *rd)
  116. {
  117. if (wmi_handle->ops->send_user_country_code_cmd)
  118. return wmi_handle->ops->send_user_country_code_cmd(
  119. wmi_handle, pdev_id, rd);
  120. return QDF_STATUS_E_FAILURE;
  121. }
  122. qdf_export_symbol(wmi_unified_set_user_country_code_cmd_send);
  123. QDF_STATUS wmi_extract_reg_ch_avoid_event(
  124. wmi_unified_t wmi_handle,
  125. uint8_t *evt_buf,
  126. struct ch_avoid_ind_type *ch_avoid_ind,
  127. uint32_t len)
  128. {
  129. if (wmi_handle && wmi_handle->ops->extract_reg_ch_avoid_event)
  130. return wmi_handle->ops->extract_reg_ch_avoid_event(
  131. wmi_handle, evt_buf, ch_avoid_ind, len);
  132. return QDF_STATUS_E_FAILURE;
  133. }
  134. qdf_export_symbol(wmi_extract_reg_ch_avoid_event);