wmi_unified_reg_api.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (c) 2017-2018 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(void *wmi_hdl,
  28. uint8_t *evt_buf,
  29. struct cur_regulatory_info
  30. *reg_info,
  31. uint32_t len)
  32. {
  33. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  34. if (wmi_handle->ops->extract_reg_chan_list_update_event)
  35. return wmi_handle->ops->extract_reg_chan_list_update_event
  36. (wmi_handle,
  37. evt_buf, reg_info, len);
  38. return QDF_STATUS_E_FAILURE;
  39. }
  40. qdf_export_symbol(wmi_extract_reg_chan_list_update_event);
  41. /*
  42. * wmi_unified_send_start_11d_scan_cmd() - start 11d scan
  43. * @wmi_handle: wmi handle
  44. * @start_11d_scan: pointer to 11d scan start req.
  45. *
  46. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  47. */
  48. QDF_STATUS wmi_unified_send_start_11d_scan_cmd(wmi_unified_t wmi_handle,
  49. struct reg_start_11d_scan_req *start_11d_scan)
  50. {
  51. if (wmi_handle->ops->send_start_11d_scan_cmd)
  52. return wmi_handle->ops->send_start_11d_scan_cmd(wmi_handle,
  53. start_11d_scan);
  54. return QDF_STATUS_E_FAILURE;
  55. }
  56. qdf_export_symbol(wmi_unified_send_start_11d_scan_cmd);
  57. /*
  58. * wmi_unified_send_stop_11d_scan_cmd() - stop 11d scan
  59. * @wmi_handle: wmi handle
  60. * @stop_11d_scan: pointer to 11d scan stop req.
  61. *
  62. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  63. */
  64. QDF_STATUS wmi_unified_send_stop_11d_scan_cmd(wmi_unified_t wmi_handle,
  65. struct reg_stop_11d_scan_req *stop_11d_scan)
  66. {
  67. if (wmi_handle->ops->send_stop_11d_scan_cmd)
  68. return wmi_handle->ops->send_stop_11d_scan_cmd(wmi_handle,
  69. stop_11d_scan);
  70. return QDF_STATUS_E_FAILURE;
  71. }
  72. qdf_export_symbol(wmi_unified_send_stop_11d_scan_cmd);
  73. QDF_STATUS wmi_extract_reg_11d_new_cc_event(void *wmi_hdl,
  74. uint8_t *evt_buf,
  75. struct reg_11d_new_country *reg_11d_new_cc,
  76. uint32_t len)
  77. {
  78. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  79. if (wmi_handle->ops->extract_reg_11d_new_country_event)
  80. return wmi_handle->ops->extract_reg_11d_new_country_event(
  81. wmi_handle, evt_buf, reg_11d_new_cc, len);
  82. return QDF_STATUS_E_FAILURE;
  83. }
  84. qdf_export_symbol(wmi_extract_reg_11d_new_cc_event);
  85. QDF_STATUS wmi_unified_set_user_country_code_cmd_send(void *wmi_hdl,
  86. uint8_t pdev_id, struct cc_regdmn_s *rd)
  87. {
  88. struct wmi_unified *wmi_handle = (struct wmi_unified *) wmi_hdl;
  89. if (wmi_handle->ops->send_user_country_code_cmd)
  90. return wmi_handle->ops->send_user_country_code_cmd(
  91. wmi_handle, pdev_id, rd);
  92. return QDF_STATUS_E_FAILURE;
  93. }
  94. qdf_export_symbol(wmi_unified_set_user_country_code_cmd_send);
  95. QDF_STATUS wmi_extract_reg_ch_avoid_event(void *wmi_hdl,
  96. uint8_t *evt_buf,
  97. struct ch_avoid_ind_type *ch_avoid_ind,
  98. uint32_t len)
  99. {
  100. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  101. if (wmi_handle->ops->extract_reg_ch_avoid_event)
  102. return wmi_handle->ops->extract_reg_ch_avoid_event(
  103. wmi_handle, evt_buf, ch_avoid_ind, len);
  104. return QDF_STATUS_E_FAILURE;
  105. }
  106. qdf_export_symbol(wmi_extract_reg_ch_avoid_event);