wmi_unified_reg_api.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2017 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. /*
  40. * wmi_unified_send_start_11d_scan_cmd() - start 11d scan
  41. * @wmi_handle: wmi handle
  42. * @start_11d_scan: pointer to 11d scan start req.
  43. *
  44. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  45. */
  46. QDF_STATUS wmi_unified_send_start_11d_scan_cmd(wmi_unified_t wmi_handle,
  47. struct reg_start_11d_scan_req *start_11d_scan)
  48. {
  49. if (wmi_handle->ops->send_start_11d_scan_cmd)
  50. return wmi_handle->ops->send_start_11d_scan_cmd(wmi_handle,
  51. start_11d_scan);
  52. return QDF_STATUS_E_FAILURE;
  53. }
  54. /*
  55. * wmi_unified_send_stop_11d_scan_cmd() - stop 11d scan
  56. * @wmi_handle: wmi handle
  57. * @stop_11d_scan: pointer to 11d scan stop req.
  58. *
  59. * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  60. */
  61. QDF_STATUS wmi_unified_send_stop_11d_scan_cmd(wmi_unified_t wmi_handle,
  62. struct reg_stop_11d_scan_req *stop_11d_scan)
  63. {
  64. if (wmi_handle->ops->send_stop_11d_scan_cmd)
  65. return wmi_handle->ops->send_stop_11d_scan_cmd(wmi_handle,
  66. stop_11d_scan);
  67. return QDF_STATUS_E_FAILURE;
  68. }
  69. QDF_STATUS wmi_extract_reg_11d_new_cc_event(void *wmi_hdl,
  70. uint8_t *evt_buf,
  71. struct reg_11d_new_country *reg_11d_new_cc,
  72. uint32_t len)
  73. {
  74. struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
  75. if (wmi_handle->ops->extract_reg_11d_new_country_event)
  76. return wmi_handle->ops->extract_reg_11d_new_country_event(
  77. wmi_handle, evt_buf, reg_11d_new_cc, len);
  78. return QDF_STATUS_E_FAILURE;
  79. }
  80. QDF_STATUS wmi_unified_set_user_country_code_cmd_send(void *wmi_hdl,
  81. uint8_t pdev_id, struct cc_regdmn_s *rd)
  82. {
  83. struct wmi_unified *wmi_handle = (struct wmi_unified *) wmi_hdl;
  84. if (wmi_handle->ops->send_user_country_code_cmd)
  85. return wmi_handle->ops->send_user_country_code_cmd(
  86. wmi_handle, pdev_id, rd);
  87. return QDF_STATUS_E_FAILURE;
  88. }