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
23 #include <wmi_unified_priv.h>
24 #include <wmi_unified_concurrency_api.h>
25
wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_unified_t wmi_handle,uint32_t mcc_adaptive_scheduler,uint32_t pdev_id)26 QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
27 wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler,
28 uint32_t pdev_id)
29 {
30 if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
31 return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
32 mcc_adaptive_scheduler, pdev_id);
33
34 return QDF_STATUS_E_FAILURE;
35 }
36
wmi_unified_set_mcc_channel_time_latency_cmd(wmi_unified_t wmi_handle,uint32_t mcc_channel_freq,uint32_t mcc_channel_time_latency)37 QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(
38 wmi_unified_t wmi_handle,
39 uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency)
40 {
41 if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
42 return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
43 mcc_channel_freq,
44 mcc_channel_time_latency);
45
46 return QDF_STATUS_E_FAILURE;
47 }
48
wmi_unified_set_mcc_channel_time_quota_cmd(wmi_unified_t wmi_handle,uint32_t adapter_1_chan_freq,uint32_t adapter_1_quota,uint32_t adapter_2_chan_freq)49 QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(
50 wmi_unified_t wmi_handle,
51 uint32_t adapter_1_chan_freq,
52 uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
53 {
54 if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
55 return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
56 adapter_1_chan_freq,
57 adapter_1_quota,
58 adapter_2_chan_freq);
59
60 return QDF_STATUS_E_FAILURE;
61 }
62
63 #ifdef WLAN_FEATURE_MCC_QUOTA
wmi_extract_mcc_quota_ev_param(wmi_unified_t wmi_handle,void * evt_buf,struct mcc_quota_info * param)64 QDF_STATUS wmi_extract_mcc_quota_ev_param(wmi_unified_t wmi_handle,
65 void *evt_buf,
66 struct mcc_quota_info *param)
67 {
68 if (!wmi_handle) {
69 wmi_err("wmi handle is null");
70 return QDF_STATUS_E_INVAL;
71 }
72
73 if (wmi_handle->ops->extract_mcc_quota_ev_param)
74 return wmi_handle->ops->extract_mcc_quota_ev_param(
75 wmi_handle, evt_buf, param);
76
77 return QDF_STATUS_E_FAILURE;
78 }
79 #endif
80