xref: /wlan-driver/qca-wifi-host-cmn/wmi/src/wmi_unified_fwol_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 /**
19  * DOC: Implement API's specific to fw offload component.
20  */
21 
22 #include "wmi_unified_priv.h"
23 #include "wlan_fwol_public_structs.h"
24 #include "wmi_unified_fwol_api.h"
25 
26 #ifdef WLAN_FEATURE_ELNA
27 QDF_STATUS
wmi_unified_send_set_elna_bypass_cmd(struct wmi_unified * wmi_handle,struct set_elna_bypass_request * req)28 wmi_unified_send_set_elna_bypass_cmd(struct wmi_unified *wmi_handle,
29 				     struct set_elna_bypass_request *req)
30 {
31 	if (wmi_handle->ops->send_set_elna_bypass_cmd)
32 		return wmi_handle->ops->send_set_elna_bypass_cmd(wmi_handle,
33 								 req);
34 
35 	return QDF_STATUS_E_FAILURE;
36 }
37 
38 QDF_STATUS
wmi_unified_send_get_elna_bypass_cmd(struct wmi_unified * wmi_handle,struct get_elna_bypass_request * req)39 wmi_unified_send_get_elna_bypass_cmd(struct wmi_unified *wmi_handle,
40 				     struct get_elna_bypass_request *req)
41 {
42 	if (wmi_handle->ops->send_get_elna_bypass_cmd)
43 		return wmi_handle->ops->send_get_elna_bypass_cmd(wmi_handle,
44 								 req);
45 
46 	return QDF_STATUS_E_FAILURE;
47 }
48 
49 QDF_STATUS
wmi_extract_get_elna_bypass_resp(struct wmi_unified * wmi_handle,void * resp_buf,struct get_elna_bypass_response * resp)50 wmi_extract_get_elna_bypass_resp(struct wmi_unified *wmi_handle, void *resp_buf,
51 				 struct get_elna_bypass_response *resp)
52 {
53 	if (wmi_handle->ops->extract_get_elna_bypass_resp)
54 		return wmi_handle->ops->extract_get_elna_bypass_resp(wmi_handle,
55 								     resp_buf,
56 								     resp);
57 
58 	return QDF_STATUS_E_FAILURE;
59 }
60 #endif /* WLAN_FEATURE_ELNA */
61 
62 #ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW
63 QDF_STATUS
wmi_unified_send_dscp_tip_map_cmd(struct wmi_unified * wmi_handle,uint32_t * dscp_to_tid_map)64 wmi_unified_send_dscp_tip_map_cmd(struct wmi_unified *wmi_handle,
65 				  uint32_t *dscp_to_tid_map)
66 {
67 	if (wmi_handle->ops->send_dscp_tid_map_cmd)
68 		return wmi_handle->ops->send_dscp_tid_map_cmd(wmi_handle,
69 							      dscp_to_tid_map);
70 
71 	return QDF_STATUS_E_FAILURE;
72 }
73 #endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */
74 
75 #ifdef WLAN_FEATURE_MDNS_OFFLOAD
76 QDF_STATUS
wmi_unified_send_set_mdns_config_cmd(struct wmi_unified * wmi_handle,struct mdns_config_info * mdns_info)77 wmi_unified_send_set_mdns_config_cmd(struct wmi_unified *wmi_handle,
78 				     struct mdns_config_info *mdns_info)
79 {
80 	if (wmi_handle->ops->send_set_mdns_config_cmd)
81 		return wmi_handle->ops->send_set_mdns_config_cmd(wmi_handle,
82 								 mdns_info);
83 
84 	return QDF_STATUS_E_FAILURE;
85 }
86 #endif /* WLAN_FEATURE_MDNS_OFFLOAD */
87 
88 #ifdef THERMAL_STATS_SUPPORT
89 QDF_STATUS
wmi_unified_send_get_thermal_stats_cmd(struct wmi_unified * wmi_handle,enum thermal_stats_request_type req_type,uint8_t temp_offset)90 wmi_unified_send_get_thermal_stats_cmd(struct wmi_unified *wmi_handle,
91 				       enum thermal_stats_request_type req_type,
92 				       uint8_t temp_offset)
93 {
94 	if (wmi_handle->ops->send_get_thermal_stats_cmd)
95 		return wmi_handle->ops->send_get_thermal_stats_cmd(wmi_handle,
96 								   req_type,
97 								   temp_offset);
98 
99 	return QDF_STATUS_E_FAILURE;
100 }
101 #endif /* THERMAL_STATS_SUPPORT */