xref: /wlan-driver/qca-wifi-host-cmn/dp/inc/cdp_txrx_raw.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2016-2017, 2019, 2021 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
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: cdp_txrx_raw.h
22*5113495bSYour Name  * Define the host data path raw mode API functions
23*5113495bSYour Name  * called by the host control SW and the OS interface module
24*5113495bSYour Name  */
25*5113495bSYour Name #ifndef _CDP_TXRX_RAW_H_
26*5113495bSYour Name #define _CDP_TXRX_RAW_H_
27*5113495bSYour Name 
28*5113495bSYour Name #include "cdp_txrx_handle.h"
29*5113495bSYour Name #include "cdp_txrx_ops.h"
30*5113495bSYour Name #include <cdp_txrx_cmn.h>
31*5113495bSYour Name 
32*5113495bSYour Name /**
33*5113495bSYour Name  * cdp_rawsim_get_astentry() - finds the ast entry for the packet
34*5113495bSYour Name  * @soc: soc handle
35*5113495bSYour Name  * @vdev_id: id of the data virtual device object
36*5113495bSYour Name  * @pnbuf: pointer to nbuf
37*5113495bSYour Name  * @raw_ast: pointer to fill ast information
38*5113495bSYour Name  *
39*5113495bSYour Name  * Finds the ast entry i.e 4th address for the packet based on the
40*5113495bSYour Name  * details in the netbuf.
41*5113495bSYour Name  *
42*5113495bSYour Name  * Return: 0 on success, -1 on error, 1 if more nbufs need to be consumed.
43*5113495bSYour Name  */
44*5113495bSYour Name 
45*5113495bSYour Name static inline QDF_STATUS
cdp_rawsim_get_astentry(ol_txrx_soc_handle soc,uint8_t vdev_id,qdf_nbuf_t * pnbuf,struct cdp_raw_ast * raw_ast)46*5113495bSYour Name cdp_rawsim_get_astentry(ol_txrx_soc_handle soc, uint8_t vdev_id,
47*5113495bSYour Name 			qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
48*5113495bSYour Name {
49*5113495bSYour Name 
50*5113495bSYour Name 	if (!soc || !soc->ops) {
51*5113495bSYour Name 		dp_cdp_debug("Invalid Instance");
52*5113495bSYour Name 		QDF_BUG(0);
53*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
54*5113495bSYour Name 	}
55*5113495bSYour Name 
56*5113495bSYour Name 	if (!soc->ops->raw_ops ||
57*5113495bSYour Name 	    !soc->ops->raw_ops->rsim_get_astentry)
58*5113495bSYour Name 		return QDF_STATUS_E_FAILURE;
59*5113495bSYour Name 
60*5113495bSYour Name 	return soc->ops->raw_ops->rsim_get_astentry(soc, vdev_id,
61*5113495bSYour Name 						    pnbuf, raw_ast);
62*5113495bSYour Name }
63*5113495bSYour Name 
64*5113495bSYour Name #endif
65