xref: /wlan-dirver/qca-wifi-host-cmn/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h (revision 8ddef7dd9a290d4a9b1efd5d3efacf51d78a1a0d)
1 /*
2  * Copyright (c) 2019 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  * DOC: target_if_vdev_mgmt_tx_ops.h
21  *
22  * This file provides declaration for APIs to send WMI commands
23  */
24 
25 #ifndef __TARGET_IF_VDEV_MGR_TX_OPS_H__
26 #define __TARGET_IF_VDEV_MGR_TX_OPS_H__
27 
28 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
29 #include <wlan_vdev_mgr_tgt_if_tx_defs.h>
30 #include <wlan_objmgr_vdev_obj.h>
31 #include <wlan_objmgr_psoc_obj.h>
32 #include <wlan_lmac_if_def.h>
33 
34 /**
35  * target_if_vdev_mgr_wmi_handle_get() - API to get wmi handle from vdev
36  * @vdev: pointer to vdev
37  *
38  * Return: pointer to wmi_unified handle or NULL
39  */
40 struct wmi_unified *target_if_vdev_mgr_wmi_handle_get(
41 					struct wlan_objmgr_vdev *vdev);
42 
43 /**
44  * target_if_vdev_mgr_get_tx_ops() - get tx ops
45  * @psoc: pointer to psoc obj
46  *
47  * Return: pointer to tx ops
48  */
49 static inline struct wlan_lmac_if_mlme_tx_ops *
50 target_if_vdev_mgr_get_tx_ops(struct wlan_objmgr_psoc *psoc)
51 {
52 	return &psoc->soc_cb.tx_ops.mops;
53 }
54 
55 /**
56  * target_if_vdev_mgr_vdev_mlme_register_tx_ops() - define mlme lmac
57  * tx ops functions
58  * @tx_ops: pointer to lmac tx ops
59  *
60  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
61  */
62 QDF_STATUS
63 target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
64 
65 #else
66 
67 static inline QDF_STATUS
68 target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
69 {
70 	return QDF_STATUS_SUCCESS;
71 }
72 
73 #endif /* CMN_VDEV_MGR_TGT_IF_ENABLE */
74 #endif /* __TARGET_IF_VDEV_MGR_TX_OPS_H__ */
75