xref: /wlan-driver/qcacld-3.0/core/dp/txrx/ol_rx_fwd.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2011, 2014-2017, 2019 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
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef _OL_RX_FWD_H_
21 #define _OL_RX_FWD_H_
22 
23 #include <qdf_nbuf.h>           /* qdf_nbuf_t, etc. */
24 
25 #include <ol_txrx_api.h>        /* ol_txrx_peer_t, etc. */
26 
27 /**
28  * ol_rx_fwd_check() - Check if rx frames should be transmitted over WLAN.
29  * @vdev: which virtual device the frames were addressed to
30  * @peer: which peer the rx frames belong to
31  * @tid: which TID within the peer the rx frames belong to
32  * @msdu_list: NULL-terminated list of MSDUs to perform the rx->tx
33  *      forwarding check on
34  *
35  * Check if rx frames should be transmitted back over WLAN, instead of
36  * or in addition to delivering the rx frames to the OS.
37  * Rx frames will be forwarded to the transmit path under the following
38  * conditions:
39  * 1.  If the destination is a STA associated to the same virtual device
40  *     within this physical device, the rx frame will be forwarded to the
41  *     tx path rather than being sent to the OS.  If the destination is a
42  *     STA associated to a different virtual device within this physical
43  *     device, then the rx frame will optionally be forwarded to the tx path.
44  * 2.  If the frame is received by an AP, but the destination is for another
45  *     AP that the current AP is associated with for WDS forwarding, the
46  *     intermediate AP will forward the rx frame to the tx path to transmit
47  *     to send to the destination AP, rather than sending it to the OS.
48  * 3.  If the AP receives a multicast frame, it will retransmit the frame
49  *     within the BSS, in addition to sending the frame to the OS.
50  *
51  */
52 void
53 ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
54 		struct ol_txrx_peer_t *peer,
55 		unsigned int tid, qdf_nbuf_t msdu_list);
56 
57 /**
58  * ol_get_intra_bss_fwd_pkts_count() - to get the total tx and rx packets
59  *   that has been forwarded from txrx layer without going to upper layers.
60  * @soc_hdl: Datapath soc handle
61  * @vdev_id: vdev id
62  * @fwd_tx_packets: pointer to forwarded tx packets count parameter
63  * @fwd_rx_packets: pointer to forwarded rx packets count parameter
64  *
65  * Return: status -> A_OK - success, A_ERROR - failure
66  */
67 A_STATUS
68 ol_get_intra_bss_fwd_pkts_count(struct cdp_soc_t *soc_hdl,
69 				uint8_t vdev_id,
70 				uint64_t *fwd_tx_packets,
71 				uint64_t *fwd_rx_packets);
72 
73 #endif /* _OL_RX_FWD_H_ */
74