1 /*
2 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18 /**
19 * DOC: target_if_dcs.h
20 *
21 * This header file provide declarations required for Rx and Tx events from
22 * firmware
23 */
24
25 #ifndef __TARGET_IF_DCS_H__
26 #define __TARGET_IF_DCS_H__
27
28 #include <target_if.h>
29 #include <wlan_lmac_if_def.h>
30
31 /**
32 * target_if_dcs_get_rx_ops() - get rx ops
33 * @psoc: pointer to psoc context
34 *
35 * API to retrieve the dcs rx ops from the psoc context
36 *
37 * Return: pointer to rx ops
38 */
39 static inline struct wlan_target_if_dcs_rx_ops *
target_if_dcs_get_rx_ops(struct wlan_objmgr_psoc * psoc)40 target_if_dcs_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 return &rx_ops->dcs_rx_ops;
50 }
51
52 /**
53 * target_if_dcs_get_tx_ops() - get tx ops
54 * @psoc: pointer to psoc context
55 *
56 * API to retrieve the dcs tx ops from the psoc context
57 *
58 * Return: pointer to tx ops
59 */
60 static inline struct wlan_target_if_dcs_tx_ops *
target_if_dcs_get_tx_ops(struct wlan_objmgr_psoc * psoc)61 target_if_dcs_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 return &tx_ops->dcs_tx_ops;
71 }
72
73 /**
74 * target_if_dcs_register_tx_ops() - register dcs target_if tx ops functions
75 * @tx_ops: pointer to target_if tx ops
76 *
77 * API to register dcs tx ops
78 *
79 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
80 */
81 QDF_STATUS
82 target_if_dcs_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
83
84 #endif /* __TARGET_IF_DCS_H__ */
85
86