xref: /wlan-dirver/qca-wifi-host-cmn/target_if/mlo_mgr/inc/target_if_mlo_mgr.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 
17 /**
18  * DOC: target_if_mlo_mgr.h
19  *
20  * This header file provide declarations required for Rx and Tx events from
21  * firmware
22  */
23 
24 #ifndef __TARGET_IF_MLO_MGR_H__
25 #define __TARGET_IF_MLO_MGR_H__
26 
27 #include <target_if.h>
28 #include <wlan_lmac_if_def.h>
29 
30 #ifdef WLAN_FEATURE_11BE_MLO
31 /**
32  * target_if_mlo_get_rx_ops() - get rx ops
33  * @psoc: pointer to soc object
34  *
35  * API to retrieve the MLO rx ops from the psoc context
36  *
37  * Return: pointer to rx ops
38  */
39 static inline struct wlan_lmac_if_mlo_rx_ops *
40 target_if_mlo_get_rx_ops(struct wlan_objmgr_psoc *psoc)
41 {
42 	struct wlan_lmac_if_rx_ops *rx_ops;
43 
44 	rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
45 	if (!rx_ops) {
46 		target_if_err("rx_ops is NULL");
47 		return NULL;
48 	}
49 
50 	return &rx_ops->mlo_rx_ops;
51 }
52 
53 /**
54  * target_if_mlo_get_tx_ops() - get tx ops
55  * @psoc: pointer to soc object
56  *
57  * API to retrieve the MLO tx ops from the psoc context
58  *
59  * Return: pointer to tx ops
60  */
61 static inline struct wlan_lmac_if_mlo_tx_ops *
62 target_if_mlo_get_tx_ops(struct wlan_objmgr_psoc *psoc)
63 {
64 	struct wlan_lmac_if_tx_ops *tx_ops;
65 
66 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
67 	if (!tx_ops) {
68 		target_if_err("tx_ops is NULL");
69 		return NULL;
70 	}
71 
72 	return &tx_ops->mlo_ops;
73 }
74 
75 /**
76  * target_if_mlo_register_tx_ops() - lmac handler to register mlo tx ops
77  *  callback functions
78  * @tx_ops: wlan_lmac_if_tx_ops object
79  *
80  * Return: QDF_STATUS
81  */
82 QDF_STATUS
83 target_if_mlo_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
84 
85 /**
86  * target_if_mlo_send_link_removal_cmd() - Send WMI command for MLO link removal
87  * @psoc: psoc pointer
88  * @param: MLO link removal command parameters
89  *
90  * Return: QDF_STATUS of operation
91  */
92 QDF_STATUS target_if_mlo_send_link_removal_cmd(
93 		struct wlan_objmgr_psoc *psoc,
94 		const struct mlo_link_removal_cmd_params *param);
95 
96 /**
97  * target_if_extract_mlo_link_removal_info_mgmt_rx() - Extract MLO link removal
98  * information from MGMT Rx event
99  * @wmi_handle: WMI handle
100  * @evt_buf: Event buffer
101  * @rx_event: MGMT Rx event parameters
102  *
103  * Return: QDF_STATUS of operation
104  */
105 QDF_STATUS
106 target_if_extract_mlo_link_removal_info_mgmt_rx(
107 		wmi_unified_t wmi_handle,
108 		void *evt_buf,
109 		struct mgmt_rx_event_params *rx_event);
110 
111 /**
112  * target_if_mlo_register_vdev_tid_to_link_map_event() - Register T2LM event
113  * handler.
114  * @wmi_handle: WMI handle
115  *
116  * Return: None
117  */
118 void target_if_mlo_register_vdev_tid_to_link_map_event(
119 		struct wmi_unified *wmi_handle);
120 
121 /**
122  * target_if_mlo_unregister_vdev_tid_to_link_map_event() - Unregister T2LM event
123  * handler.
124  * @wmi_handle: WMI handle
125  *
126  * Return: None
127  */
128 void target_if_mlo_unregister_vdev_tid_to_link_map_event(
129 		struct wmi_unified *wmi_handle);
130 #else
131 static inline QDF_STATUS
132 target_if_extract_mlo_link_removal_info_mgmt_rx(
133 		wmi_unified_t wmi_handle,
134 		void *evt_buf,
135 		struct mgmt_rx_event_params *rx_event)
136 {
137 	return QDF_STATUS_SUCCESS;
138 }
139 
140 static inline
141 void target_if_mlo_register_vdev_tid_to_link_map_event(
142 		struct wmi_unified *wmi_handle)
143 {
144 }
145 
146 static inline
147 void target_if_mlo_unregister_vdev_tid_to_link_map_event(
148 		struct wmi_unified *wmi_handle)
149 {
150 }
151 #endif
152 #endif /* __TARGET_IF_MLO_MGR_H__ */
153