xref: /wlan-driver/qca-wifi-host-cmn/target_if/mlo_mgr/inc/target_if_mlo_mgr.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name  *
8*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name  */
16*5113495bSYour Name 
17*5113495bSYour Name /**
18*5113495bSYour Name  * DOC: target_if_mlo_mgr.h
19*5113495bSYour Name  *
20*5113495bSYour Name  * This header file provide declarations required for Rx and Tx events from
21*5113495bSYour Name  * firmware
22*5113495bSYour Name  */
23*5113495bSYour Name 
24*5113495bSYour Name #ifndef __TARGET_IF_MLO_MGR_H__
25*5113495bSYour Name #define __TARGET_IF_MLO_MGR_H__
26*5113495bSYour Name 
27*5113495bSYour Name #include <target_if.h>
28*5113495bSYour Name #include <wlan_lmac_if_def.h>
29*5113495bSYour Name 
30*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO
31*5113495bSYour Name /**
32*5113495bSYour Name  * target_if_mlo_get_rx_ops() - get rx ops
33*5113495bSYour Name  * @psoc: pointer to soc object
34*5113495bSYour Name  *
35*5113495bSYour Name  * API to retrieve the MLO rx ops from the psoc context
36*5113495bSYour Name  *
37*5113495bSYour Name  * Return: pointer to rx ops
38*5113495bSYour Name  */
39*5113495bSYour Name static inline struct wlan_lmac_if_mlo_rx_ops *
target_if_mlo_get_rx_ops(struct wlan_objmgr_psoc * psoc)40*5113495bSYour Name target_if_mlo_get_rx_ops(struct wlan_objmgr_psoc *psoc)
41*5113495bSYour Name {
42*5113495bSYour Name 	struct wlan_lmac_if_rx_ops *rx_ops;
43*5113495bSYour Name 
44*5113495bSYour Name 	rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
45*5113495bSYour Name 	if (!rx_ops) {
46*5113495bSYour Name 		target_if_err("rx_ops is NULL");
47*5113495bSYour Name 		return NULL;
48*5113495bSYour Name 	}
49*5113495bSYour Name 
50*5113495bSYour Name 	return &rx_ops->mlo_rx_ops;
51*5113495bSYour Name }
52*5113495bSYour Name 
53*5113495bSYour Name /**
54*5113495bSYour Name  * target_if_mlo_get_tx_ops() - get tx ops
55*5113495bSYour Name  * @psoc: pointer to soc object
56*5113495bSYour Name  *
57*5113495bSYour Name  * API to retrieve the MLO tx ops from the psoc context
58*5113495bSYour Name  *
59*5113495bSYour Name  * Return: pointer to tx ops
60*5113495bSYour Name  */
61*5113495bSYour Name static inline struct wlan_lmac_if_mlo_tx_ops *
target_if_mlo_get_tx_ops(struct wlan_objmgr_psoc * psoc)62*5113495bSYour Name target_if_mlo_get_tx_ops(struct wlan_objmgr_psoc *psoc)
63*5113495bSYour Name {
64*5113495bSYour Name 	struct wlan_lmac_if_tx_ops *tx_ops;
65*5113495bSYour Name 
66*5113495bSYour Name 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
67*5113495bSYour Name 	if (!tx_ops) {
68*5113495bSYour Name 		target_if_err("tx_ops is NULL");
69*5113495bSYour Name 		return NULL;
70*5113495bSYour Name 	}
71*5113495bSYour Name 
72*5113495bSYour Name 	return &tx_ops->mlo_ops;
73*5113495bSYour Name }
74*5113495bSYour Name 
75*5113495bSYour Name /**
76*5113495bSYour Name  * target_if_mlo_register_tx_ops() - lmac handler to register mlo tx ops
77*5113495bSYour Name  *  callback functions
78*5113495bSYour Name  * @tx_ops: wlan_lmac_if_tx_ops object
79*5113495bSYour Name  *
80*5113495bSYour Name  * Return: QDF_STATUS
81*5113495bSYour Name  */
82*5113495bSYour Name QDF_STATUS
83*5113495bSYour Name target_if_mlo_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
84*5113495bSYour Name 
85*5113495bSYour Name /**
86*5113495bSYour Name  * target_if_mlo_send_link_removal_cmd() - Send WMI command for MLO link removal
87*5113495bSYour Name  * @psoc: psoc pointer
88*5113495bSYour Name  * @param: MLO link removal command parameters
89*5113495bSYour Name  *
90*5113495bSYour Name  * Return: QDF_STATUS of operation
91*5113495bSYour Name  */
92*5113495bSYour Name QDF_STATUS target_if_mlo_send_link_removal_cmd(
93*5113495bSYour Name 		struct wlan_objmgr_psoc *psoc,
94*5113495bSYour Name 		const struct mlo_link_removal_cmd_params *param);
95*5113495bSYour Name 
96*5113495bSYour Name /**
97*5113495bSYour Name  * target_if_mlo_send_vdev_pause() - Send WMI command for MLO vdev pause
98*5113495bSYour Name  * @psoc: psoc pointer
99*5113495bSYour Name  * @info: MLO vdev pause information
100*5113495bSYour Name  *
101*5113495bSYour Name  * Return: QDF_STATUS of operation
102*5113495bSYour Name  */
103*5113495bSYour Name QDF_STATUS target_if_mlo_send_vdev_pause(struct wlan_objmgr_psoc *psoc,
104*5113495bSYour Name 					 struct mlo_vdev_pause *info);
105*5113495bSYour Name 
106*5113495bSYour Name /**
107*5113495bSYour Name  * target_if_extract_mlo_link_removal_info_mgmt_rx() - Extract MLO link removal
108*5113495bSYour Name  * information from MGMT Rx event
109*5113495bSYour Name  * @wmi_handle: WMI handle
110*5113495bSYour Name  * @evt_buf: Event buffer
111*5113495bSYour Name  * @rx_event: MGMT Rx event parameters
112*5113495bSYour Name  *
113*5113495bSYour Name  * Return: QDF_STATUS of operation
114*5113495bSYour Name  */
115*5113495bSYour Name QDF_STATUS
116*5113495bSYour Name target_if_extract_mlo_link_removal_info_mgmt_rx(
117*5113495bSYour Name 		wmi_unified_t wmi_handle,
118*5113495bSYour Name 		void *evt_buf,
119*5113495bSYour Name 		struct mgmt_rx_event_params *rx_event);
120*5113495bSYour Name 
121*5113495bSYour Name /**
122*5113495bSYour Name  * target_if_mlo_register_mlo_link_state_info_event -
123*5113495bSYour Name  *  Register mlo link state event
124*5113495bSYour Name  * @wmi_handle: WMI handle
125*5113495bSYour Name  */
126*5113495bSYour Name void target_if_mlo_register_mlo_link_state_info_event(
127*5113495bSYour Name 		struct wmi_unified *wmi_handle);
128*5113495bSYour Name 
129*5113495bSYour Name /**
130*5113495bSYour Name  * target_if_mlo_unregister_mlo_link_state_info_event -
131*5113495bSYour Name  *  Unregister mlo link state event
132*5113495bSYour Name  * @wmi_handle: WMI handle
133*5113495bSYour Name  */
134*5113495bSYour Name void target_if_mlo_unregister_mlo_link_state_info_event(
135*5113495bSYour Name 		struct wmi_unified *wmi_handle);
136*5113495bSYour Name 
137*5113495bSYour Name /**
138*5113495bSYour Name  * target_if_mlo_register_vdev_tid_to_link_map_event() - Register T2LM event
139*5113495bSYour Name  * handler.
140*5113495bSYour Name  * @wmi_handle: WMI handle
141*5113495bSYour Name  *
142*5113495bSYour Name  * Return: None
143*5113495bSYour Name  */
144*5113495bSYour Name void target_if_mlo_register_vdev_tid_to_link_map_event(
145*5113495bSYour Name 		struct wmi_unified *wmi_handle);
146*5113495bSYour Name 
147*5113495bSYour Name /**
148*5113495bSYour Name  * target_if_mlo_unregister_vdev_tid_to_link_map_event() - Unregister T2LM event
149*5113495bSYour Name  * handler.
150*5113495bSYour Name  * @wmi_handle: WMI handle
151*5113495bSYour Name  *
152*5113495bSYour Name  * Return: None
153*5113495bSYour Name  */
154*5113495bSYour Name void target_if_mlo_unregister_vdev_tid_to_link_map_event(
155*5113495bSYour Name 		struct wmi_unified *wmi_handle);
156*5113495bSYour Name #else
157*5113495bSYour Name static inline QDF_STATUS
target_if_extract_mlo_link_removal_info_mgmt_rx(wmi_unified_t wmi_handle,void * evt_buf,struct mgmt_rx_event_params * rx_event)158*5113495bSYour Name target_if_extract_mlo_link_removal_info_mgmt_rx(
159*5113495bSYour Name 		wmi_unified_t wmi_handle,
160*5113495bSYour Name 		void *evt_buf,
161*5113495bSYour Name 		struct mgmt_rx_event_params *rx_event)
162*5113495bSYour Name {
163*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
164*5113495bSYour Name }
165*5113495bSYour Name 
166*5113495bSYour Name static inline
target_if_mlo_register_vdev_tid_to_link_map_event(struct wmi_unified * wmi_handle)167*5113495bSYour Name void target_if_mlo_register_vdev_tid_to_link_map_event(
168*5113495bSYour Name 		struct wmi_unified *wmi_handle)
169*5113495bSYour Name {
170*5113495bSYour Name }
171*5113495bSYour Name 
172*5113495bSYour Name static inline
target_if_mlo_unregister_vdev_tid_to_link_map_event(struct wmi_unified * wmi_handle)173*5113495bSYour Name void target_if_mlo_unregister_vdev_tid_to_link_map_event(
174*5113495bSYour Name 		struct wmi_unified *wmi_handle)
175*5113495bSYour Name {
176*5113495bSYour Name }
177*5113495bSYour Name #endif
178*5113495bSYour Name #endif /* __TARGET_IF_MLO_MGR_H__ */
179