1 /*
2 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for
6 * any purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 /**
21 * DOC: target_if_vdev_mgmt_tx_ops.h
22 *
23 * This file provides declaration for APIs to send WMI commands
24 */
25
26 #ifndef __TARGET_IF_VDEV_MGR_TX_OPS_H__
27 #define __TARGET_IF_VDEV_MGR_TX_OPS_H__
28
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 *
target_if_vdev_mgr_get_tx_ops(struct wlan_objmgr_psoc * psoc)50 target_if_vdev_mgr_get_tx_ops(struct wlan_objmgr_psoc *psoc)
51 {
52 struct wlan_lmac_if_tx_ops *tx_ops;
53
54 tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
55 if (!tx_ops) {
56 mlme_err("tx_ops is NULL");
57 return NULL;
58 }
59
60 return &tx_ops->mops;
61 }
62
63 /**
64 * target_if_vdev_mgr_register_tx_ops() - register vdev mgr tx ops functions
65 * @tx_ops: pointer to lmac tx ops
66 *
67 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
68 */
69 QDF_STATUS
70 target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
71
72 /**
73 * target_if_vdev_mgr_send_fd_tmpl() - sends fils discovery template
74 * to wmi layer.
75 * @vdev: pointer to wlan objmgr vdev.
76 * @param: pointer to fils discovery template parameter
77 *
78 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
79 */
80 QDF_STATUS target_if_vdev_mgr_send_fd_tmpl(struct wlan_objmgr_vdev *vdev,
81 struct fils_discovery_tmpl_params *param);
82
83 /**
84 * target_if_vdev_mgr_assert_mgmt() - vdev assert mgmt api
85 * @psoc: pointer to objmgr psoc
86 * @vdev_id: vdev id
87 *
88 * Return: NA
89 */
90 #ifdef VDEV_ASSERT_MANAGEMENT
target_if_vdev_mgr_assert_mgmt(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)91 static inline void target_if_vdev_mgr_assert_mgmt(
92 struct wlan_objmgr_psoc *psoc,
93 uint8_t vdev_id)
94 {
95 }
96 #else
target_if_vdev_mgr_assert_mgmt(struct wlan_objmgr_psoc * psoc,uint8_t vdev_id)97 static inline void target_if_vdev_mgr_assert_mgmt(
98 struct wlan_objmgr_psoc *psoc,
99 uint8_t vdev_id)
100
101 {
102 QDF_ASSERT(0);
103 }
104 #endif
105
106 /**
107 * target_if_vdev_mgr_rsp_timer_stop() - API to stop response timer for
108 * vdev manager operations
109 * @psoc: pointer to psoc object
110 * @vdev_rsp: vdev response timer
111 * @clear_bit: enum of wlan_vdev_mgr_tgt_if_rsp_bit
112 *
113 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
114 */
115 QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
116 struct wlan_objmgr_psoc *psoc,
117 struct vdev_response_timer *vdev_rsp,
118 enum wlan_vdev_mgr_tgt_if_rsp_bit clear_bit);
119
120 /**
121 * target_if_vdev_mgr_rsp_timer_start() - API to start response timer for
122 * vdev manager operations
123 * @psoc: pointer to psoc object
124 * @vdev_rsp: vdev response timer
125 * @set_bit: enum of wlan_vdev_mgr_tgt_if_rsp_bit
126 *
127 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
128 */
129 QDF_STATUS
130 target_if_vdev_mgr_rsp_timer_start(struct wlan_objmgr_psoc *psoc,
131 struct vdev_response_timer *vdev_rsp,
132 enum wlan_vdev_mgr_tgt_if_rsp_bit set_bit);
133 #endif /* __TARGET_IF_VDEV_MGR_TX_OPS_H__ */
134