1 /*
2  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: contains CoAP target if declarations
19  */
20 #ifndef __TARGET_IF_COAP_H__
21 #define __TARGET_IF_COAP_H__
22 
23 #include <target_if.h>
24 
25 /**
26  * target_if_coap_register_tx_ops() - Register CoAP target_if tx ops
27  * @tx_ops: pointer to target if tx ops
28  *
29  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
30  */
31 QDF_STATUS
32 target_if_coap_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
33 
34 /**
35  * target_if_coap_get_tx_ops() - get tx ops
36  * @psoc: pointer to psoc object
37  *
38  * API to retrieve the CoAP tx ops from the psoc context
39  *
40  * Return: pointer to tx ops
41  */
42 static inline struct wlan_lmac_if_coap_tx_ops *
target_if_coap_get_tx_ops(struct wlan_objmgr_psoc * psoc)43 target_if_coap_get_tx_ops(struct wlan_objmgr_psoc *psoc)
44 {
45 	struct wlan_lmac_if_tx_ops *tx_ops;
46 
47 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
48 	if (!tx_ops) {
49 		target_if_err("tx_ops is NULL");
50 		return NULL;
51 	}
52 	return &tx_ops->coap_ops;
53 }
54 
55 #endif
56