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 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: target_if_global_shmem.h
19  *  This file contains declarations of global shared memory access related APIs.
20  */
21 
22 #ifndef _TARGET_IF_GLOBAL_SHMEM_H_
23 #define _TARGET_IF_GLOBAL_SHMEM_H_
24 
25 #include <qdf_types.h>
26 #include <wlan_objmgr_psoc_obj.h>
27 #include <wlan_lmac_if_def.h>
28 #include <wmi_unified_param.h>
29 
30 #ifdef WLAN_MLO_GLOBAL_SHMEM_SUPPORT
31 static inline struct wlan_lmac_if_global_shmem_local_ops *
target_if_get_global_shmem_local_ops(struct wlan_objmgr_psoc * psoc)32 target_if_get_global_shmem_local_ops(struct wlan_objmgr_psoc *psoc)
33 {
34 	struct wlan_lmac_if_tx_ops *tx_ops;
35 
36 	if (!psoc) {
37 		target_if_err("psoc is null");
38 		return NULL;
39 	}
40 
41 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
42 	if (!tx_ops) {
43 		target_if_err("tx_ops is NULL");
44 		return NULL;
45 	}
46 
47 	return &tx_ops->mlo_ops.shmem_local_ops;
48 }
49 #endif /* WLAN_MLO_GLOBAL_SHMEM_SUPPORT */
50 #endif /* _TARGET_IF_GLOBAL_SHMEM_H_ */
51