xref: /wlan-driver/qcacld-3.0/core/dp/txrx/ol_rx_fwd.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2011, 2014-2017, 2019 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 #ifndef _OL_RX_FWD_H_
21*5113495bSYour Name #define _OL_RX_FWD_H_
22*5113495bSYour Name 
23*5113495bSYour Name #include <qdf_nbuf.h>           /* qdf_nbuf_t, etc. */
24*5113495bSYour Name 
25*5113495bSYour Name #include <ol_txrx_api.h>        /* ol_txrx_peer_t, etc. */
26*5113495bSYour Name 
27*5113495bSYour Name /**
28*5113495bSYour Name  * ol_rx_fwd_check() - Check if rx frames should be transmitted over WLAN.
29*5113495bSYour Name  * @vdev: which virtual device the frames were addressed to
30*5113495bSYour Name  * @peer: which peer the rx frames belong to
31*5113495bSYour Name  * @tid: which TID within the peer the rx frames belong to
32*5113495bSYour Name  * @msdu_list: NULL-terminated list of MSDUs to perform the rx->tx
33*5113495bSYour Name  *      forwarding check on
34*5113495bSYour Name  *
35*5113495bSYour Name  * Check if rx frames should be transmitted back over WLAN, instead of
36*5113495bSYour Name  * or in addition to delivering the rx frames to the OS.
37*5113495bSYour Name  * Rx frames will be forwarded to the transmit path under the following
38*5113495bSYour Name  * conditions:
39*5113495bSYour Name  * 1.  If the destination is a STA associated to the same virtual device
40*5113495bSYour Name  *     within this physical device, the rx frame will be forwarded to the
41*5113495bSYour Name  *     tx path rather than being sent to the OS.  If the destination is a
42*5113495bSYour Name  *     STA associated to a different virtual device within this physical
43*5113495bSYour Name  *     device, then the rx frame will optionally be forwarded to the tx path.
44*5113495bSYour Name  * 2.  If the frame is received by an AP, but the destination is for another
45*5113495bSYour Name  *     AP that the current AP is associated with for WDS forwarding, the
46*5113495bSYour Name  *     intermediate AP will forward the rx frame to the tx path to transmit
47*5113495bSYour Name  *     to send to the destination AP, rather than sending it to the OS.
48*5113495bSYour Name  * 3.  If the AP receives a multicast frame, it will retransmit the frame
49*5113495bSYour Name  *     within the BSS, in addition to sending the frame to the OS.
50*5113495bSYour Name  *
51*5113495bSYour Name  */
52*5113495bSYour Name void
53*5113495bSYour Name ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
54*5113495bSYour Name 		struct ol_txrx_peer_t *peer,
55*5113495bSYour Name 		unsigned int tid, qdf_nbuf_t msdu_list);
56*5113495bSYour Name 
57*5113495bSYour Name /**
58*5113495bSYour Name  * ol_get_intra_bss_fwd_pkts_count() - to get the total tx and rx packets
59*5113495bSYour Name  *   that has been forwarded from txrx layer without going to upper layers.
60*5113495bSYour Name  * @soc_hdl: Datapath soc handle
61*5113495bSYour Name  * @vdev_id: vdev id
62*5113495bSYour Name  * @fwd_tx_packets: pointer to forwarded tx packets count parameter
63*5113495bSYour Name  * @fwd_rx_packets: pointer to forwarded rx packets count parameter
64*5113495bSYour Name  *
65*5113495bSYour Name  * Return: status -> A_OK - success, A_ERROR - failure
66*5113495bSYour Name  */
67*5113495bSYour Name A_STATUS
68*5113495bSYour Name ol_get_intra_bss_fwd_pkts_count(struct cdp_soc_t *soc_hdl,
69*5113495bSYour Name 				uint8_t vdev_id,
70*5113495bSYour Name 				uint64_t *fwd_tx_packets,
71*5113495bSYour Name 				uint64_t *fwd_rx_packets);
72*5113495bSYour Name 
73*5113495bSYour Name #endif /* _OL_RX_FWD_H_ */
74