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