wmi_unified_reg_api.c 3.8 KB

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