1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 #ifndef _CDP_TXRX_SCS_H_
20 #define _CDP_TXRX_SCS_H_
21 
22 #ifdef WLAN_SUPPORT_SCS
23 #include "cdp_txrx_handle.h"
24 
25 /**
26  * cdp_scs_peer_lookup_n_rule_match() - Find peer and check if SCS rule
27  *  is applicable for the peer or not
28  *
29  * @soc: soc handle
30  * @rule_id: scs rule id
31  * @dst_mac_addr: destination mac addr for peer lookup
32  *
33  * Return: bool true on success and false on failure
34  */
35 static inline
cdp_scs_peer_lookup_n_rule_match(ol_txrx_soc_handle soc,uint32_t rule_id,uint8_t * dst_mac_addr)36 bool cdp_scs_peer_lookup_n_rule_match(ol_txrx_soc_handle soc,
37 				      uint32_t rule_id, uint8_t *dst_mac_addr)
38 {
39 	if (!soc || !soc->ops) {
40 		dp_cdp_debug("Invalid Instance");
41 		QDF_BUG(0);
42 		return false;
43 	}
44 
45 	if (!soc->ops->scs_ops ||
46 	    !soc->ops->scs_ops->scs_peer_lookup_n_rule_match)
47 		return false;
48 
49 	return soc->ops->scs_ops->scs_peer_lookup_n_rule_match(soc, rule_id,
50 							       dst_mac_addr);
51 }
52 #endif
53 #endif
54