xref: /wlan-dirver/qca-wifi-host-cmn/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
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 #include <wlan_vdev_mgr_tgt_if_tx_defs.h>
29 #include <wlan_objmgr_vdev_obj.h>
30 #include <wlan_objmgr_psoc_obj.h>
31 #include <wlan_lmac_if_def.h>
32 
33 /**
34  * target_if_vdev_mgr_wmi_handle_get() - API to get wmi handle from vdev
35  * @vdev: pointer to vdev
36  *
37  * Return: pointer to wmi_unified handle or NULL
38  */
39 struct wmi_unified *target_if_vdev_mgr_wmi_handle_get(
40 					struct wlan_objmgr_vdev *vdev);
41 
42 /**
43  * target_if_vdev_mgr_get_tx_ops() - get tx ops
44  * @psoc: pointer to psoc obj
45  *
46  * Return: pointer to tx ops
47  */
48 static inline struct wlan_lmac_if_mlme_tx_ops *
49 target_if_vdev_mgr_get_tx_ops(struct wlan_objmgr_psoc *psoc)
50 {
51 	return &psoc->soc_cb.tx_ops.mops;
52 }
53 
54 /**
55  * target_if_vdev_mgr_vdev_mlme_register_tx_ops() - define mlme lmac
56  * tx ops functions
57  * @tx_ops: pointer to lmac tx ops
58  *
59  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
60  */
61 QDF_STATUS
62 target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
63 
64 /**
65  * target_if_vdev_mgr_assert_mgmt() - vdev assert mgmt api
66  * @vdev: pointer to objmgr vdev
67  * @vdev_rsp: pointer to vdev mlme response timer
68  * @set_bit: bit to be set
69  *
70  * Return: NA
71  */
72 #ifdef VDEV_ASSERT_MANAGEMENT
73 static inline void target_if_vdev_mgr_assert_mgmt(
74 					struct wlan_objmgr_vdev *vdev,
75 					struct vdev_response_timer *vdev_rsp,
76 					uint8_t set_bit)
77 {
78 }
79 #else
80 static inline void target_if_vdev_mgr_assert_mgmt(
81 					struct wlan_objmgr_vdev *vdev,
82 					struct vdev_response_timer *vdev_rsp,
83 					uint8_t set_bit)
84 {
85 	QDF_ASSERT(0);
86 }
87 #endif
88 
89 /**
90  * target_if_vdev_mgr_rsp_timer_stop() - API to stop response timer for
91  * vdev manager operations
92  * @vdev: pointer to vdev object
93  * @vdev_rsp: pointer to response timer
94  * @clear_bit: acton bit
95  *
96  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
97  */
98 QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
99 					struct wlan_objmgr_vdev *vdev,
100 					struct vdev_response_timer *vdev_rsp,
101 					uint8_t clear_bit);
102 #endif /* __TARGET_IF_VDEV_MGR_TX_OPS_H__ */
103