xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_mscs.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * @file cdp_txrx_mscs.h
21  * @brief Define the host data path MSCS API functions
22  * called by the host control SW and the OS interface module
23  */
24 #ifndef _CDP_TXRX_MSCS_H_
25 #define _CDP_TXRX_MSCS_H_
26 #include "cdp_txrx_handle.h"
27 #ifdef WLAN_SUPPORT_MSCS
28 /**
29  * @brief find MSCS enabled peer for this mac address and validate priority
30  * @details
31  *  This function checks if there is a peer for this mac adress with MSCS
32  *  enabled flag set and nbuf priority is valid from user priority bitmap.
33  *
34  * @param src_mac - source mac address of peer
35  * @param dst_mac - destination mac address of peer
36  * @param nbuf - nbuf pointer
37  * @return - 0 for non error case, 1 for failure
38  */
39 static inline int
40 cdp_mscs_peer_lookup_n_get_priority(ol_txrx_soc_handle soc,
41 	uint8_t *src_mac, uint8_t *dst_mac,
42 	qdf_nbuf_t nbuf)
43 {
44 	if (!soc || !soc->ops || !soc->ops->mscs_ops) {
45 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
46 				"%s invalid instance", __func__);
47 		return 1;
48 	}
49 
50 	if (soc->ops->mscs_ops->mscs_peer_lookup_n_get_priority)
51 		return soc->ops->mscs_ops->mscs_peer_lookup_n_get_priority(soc,
52 						src_mac, dst_mac, nbuf);
53 	return 0;
54 }
55 #endif
56 #endif
57