xref: /wlan-dirver/qca-wifi-host-cmn/target_if/mlo_mgr/inc/target_if_mlo_mgr.h (revision 901120c066e139c7f8a2c8e4820561fdd83c67ef)
1 /*
2  * Copyright (c) 2021 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 /**
31  * target_if_mlo_get_rx_ops() - get rx ops
32  * @tx_ops: pointer to target_if tx ops
33  *
34  * API to retrieve the MLO rx ops from the psoc context
35  *
36  * Return: pointer to rx ops
37  */
38 static inline struct wlan_lmac_if_mlo_rx_ops *
39 target_if_mlo_get_rx_ops(struct wlan_objmgr_psoc *psoc)
40 {
41 	struct wlan_lmac_if_rx_ops *rx_ops;
42 
43 	rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
44 	if (!rx_ops) {
45 		target_if_err("rx_ops is NULL");
46 		return NULL;
47 	}
48 
49 	return &rx_ops->mlo_rx_ops;
50 }
51 
52 /**
53  * target_if_mlo_get_tx_ops() - get tx ops
54  * @tx_ops: pointer to target_if tx ops
55  *
56  * API to retrieve the MLO tx ops from the psoc context
57  *
58  * Return: pointer to tx ops
59  */
60 static inline struct wlan_lmac_if_mlo_tx_ops *
61 target_if_mlo_get_tx_ops(struct wlan_objmgr_psoc *psoc)
62 {
63 	struct wlan_lmac_if_tx_ops *tx_ops;
64 
65 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
66 	if (!tx_ops) {
67 		target_if_err("tx_ops is NULL");
68 		return NULL;
69 	}
70 
71 	return &tx_ops->mlo_ops;
72 }
73 
74 /**
75  * target_if_mlo_register_tx_ops() - lmac handler to register mlo tx ops
76  *  callback functions
77  * @tx_ops: wlan_lmac_if_tx_ops object
78  *
79  * Return: QDF_STATUS
80  */
81 QDF_STATUS
82 target_if_mlo_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
83 
84 #endif /* __TARGET_IF_MLO_MGR_H__ */
85 
86