1 /* 2 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 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 * 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_vdev_mlme_register_tx_ops() - define mlme lmac 65 * tx ops functions 66 * @tx_ops: pointer to lmac tx ops 67 * 68 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 69 */ 70 QDF_STATUS 71 target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); 72 73 /** 74 * target_if_vdev_mgr_send_fd_tmpl() - sends fils discovery template 75 * to wmi layer. 76 * @vdev: pointer to wlan objmgr vdev. 77 * @param: pointer to fils discovery template parameter 78 * 79 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 80 */ 81 QDF_STATUS target_if_vdev_mgr_send_fd_tmpl(struct wlan_objmgr_vdev *vdev, 82 struct fils_discovery_tmpl_params *param); 83 84 /** 85 * target_if_vdev_mgr_assert_mgmt() - vdev assert mgmt api 86 * @PSOC: pointer to objmgr psoc 87 * @vdev_id: vdev id 88 * 89 * Return: NA 90 */ 91 #ifdef VDEV_ASSERT_MANAGEMENT 92 static inline void target_if_vdev_mgr_assert_mgmt( 93 struct wlan_objmgr_psoc *psoc, 94 uint8_t vdev_id) 95 { 96 } 97 #else 98 static inline void target_if_vdev_mgr_assert_mgmt( 99 struct wlan_objmgr_psoc *psoc, 100 uint8_t vdev_id) 101 102 { 103 QDF_ASSERT(0); 104 } 105 #endif 106 107 /** 108 * target_if_vdev_mgr_rsp_timer_stop() - API to stop response timer for 109 * vdev manager operations 110 * @psoc: pointer to psoc object 111 * @vdev_rsp: vdev response timer 112 * @clear_bit: enum of wlan_vdev_mgr_tgt_if_rsp_bit 113 * 114 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 115 */ 116 QDF_STATUS target_if_vdev_mgr_rsp_timer_stop( 117 struct wlan_objmgr_psoc *psoc, 118 struct vdev_response_timer *vdev_rsp, 119 enum wlan_vdev_mgr_tgt_if_rsp_bit clear_bit); 120 121 /** 122 * target_if_vdev_mgr_rsp_timer_start() - API to start response timer for 123 * vdev manager operations 124 * @psoc: pointer to psoc object 125 * @vdev_rsp: vdev response timer 126 * @set_bit: enum of wlan_vdev_mgr_tgt_if_rsp_bit 127 * 128 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 129 */ 130 QDF_STATUS 131 target_if_vdev_mgr_rsp_timer_start(struct wlan_objmgr_psoc *psoc, 132 struct vdev_response_timer *vdev_rsp, 133 enum wlan_vdev_mgr_tgt_if_rsp_bit set_bit); 134 #endif /* __TARGET_IF_VDEV_MGR_TX_OPS_H__ */ 135