xref: /wlan-driver/qca-wifi-host-cmn/wmi/src/wmi_unified_concurrency_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name /**
20*5113495bSYour Name  * DOC: Implement API's specific to concurrency component.
21*5113495bSYour Name  */
22*5113495bSYour Name 
23*5113495bSYour Name #include <wmi_unified_priv.h>
24*5113495bSYour Name #include <wmi_unified_concurrency_api.h>
25*5113495bSYour Name 
wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_unified_t wmi_handle,uint32_t mcc_adaptive_scheduler,uint32_t pdev_id)26*5113495bSYour Name QDF_STATUS wmi_unified_set_enable_disable_mcc_adaptive_scheduler_cmd(
27*5113495bSYour Name 		wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler,
28*5113495bSYour Name 		uint32_t pdev_id)
29*5113495bSYour Name {
30*5113495bSYour Name 	if (wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd)
31*5113495bSYour Name 		return wmi_handle->ops->send_set_enable_disable_mcc_adaptive_scheduler_cmd(wmi_handle,
32*5113495bSYour Name 					mcc_adaptive_scheduler, pdev_id);
33*5113495bSYour Name 
34*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
35*5113495bSYour Name }
36*5113495bSYour Name 
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*5113495bSYour Name QDF_STATUS wmi_unified_set_mcc_channel_time_latency_cmd(
38*5113495bSYour Name 	wmi_unified_t wmi_handle,
39*5113495bSYour Name 	uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency)
40*5113495bSYour Name {
41*5113495bSYour Name 	if (wmi_handle->ops->send_set_mcc_channel_time_latency_cmd)
42*5113495bSYour Name 		return wmi_handle->ops->send_set_mcc_channel_time_latency_cmd(wmi_handle,
43*5113495bSYour Name 					mcc_channel_freq,
44*5113495bSYour Name 					mcc_channel_time_latency);
45*5113495bSYour Name 
46*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
47*5113495bSYour Name }
48*5113495bSYour Name 
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*5113495bSYour Name QDF_STATUS wmi_unified_set_mcc_channel_time_quota_cmd(
50*5113495bSYour Name 		wmi_unified_t wmi_handle,
51*5113495bSYour Name 		uint32_t adapter_1_chan_freq,
52*5113495bSYour Name 		uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq)
53*5113495bSYour Name {
54*5113495bSYour Name 	if (wmi_handle->ops->send_set_mcc_channel_time_quota_cmd)
55*5113495bSYour Name 		return wmi_handle->ops->send_set_mcc_channel_time_quota_cmd(wmi_handle,
56*5113495bSYour Name 						adapter_1_chan_freq,
57*5113495bSYour Name 						adapter_1_quota,
58*5113495bSYour Name 						adapter_2_chan_freq);
59*5113495bSYour Name 
60*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
61*5113495bSYour Name }
62*5113495bSYour Name 
63*5113495bSYour Name #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*5113495bSYour Name QDF_STATUS wmi_extract_mcc_quota_ev_param(wmi_unified_t wmi_handle,
65*5113495bSYour Name 					  void *evt_buf,
66*5113495bSYour Name 					  struct mcc_quota_info *param)
67*5113495bSYour Name {
68*5113495bSYour Name 	if (!wmi_handle) {
69*5113495bSYour Name 		wmi_err("wmi handle is null");
70*5113495bSYour Name 		return QDF_STATUS_E_INVAL;
71*5113495bSYour Name 	}
72*5113495bSYour Name 
73*5113495bSYour Name 	if (wmi_handle->ops->extract_mcc_quota_ev_param)
74*5113495bSYour Name 		return wmi_handle->ops->extract_mcc_quota_ev_param(
75*5113495bSYour Name 				wmi_handle, evt_buf, param);
76*5113495bSYour Name 
77*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
78*5113495bSYour Name }
79*5113495bSYour Name #endif
80