wmi_unified_concurrency_api.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  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 concurrency component.
  21. */
  22. #include <wmi_unified_priv.h>
  23. #include <wmi_unified_concurrency_api.h>
  24. QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
  25. wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler,
  26. uint32_t pdev_id)
  27. {
  28. if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
  29. return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
  30. mcc_adaptive_scheduler, pdev_id);
  31. return QDF_STATUS_E_FAILURE;
  32. }
  33. QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(
  34. wmi_unified_t wmi_handle,
  35. uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency)
  36. {
  37. if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
  38. return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
  39. mcc_channel_freq,
  40. mcc_channel_time_latency);
  41. return QDF_STATUS_E_FAILURE;
  42. }
  43. QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(
  44. wmi_unified_t wmi_handle,
  45. uint32_t adapter_1_chan_freq,
  46. uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
  47. {
  48. if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
  49. return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
  50. adapter_1_chan_freq,
  51. adapter_1_quota,
  52. adapter_2_chan_freq);
  53. return QDF_STATUS_E_FAILURE;
  54. }
  55. #ifdef WLAN_FEATURE_MCC_QUOTA
  56. QDF_STATUS wmi_extract_mcc_quota_ev_param(wmi_unified_t wmi_handle,
  57. void *evt_buf,
  58. struct mcc_quota_info *param)
  59. {
  60. if (!wmi_handle) {
  61. wmi_err("wmi handle is null");
  62. return QDF_STATUS_E_INVAL;
  63. }
  64. if (wmi_handle->ops->extract_mcc_quota_ev_param)
  65. return wmi_handle->ops->extract_mcc_quota_ev_param(
  66. wmi_handle, evt_buf, param);
  67. return QDF_STATUS_E_FAILURE;
  68. }
  69. #endif