1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 #include "wmi_unified_priv.h"
17 #ifdef WLAN_MLO_MULTI_CHIP
18 #include "wmi_unified_11be_setup_api.h"
19 #endif
20 #include "wmi_unified_11be_tlv.h"
21 
22 /**
23  *  wmi_mlo_setup_cmd_send() - Send MLO setup command
24  *  @wmi_handle: WMI handle for this pdev
25  *  @params: MLO setup params
26  *
27  *  Return: QDF_STATUS code
28  */
wmi_mlo_setup_cmd_send(wmi_unified_t wmi_handle,struct wmi_mlo_setup_params * params)29 QDF_STATUS wmi_mlo_setup_cmd_send(wmi_unified_t wmi_handle,
30 				  struct wmi_mlo_setup_params *params)
31 {
32 	if (wmi_handle->ops->mlo_setup_cmd_send)
33 		return wmi_handle->ops->mlo_setup_cmd_send(
34 				wmi_handle, params);
35 
36 	return QDF_STATUS_E_FAILURE;
37 }
38 
39 /**
40  *  wmi_mlo_teardown_cmd_send() - Send MLO teardown command
41  *  @wmi_handle: WMI handle for this pdev
42  *  @params: MLO teardown params
43  *
44  *  Return: QDF_STATUS code
45  */
wmi_mlo_teardown_cmd_send(wmi_unified_t wmi_handle,struct wmi_mlo_teardown_params * params)46 QDF_STATUS wmi_mlo_teardown_cmd_send(wmi_unified_t wmi_handle,
47 				     struct wmi_mlo_teardown_params *params)
48 {
49 	if (wmi_handle->ops->mlo_teardown_cmd_send)
50 		return wmi_handle->ops->mlo_teardown_cmd_send(
51 				wmi_handle, params);
52 
53 	return QDF_STATUS_E_FAILURE;
54 }
55 
56 /**
57  *  wmi_mlo_ready_cmd_send() - Send MLO ready command
58  *  @wmi_handle: WMI handle for this pdev
59  *  @params: MLO ready params
60  *
61  *  Return: QDF_STATUS code
62  */
wmi_mlo_ready_cmd_send(wmi_unified_t wmi_handle,struct wmi_mlo_ready_params * params)63 QDF_STATUS wmi_mlo_ready_cmd_send(wmi_unified_t wmi_handle,
64 				  struct wmi_mlo_ready_params *params)
65 {
66 	if (wmi_handle->ops->mlo_ready_cmd_send)
67 		return wmi_handle->ops->mlo_ready_cmd_send(
68 				wmi_handle, params);
69 
70 	return QDF_STATUS_E_FAILURE;
71 }
72 
73 /**
74  *  wmi_extract_mlo_setup_cmpl_event() - Extract MLO setup completion event
75  *  @wmi_handle: WMI handle for this pdev
76  *  @buf: Event buffer
77  *  @params: MLO setup event params
78  *
79  *  Return: QDF_STATUS code
80  */
81 QDF_STATUS
wmi_extract_mlo_setup_cmpl_event(wmi_unified_t wmi_handle,uint8_t * buf,struct wmi_mlo_setup_complete_params * params)82 wmi_extract_mlo_setup_cmpl_event(wmi_unified_t wmi_handle,
83 				 uint8_t *buf,
84 				 struct wmi_mlo_setup_complete_params *params)
85 {
86 	if (wmi_handle->ops->extract_mlo_setup_cmpl_event)
87 		return wmi_handle->ops->extract_mlo_setup_cmpl_event(
88 				wmi_handle, buf, params);
89 
90 	return QDF_STATUS_E_FAILURE;
91 }
92 
93 /**
94  *  wmi_extract_mlo_teardown_cmpl_event() - Extract MLO teardown completion
95  *  @wmi_handle: WMI handle for this pdev
96  *  @buf: Event buffer
97  *  @param: MLO teardown event params
98  *
99  *  Return: QDF_STATUS code
100  */
101 QDF_STATUS
wmi_extract_mlo_teardown_cmpl_event(wmi_unified_t wmi_handle,uint8_t * buf,struct wmi_mlo_teardown_cmpl_params * param)102 wmi_extract_mlo_teardown_cmpl_event(wmi_unified_t wmi_handle,
103 				    uint8_t *buf,
104 				    struct wmi_mlo_teardown_cmpl_params *param)
105 {
106 	if (wmi_handle->ops->extract_mlo_teardown_cmpl_event)
107 		return wmi_handle->ops->extract_mlo_teardown_cmpl_event(
108 				wmi_handle, buf, param);
109 
110 	return QDF_STATUS_E_FAILURE;
111 }
112